From owner-svn-src-head@freebsd.org Sun Mar 13 01:14:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB729A92F83; Sun, 13 Mar 2016 01:14:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6D4556D1; Sun, 13 Mar 2016 01:14:46 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1aeuc6-0008zb-VU; Sun, 13 Mar 2016 04:14:34 +0300 Date: Sun, 13 Mar 2016 04:14:34 +0300 From: Slawa Olhovchenkov To: Navdeep Parhar Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296689 - head/sys/dev/cxgbe Message-ID: <20160313011434.GD94639@zxy.spb.ru> References: <201603112324.u2BNO5gx004444@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603112324.u2BNO5gx004444@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:14:46 -0000 On Fri, Mar 11, 2016 at 11:24:05PM +0000, Navdeep Parhar wrote: > Author: np > Date: Fri Mar 11 23:24:04 2016 > New Revision: 296689 > URL: https://svnweb.freebsd.org/changeset/base/296689 > > Log: > cxgbe(4): sysctls to display the TOE's TCP timers. > > cask:~# sysctl -d dev.t5nex.0.toe > dev.t5nex.0.toe.finwait2_timer: FINWAIT2 timer (us) > dev.t5nex.0.toe.initial_srtt: Initial SRTT (us) > dev.t5nex.0.toe.keepalive_intvl: Keepidle interval (us) > dev.t5nex.0.toe.keepalive_idle: Keepidle idle timer (us) > dev.t5nex.0.toe.persist_max: Persist timer max (us) > dev.t5nex.0.toe.persist_min: Persist timer min (us) > dev.t5nex.0.toe.rexmt_max: Retransmit max (us) > dev.t5nex.0.toe.rexmt_min: Retransmit min (us) > dev.t5nex.0.toe.dack_timer: DACK timer (us) > dev.t5nex.0.toe.dack_tick: DACK tick (us) > dev.t5nex.0.toe.timestamp_tick: TCP timestamp tick (us) > dev.t5nex.0.toe.timer_tick: TP timer tick (us) > ... > > cask:~# sysctl dev.t5nex.0.toe > dev.t5nex.0.toe.finwait2_timer: 9765440 > dev.t5nex.0.toe.initial_srtt: 244128 > dev.t5nex.0.toe.keepalive_intvl: 73240800 > dev.t5nex.0.toe.keepalive_idle: 7031116800 > dev.t5nex.0.toe.persist_max: 9765440 > dev.t5nex.0.toe.persist_min: 976544 > dev.t5nex.0.toe.rexmt_max: 9765440 > dev.t5nex.0.toe.rexmt_min: 244128 > dev.t5nex.0.toe.dack_timer: 19520 > dev.t5nex.0.toe.dack_tick: 32.768 > dev.t5nex.0.toe.timestamp_tick: 1048.576 > dev.t5nex.0.toe.timer_tick: 32.768 > ... Can you more describe it in man? I am see this timers different from system, is this problem? What correlations between? From owner-svn-src-head@freebsd.org Sun Mar 13 01:47:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84CEBACDF23; Sun, 13 Mar 2016 01:47:43 +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 3B32BD1D; Sun, 13 Mar 2016 01:47:43 +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 u2D1lgD6097398; Sun, 13 Mar 2016 01:47:42 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1lgQb097397; Sun, 13 Mar 2016 01:47:42 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603130147.u2D1lgQb097397@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 13 Mar 2016 01:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296789 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:47:43 -0000 Author: jmcneill Date: Sun Mar 13 01:47:42 2016 New Revision: 296789 URL: https://svnweb.freebsd.org/changeset/base/296789 Log: Fix display output for non-HDMI display devices. Only set the display to HDMI mode if a CEA-861 extension block was found on the connected display. PR: 207912 Approved by: gonzo (mentor) Modified: head/sys/arm/allwinner/a10_hdmi.c Modified: head/sys/arm/allwinner/a10_hdmi.c ============================================================================== --- head/sys/arm/allwinner/a10_hdmi.c Sun Mar 13 01:20:20 2016 (r296788) +++ head/sys/arm/allwinner/a10_hdmi.c Sun Mar 13 01:47:42 2016 (r296789) @@ -203,6 +203,7 @@ struct a10hdmi_softc { uint8_t edid[EDID_LENGTH]; + int has_hdmi; int has_audio; }; @@ -371,27 +372,29 @@ a10hdmi_ddc_read(struct a10hdmi_softc *s return (0); } -static int -a10hdmi_detect_audio(struct a10hdmi_softc *sc) +static void +a10hdmi_detect_hdmi(struct a10hdmi_softc *sc, int *phdmi, int *paudio) { struct edid_info ei; uint8_t edid[EDID_LENGTH]; int block; + *phdmi = *paudio = 0; + if (edid_parse(sc->edid, &ei) != 0) - return (0); + return; /* Scan through extension blocks, looking for a CEA-861 block. */ for (block = 1; block <= ei.edid_ext_block_count; block++) { if (a10hdmi_ddc_read(sc, block, edid) != 0) - break; + return; - if (edid[EXT_TAG] == CEA_TAG_ID) - return ((edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0); + if (edid[EXT_TAG] == CEA_TAG_ID) { + *phdmi = 1; + *paudio = ((edid[CEA_DTD] & DTD_BASIC_AUDIO) != 0); + return; + } } - - /* No CEA-861 block found */ - return (0); } static int @@ -426,9 +429,9 @@ a10hdmi_get_edid(device_t dev, uint8_t * } if (error == 0) - sc->has_audio = a10hdmi_detect_audio(sc); + a10hdmi_detect_hdmi(sc, &sc->has_hdmi, &sc->has_audio); else - sc->has_audio = 0; + sc->has_hdmi = sc->has_audio = 0; return (error); } @@ -515,7 +518,9 @@ a10hdmi_set_videomode(device_t dev, cons PLLCTRL0_VCO_S); /* Setup display settings */ - val = VID_CTRL_HDMI_MODE; + val = 0; + if (sc->has_hdmi) + val |= VID_CTRL_HDMI_MODE; if (mode->flags & VID_INTERLACE) val |= VID_CTRL_INTERLACE; if (mode->flags & VID_DBLSCAN) From owner-svn-src-head@freebsd.org Sun Mar 13 01:49:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 895C8ACDFD2; Sun, 13 Mar 2016 01:49:37 +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 5A759E8C; Sun, 13 Mar 2016 01:49:37 +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 u2D1naNM097515; Sun, 13 Mar 2016 01:49:36 GMT (envelope-from jmcneill@FreeBSD.org) Received: (from jmcneill@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2D1naFd097514; Sun, 13 Mar 2016 01:49:36 GMT (envelope-from jmcneill@FreeBSD.org) Message-Id: <201603130149.u2D1naFd097514@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jmcneill set sender to jmcneill@FreeBSD.org using -f From: Jared McNeill Date: Sun, 13 Mar 2016 01:49:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296790 - head/sys/boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 01:49:37 -0000 Author: jmcneill Date: Sun Mar 13 01:49:36 2016 New Revision: 296790 URL: https://svnweb.freebsd.org/changeset/base/296790 Log: Add HDMI device nodes to Banana Pi dts. PR: 207912 Approved by: gonzo (mentor) Modified: head/sys/boot/fdt/dts/arm/bananapi.dts Modified: head/sys/boot/fdt/dts/arm/bananapi.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/bananapi.dts Sun Mar 13 01:47:42 2016 (r296789) +++ head/sys/boot/fdt/dts/arm/bananapi.dts Sun Mar 13 01:49:36 2016 (r296790) @@ -74,6 +74,21 @@ ahci: sata@01c18000 { status = "okay"; }; + + hdmi: hdmi@01c16000 { + compatible = "allwinner,sun7i-a20-hdmi"; + reg = <0x01c16000 0x1000>; + }; + + hdmiaudio { + compatible = "allwinner,sun7i-a20-hdmiaudio"; + }; + + fb: fb@01e60000 { + compatible = "allwinner,sun7i-a20-fb"; + reg = <0x01e60000 0x10000>, /* DEBE0 */ + <0x01c0c000 0x1000>; /* LCD0 */ + }; }; leds { From owner-svn-src-head@freebsd.org Sun Mar 13 08:15:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A3E0AA92E5C; Sun, 13 Mar 2016 08:15:27 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pf0-x22f.google.com (mail-pf0-x22f.google.com [IPv6:2607:f8b0:400e:c00::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 75A76793; Sun, 13 Mar 2016 08:15:27 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: by mail-pf0-x22f.google.com with SMTP id u190so84180291pfb.3; Sun, 13 Mar 2016 00:15:27 -0800 (PST) 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=4L3pggeTLC48/luQVrWJPjdjnIspfZ4kxMU6Jw0/+pI=; b=L9KWdVj5hJCqTbklUW0IVbwS7doWXJa+MGFkCP2rLObr2o7SoMcTvFEGG+v9LTZEwT K+CHj3DWZF3d8Iy+Tyj28TBV2w49sl2QVRBKpOep/evG8dRGyZAKo00ryf22frS3+yAu ZkA2K0A8R3ebvb/rg4Frh3dbWNSmOY+SS5PM1aelcA9WGZ8n8c0G1mJLo4rqMGsSTnpm 07kDUn0VWYl8p05R5ML9cbk1/XTtURPXcyWM2MdKkhIJIbApP2g/GXKgMwuzLAXbPNU/ IcC+4+GyoVXS/Fat291YTwMGSPVF3rH/QVZrkmgVemHqy2BgEdK19BB/uep/AbfhJeVG oUjQ== 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=4L3pggeTLC48/luQVrWJPjdjnIspfZ4kxMU6Jw0/+pI=; b=JoOOmWpvfQoKYfowsrkt8G10ckccxL1p5fE468fOwdBBblqJ2Xqvbi0ZJ1laRWXoOz gP6CvTRhbw3vX/Xfeozs7szjsK3pyu4T11gDZmkm/yfLwOHcFK3gjMMVnbLG/++WQU6D F1qCVmrVzqx+EimOJF2M1Gg3ZGrwqLV9AqdnKZWrRQnVXFmlP41G7pplESF3x0ZPAngm 466cv2uM63PMi4g2INnox66Gw8L9ENscUt7ClzgRDnbS9DhHigPzkjLACnnAWlXsPdjF AAabm+cHTf/VL3N9ldE843jSAJFVumln4ix5MzXQisI+djD0Ac1EQzQrmVNwRabD0kS3 mOjQ== X-Gm-Message-State: AD7BkJLlHyTiYVsXh4T1v9bh1Gzdt93oCY1Y1owQ4b8u02iBEvNkg0SZyoPwpl5LjTFNZA== X-Received: by 10.98.75.138 with SMTP id d10mr21061844pfj.108.1457856926927; Sun, 13 Mar 2016 00:15:26 -0800 (PST) Received: from ox ([2601:641:c000:e00:64b0:bda4:3e49:9699]) by smtp.gmail.com with ESMTPSA id ql1sm23948819pac.24.2016.03.13.00.15.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sun, 13 Mar 2016 00:15:25 -0800 (PST) Sender: Navdeep Parhar Date: Sun, 13 Mar 2016 00:15:18 -0800 From: Navdeep Parhar To: Slawa Olhovchenkov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296689 - head/sys/dev/cxgbe Message-ID: <20160313081518.GA7325@ox> Mail-Followup-To: Slawa Olhovchenkov , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603112324.u2BNO5gx004444@repo.freebsd.org> <20160313011434.GD94639@zxy.spb.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160313011434.GD94639@zxy.spb.ru> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 08:15:27 -0000 On Sun, Mar 13, 2016 at 04:14:34AM +0300, Slawa Olhovchenkov wrote: > On Fri, Mar 11, 2016 at 11:24:05PM +0000, Navdeep Parhar wrote: > > > Author: np > > Date: Fri Mar 11 23:24:04 2016 > > New Revision: 296689 > > URL: https://svnweb.freebsd.org/changeset/base/296689 > > > > Log: > > cxgbe(4): sysctls to display the TOE's TCP timers. > > > > cask:~# sysctl -d dev.t5nex.0.toe > > dev.t5nex.0.toe.finwait2_timer: FINWAIT2 timer (us) > > dev.t5nex.0.toe.initial_srtt: Initial SRTT (us) > > dev.t5nex.0.toe.keepalive_intvl: Keepidle interval (us) > > dev.t5nex.0.toe.keepalive_idle: Keepidle idle timer (us) > > dev.t5nex.0.toe.persist_max: Persist timer max (us) > > dev.t5nex.0.toe.persist_min: Persist timer min (us) > > dev.t5nex.0.toe.rexmt_max: Retransmit max (us) > > dev.t5nex.0.toe.rexmt_min: Retransmit min (us) > > dev.t5nex.0.toe.dack_timer: DACK timer (us) > > dev.t5nex.0.toe.dack_tick: DACK tick (us) > > dev.t5nex.0.toe.timestamp_tick: TCP timestamp tick (us) > > dev.t5nex.0.toe.timer_tick: TP timer tick (us) > > ... > > > > cask:~# sysctl dev.t5nex.0.toe > > dev.t5nex.0.toe.finwait2_timer: 9765440 > > dev.t5nex.0.toe.initial_srtt: 244128 > > dev.t5nex.0.toe.keepalive_intvl: 73240800 > > dev.t5nex.0.toe.keepalive_idle: 7031116800 > > dev.t5nex.0.toe.persist_max: 9765440 > > dev.t5nex.0.toe.persist_min: 976544 > > dev.t5nex.0.toe.rexmt_max: 9765440 > > dev.t5nex.0.toe.rexmt_min: 244128 > > dev.t5nex.0.toe.dack_timer: 19520 > > dev.t5nex.0.toe.dack_tick: 32.768 > > dev.t5nex.0.toe.timestamp_tick: 1048.576 > > dev.t5nex.0.toe.timer_tick: 32.768 > > ... > > Can you more describe it in man? There are updates and additions to cxgbe documentation in progress, including new man pages: t4_tom(4) for the TCP offload module (aka TOE driver), cxgbei(4) for the iSCSI offload driver, and iw_cxgbe(4) for the iWARP driver. I'll get these sysctls documented in t4_tom(4). But writing decent documentation is harder than writing code and the effort is taking longer than I'd anticipated, so please be patient. > I am see this timers different from system, is this problem? What > correlations between? The kernel's TCP stack is different from the TCP implementation in the chip's silicon and they happen to use different default timers. Note that the driver requires you to explicitly load a module (t4_tom) and then enable IFCAP_TOE on the interfaces in order to use the hardware TCP offload. This opt-in model is by design and makes sure you aren't using a stack that you didn't explicitly ask for. Offloaded connections show up as "toe4/6" instead of "tcp4/6" in the output of netstat/sockstat/etc. so it's easy to tell which socket is using which stack (and which timers). Regards, Navdeep From owner-svn-src-head@freebsd.org Sun Mar 13 10:50:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14F4BACE92B; Sun, 13 Mar 2016 10:50:06 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CCBBF3C3; Sun, 13 Mar 2016 10:50:05 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1af3ax-000LGT-JB; Sun, 13 Mar 2016 13:49:59 +0300 Date: Sun, 13 Mar 2016 13:49:59 +0300 From: Slawa Olhovchenkov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296689 - head/sys/dev/cxgbe Message-ID: <20160313104959.GT70809@zxy.spb.ru> References: <201603112324.u2BNO5gx004444@repo.freebsd.org> <20160313011434.GD94639@zxy.spb.ru> <20160313081518.GA7325@ox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160313081518.GA7325@ox> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 10:50:06 -0000 On Sun, Mar 13, 2016 at 12:15:18AM -0800, Navdeep Parhar wrote: > On Sun, Mar 13, 2016 at 04:14:34AM +0300, Slawa Olhovchenkov wrote: > > On Fri, Mar 11, 2016 at 11:24:05PM +0000, Navdeep Parhar wrote: > > > > > Author: np > > > Date: Fri Mar 11 23:24:04 2016 > > > New Revision: 296689 > > > URL: https://svnweb.freebsd.org/changeset/base/296689 > > > > > > Log: > > > cxgbe(4): sysctls to display the TOE's TCP timers. > > > > > > cask:~# sysctl -d dev.t5nex.0.toe > > > dev.t5nex.0.toe.finwait2_timer: FINWAIT2 timer (us) > > > dev.t5nex.0.toe.initial_srtt: Initial SRTT (us) > > > dev.t5nex.0.toe.keepalive_intvl: Keepidle interval (us) > > > dev.t5nex.0.toe.keepalive_idle: Keepidle idle timer (us) > > > dev.t5nex.0.toe.persist_max: Persist timer max (us) > > > dev.t5nex.0.toe.persist_min: Persist timer min (us) > > > dev.t5nex.0.toe.rexmt_max: Retransmit max (us) > > > dev.t5nex.0.toe.rexmt_min: Retransmit min (us) > > > dev.t5nex.0.toe.dack_timer: DACK timer (us) > > > dev.t5nex.0.toe.dack_tick: DACK tick (us) > > > dev.t5nex.0.toe.timestamp_tick: TCP timestamp tick (us) > > > dev.t5nex.0.toe.timer_tick: TP timer tick (us) > > > ... > > > > > > cask:~# sysctl dev.t5nex.0.toe > > > dev.t5nex.0.toe.finwait2_timer: 9765440 > > > dev.t5nex.0.toe.initial_srtt: 244128 > > > dev.t5nex.0.toe.keepalive_intvl: 73240800 > > > dev.t5nex.0.toe.keepalive_idle: 7031116800 > > > dev.t5nex.0.toe.persist_max: 9765440 > > > dev.t5nex.0.toe.persist_min: 976544 > > > dev.t5nex.0.toe.rexmt_max: 9765440 > > > dev.t5nex.0.toe.rexmt_min: 244128 > > > dev.t5nex.0.toe.dack_timer: 19520 > > > dev.t5nex.0.toe.dack_tick: 32.768 > > > dev.t5nex.0.toe.timestamp_tick: 1048.576 > > > dev.t5nex.0.toe.timer_tick: 32.768 > > > ... > > > > Can you more describe it in man? > > There are updates and additions to cxgbe documentation in progress, > including new man pages: t4_tom(4) for the TCP offload module (aka TOE > driver), cxgbei(4) for the iSCSI offload driver, and iw_cxgbe(4) for the > iWARP driver. I'll get these sysctls documented in t4_tom(4). But > writing decent documentation is harder than writing code and the effort > is taking longer than I'd anticipated, so please be patient. > > > I am see this timers different from system, is this problem? What > > correlations between? > > The kernel's TCP stack is different from the TCP implementation in the > chip's silicon and they happen to use different default timers. Note > that the driver requires you to explicitly load a module (t4_tom) and > then enable IFCAP_TOE on the interfaces in order to use the hardware TCP > offload. This opt-in model is by design and makes sure you aren't using > a stack that you didn't explicitly ask for. Offloaded connections show > up as "toe4/6" instead of "tcp4/6" in the output of netstat/sockstat/etc. > so it's easy to tell which socket is using which stack (and which timers). Please also describe how TOE connection handled (and limits, how many connections can handled in silicon) and some recomendation (sndbuf?). What happen when timer expired? Connection pass to handled to software (and in this case silicon timers desirable have less then software?) or connection totaly handled in silicon (and timers tuned specially?) From owner-svn-src-head@freebsd.org Sun Mar 13 14:17:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 905A1ACEA00; Sun, 13 Mar 2016 14:17:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6CB5195; Sun, 13 Mar 2016 14:17:24 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DEHNlf028520; Sun, 13 Mar 2016 14:17:23 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DEHNMB028518; Sun, 13 Mar 2016 14:17:23 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603131417.u2DEHNMB028518@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Sun, 13 Mar 2016 14:17:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296798 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 14:17:24 -0000 Author: trasz Date: Sun Mar 13 14:17:23 2016 New Revision: 296798 URL: https://svnweb.freebsd.org/changeset/base/296798 Log: Remove name length limitation from autofs(5). The linear search with strlens is somewhat suboptimal, but it's a temporary measure that will be replaced with red-black trees later on. PR: 204417 Reviewed by: kib@ MFC after: 1 month Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5266 Modified: head/sys/fs/autofs/autofs.h head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs.h ============================================================================== --- head/sys/fs/autofs/autofs.h Sun Mar 13 08:19:27 2016 (r296797) +++ head/sys/fs/autofs/autofs.h Sun Mar 13 14:17:23 2016 (r296798) @@ -120,13 +120,6 @@ struct autofs_softc { int sc_last_request_id; }; -/* - * Limits and constants - */ -#define AUTOFS_NAMELEN 24 -#define AUTOFS_FSNAMELEN 16 /* equal to MFSNAMELEN */ -#define AUTOFS_DELEN (8 + AUTOFS_NAMELEN) - int autofs_init(struct vfsconf *vfsp); int autofs_uninit(struct vfsconf *vfsp); int autofs_trigger(struct autofs_node *anp, const char *component, Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Sun Mar 13 08:19:27 2016 (r296797) +++ head/sys/fs/autofs/autofs_vnops.c Sun Mar 13 14:17:23 2016 (r296798) @@ -330,26 +330,52 @@ autofs_mkdir(struct vop_mkdir_args *ap) return (error); } +/* + * Write out a single 'struct dirent', based on 'name' and 'fileno' arguments. + */ static int -autofs_readdir_one(struct uio *uio, const char *name, int fileno) +autofs_readdir_one(struct uio *uio, const char *name, int fileno, + size_t *reclenp) { struct dirent dirent; - int error, i; + size_t namlen, padded_namlen, reclen; + int error; + + namlen = strlen(name); + padded_namlen = roundup2(namlen + 1, __alignof(struct dirent)); + KASSERT(padded_namlen <= MAXNAMLEN, ("%zd > MAXNAMLEN", padded_namlen)); + reclen = offsetof(struct dirent, d_name) + padded_namlen; + + if (reclenp != NULL) + *reclenp = reclen; + + if (uio == NULL) + return (0); + + if (uio->uio_resid < reclen) + return (EINVAL); - memset(&dirent, 0, sizeof(dirent)); - dirent.d_type = DT_DIR; - dirent.d_reclen = AUTOFS_DELEN; dirent.d_fileno = fileno; - /* PFS_DELEN was picked to fit PFS_NAMLEN */ - for (i = 0; i < AUTOFS_NAMELEN - 1 && name[i] != '\0'; ++i) - dirent.d_name[i] = name[i]; - dirent.d_name[i] = 0; - dirent.d_namlen = i; + dirent.d_reclen = reclen; + dirent.d_type = DT_DIR; + dirent.d_namlen = namlen; + memcpy(dirent.d_name, name, namlen); + memset(dirent.d_name + namlen, 0, padded_namlen - namlen); + error = uiomove(&dirent, reclen, uio); - error = uiomove(&dirent, AUTOFS_DELEN, uio); return (error); } +static size_t +autofs_dirent_reclen(const char *name) +{ + size_t reclen; + + autofs_readdir_one(NULL, name, -1, &reclen); + + return (reclen); +} + static int autofs_readdir(struct vop_readdir_args *ap) { @@ -357,13 +383,15 @@ autofs_readdir(struct vop_readdir_args * struct autofs_mount *amp; struct autofs_node *anp, *child; struct uio *uio; - off_t offset; - int error, i, resid; + size_t reclen, reclens; + ssize_t initial_resid; + int error; vp = ap->a_vp; amp = VFSTOAUTOFS(vp->v_mount); anp = vp->v_data; uio = ap->a_uio; + initial_resid = ap->a_uio->uio_resid; KASSERT(vp->v_type == VDIR, ("!VDIR")); @@ -381,70 +409,94 @@ autofs_readdir(struct vop_readdir_args * } } - /* only allow reading entire entries */ - offset = uio->uio_offset; - resid = uio->uio_resid; - if (offset < 0 || offset % AUTOFS_DELEN != 0 || - (resid && resid < AUTOFS_DELEN)) + if (uio->uio_offset < 0) return (EINVAL); - if (resid == 0) - return (0); if (ap->a_eofflag != NULL) - *ap->a_eofflag = TRUE; + *ap->a_eofflag = FALSE; - if (offset == 0 && resid >= AUTOFS_DELEN) { - error = autofs_readdir_one(uio, ".", anp->an_fileno); + /* + * Write out the directory entry for ".". This is conditional + * on the current offset into the directory; same applies to the + * other two cases below. + */ + if (uio->uio_offset == 0) { + error = autofs_readdir_one(uio, ".", anp->an_fileno, &reclen); if (error != 0) - return (error); - offset += AUTOFS_DELEN; - resid -= AUTOFS_DELEN; + goto out; } + reclens = autofs_dirent_reclen("."); - if (offset == AUTOFS_DELEN && resid >= AUTOFS_DELEN) { + /* + * Write out the directory entry for "..". + */ + if (uio->uio_offset <= reclens) { + if (uio->uio_offset != reclens) + return (EINVAL); if (anp->an_parent == NULL) { - /* - * XXX: Right? - */ - error = autofs_readdir_one(uio, "..", anp->an_fileno); + error = autofs_readdir_one(uio, "..", + anp->an_fileno, &reclen); } else { error = autofs_readdir_one(uio, "..", - anp->an_parent->an_fileno); + anp->an_parent->an_fileno, &reclen); } if (error != 0) - return (error); - offset += AUTOFS_DELEN; - resid -= AUTOFS_DELEN; + goto out; } - i = 2; /* Account for "." and "..". */ + reclens += autofs_dirent_reclen(".."); + + /* + * Write out the directory entries for subdirectories. + */ AUTOFS_SLOCK(amp); TAILQ_FOREACH(child, &anp->an_children, an_next) { - if (resid < AUTOFS_DELEN) { - if (ap->a_eofflag != NULL) - *ap->a_eofflag = 0; - break; + /* + * Check the offset to skip entries returned by previous + * calls to getdents(). + */ + if (uio->uio_offset > reclens) { + reclens += autofs_dirent_reclen(child->an_name); + continue; } /* - * Skip entries returned by previous call to getdents(). + * Prevent seeking into the middle of dirent. */ - i++; - if (i * AUTOFS_DELEN <= offset) - continue; + if (uio->uio_offset != reclens) { + AUTOFS_SUNLOCK(amp); + return (EINVAL); + } error = autofs_readdir_one(uio, child->an_name, - child->an_fileno); + child->an_fileno, &reclen); + reclens += reclen; if (error != 0) { AUTOFS_SUNLOCK(amp); - return (error); + goto out; } - offset += AUTOFS_DELEN; - resid -= AUTOFS_DELEN; } - AUTOFS_SUNLOCK(amp); + + if (ap->a_eofflag != NULL) + *ap->a_eofflag = TRUE; + return (0); + +out: + /* + * Return error if the initial buffer was too small to do anything. + */ + if (uio->uio_resid == initial_resid) + return (error); + + /* + * Don't return an error if we managed to copy out some entries. + */ + if (uio->uio_resid < reclen) + return (0); + + return (error); } static int From owner-svn-src-head@freebsd.org Sun Mar 13 14:53:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3021ACF8E5; Sun, 13 Mar 2016 14:53:13 +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 91822A7D; Sun, 13 Mar 2016 14:53: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 u2DErCjc041252; Sun, 13 Mar 2016 14:53:12 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DErC3q041251; Sun, 13 Mar 2016 14:53:12 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603131453.u2DErC3q041251@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 13 Mar 2016 14:53:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296799 - head/usr.bin/grep/regex X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 14:53:13 -0000 Author: ian Date: Sun Mar 13 14:53:12 2016 New Revision: 296799 URL: https://svnweb.freebsd.org/changeset/base/296799 Log: Fix a bug in bsdgrep that caused the program to hang in a tight loop for some combinations of command line options and search patterns. The code was examining regexec flags looking for a regcomp flag value. The fix is to look in the struct field where the decoded regcomp flag was stored when the regex was compiled. With this fix, it's possible to build WITHOUT_GNU_GREP_COMPAT and WITH_BSDGREP and have a usable GPL-free grep (which of course lacks gnugrep extensions). It now passes the kyua tests except for one test that requires the -z/--null-data gnu extension, and one test involving outputting context lines across multiple files which appears to sometimes output an extra delimiter line ("--") between matches (a rather obscure failure of a rather obscure feature, so bsdgrep should be generally usable now). Modified: head/usr.bin/grep/regex/glue.h Modified: head/usr.bin/grep/regex/glue.h ============================================================================== --- head/usr.bin/grep/regex/glue.h Sun Mar 13 14:17:23 2016 (r296798) +++ head/usr.bin/grep/regex/glue.h Sun Mar 13 14:53:12 2016 (r296799) @@ -50,7 +50,7 @@ typedef enum { STR_WIDE, STR_BYTE, STR_M if ((long long)pmatch[0].rm_eo - pmatch[0].rm_so < 0) \ return REG_NOMATCH; \ ret = fn; \ - for (unsigned i = 0; (!(eflags & REG_NOSUB) && (i < nmatch)); i++)\ + for (unsigned i = 0; (!preg->nosub && (i < nmatch)); i++) \ { \ pmatch[i].rm_so += offset; \ pmatch[i].rm_eo += offset; \ From owner-svn-src-head@freebsd.org Sun Mar 13 19:17:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B03AACE604; Sun, 13 Mar 2016 19:17:49 +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 585DE842; Sun, 13 Mar 2016 19:17:49 +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 u2DJHmU7026376; Sun, 13 Mar 2016 19:17:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DJHmJU026375; Sun, 13 Mar 2016 19:17:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603131917.u2DJHmJU026375@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 13 Mar 2016 19:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296805 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 19:17:49 -0000 Author: bdrewery Date: Sun Mar 13 19:17:48 2016 New Revision: 296805 URL: https://svnweb.freebsd.org/changeset/base/296805 Log: We only support GCC 4.8 for these flags. - 4.7 introduced maybe-uninitialized - 4.8 introduced aggressive-loop-optimizations Sponsored by: EMC / Isilon Storage Division Modified: head/sys/conf/kern.mk Modified: head/sys/conf/kern.mk ============================================================================== --- head/sys/conf/kern.mk Sun Mar 13 18:57:29 2016 (r296804) +++ head/sys/conf/kern.mk Sun Mar 13 19:17:48 2016 (r296805) @@ -42,10 +42,9 @@ CLANG_NO_IAS34= -no-integrated-as .endif .if ${COMPILER_TYPE} == "gcc" -.if ${COMPILER_VERSION} >= 40300 +.if ${COMPILER_VERSION} >= 40800 # Catch-all for all the things that are in our tree, but for which we're -# not yet ready for this compiler. Note: we likely only really "support" -# building with gcc 4.8 and newer. Nothing older has been tested. +# not yet ready for this compiler. CWARNEXTRA?= -Wno-error=inline -Wno-error=enum-compare -Wno-error=unused-but-set-variable \ -Wno-error=aggressive-loop-optimizations -Wno-error=maybe-uninitialized \ -Wno-error=array-bounds -Wno-error=address \ From owner-svn-src-head@freebsd.org Sun Mar 13 19:27:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6835ACEC4A; Sun, 13 Mar 2016 19:27:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80FD0D90; Sun, 13 Mar 2016 19:27:47 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DJRkYU029384; Sun, 13 Mar 2016 19:27:46 GMT (envelope-from rwatson@FreeBSD.org) Received: (from rwatson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DJRkkx029383; Sun, 13 Mar 2016 19:27:46 GMT (envelope-from rwatson@FreeBSD.org) Message-Id: <201603131927.u2DJRkkx029383@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rwatson set sender to rwatson@FreeBSD.org using -f From: Robert Watson Date: Sun, 13 Mar 2016 19:27:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296806 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 19:27:47 -0000 Author: rwatson Date: Sun Mar 13 19:27:46 2016 New Revision: 296806 URL: https://svnweb.freebsd.org/changeset/base/296806 Log: Put IPSec's anouncement of its successful intialisation under bootverbose: now that it's a default kernel option, we don't really need to tell the world about it on every boot, especially as it won't be used by most users. Modified: head/sys/netipsec/key.c Modified: head/sys/netipsec/key.c ============================================================================== --- head/sys/netipsec/key.c Sun Mar 13 19:17:48 2016 (r296805) +++ head/sys/netipsec/key.c Sun Mar 13 19:27:46 2016 (r296806) @@ -7640,7 +7640,8 @@ key_init(void) /* initialize key statistics */ keystat.getspi_count = 1; - printf("IPsec: Initialized Security Association Processing.\n"); + if (bootverbose) + printf("IPsec: Initialized Security Association Processing.\n"); } #ifdef VIMAGE From owner-svn-src-head@freebsd.org Sun Mar 13 19:43:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA47ACF282; Sun, 13 Mar 2016 19:43:00 +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 78617907; Sun, 13 Mar 2016 19:43:00 +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 u2DJgxda035243; Sun, 13 Mar 2016 19:42:59 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DJgxMR035242; Sun, 13 Mar 2016 19:42:59 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201603131942.u2DJgxMR035242@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Sun, 13 Mar 2016 19:42:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296807 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 19:43:00 -0000 Author: ian Date: Sun Mar 13 19:42:59 2016 New Revision: 296807 URL: https://svnweb.freebsd.org/changeset/base/296807 Log: Require firewall setup before running rc.d/netwait, otherwise the ping packets sent by netwait may not get through. PR: 207916 Submitted by: John.Marshall@riverwillow.com.au (ipfw), ian@ (pf, ipfilter) Modified: head/etc/rc.d/netwait Modified: head/etc/rc.d/netwait ============================================================================== --- head/etc/rc.d/netwait Sun Mar 13 19:27:46 2016 (r296806) +++ head/etc/rc.d/netwait Sun Mar 13 19:42:59 2016 (r296807) @@ -3,7 +3,7 @@ # $FreeBSD$ # # PROVIDE: netwait -# REQUIRE: devd routing +# REQUIRE: devd ipfilter ipfw pf routing # KEYWORD: nojail # # The netwait script helps handle two situations: From owner-svn-src-head@freebsd.org Sun Mar 13 19:43:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 11188ACF306; Sun, 13 Mar 2016 19:43:51 +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 E9112A7C; Sun, 13 Mar 2016 19:43:50 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id DD6BE124C; Sun, 13 Mar 2016 19:43:50 +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 9778819CED; Sun, 13 Mar 2016 19:43:50 +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 3zA50R_ZhETs; Sun, 13 Mar 2016 19:43:47 +0000 (UTC) Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 6D28019CE4 To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56E5C2EB.1070206@FreeBSD.org> Date: Sun, 13 Mar 2016 12:43:39 -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: <201603110135.u2B1Zd8a001604@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Pl3n94xGq40cdCKAnSnnfM6wPHTae6TTl" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 19:43:51 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Pl3n94xGq40cdCKAnSnnfM6wPHTae6TTl Content-Type: multipart/mixed; boundary="FsLaGPx9brUtgQhA83Ko1uKK85jHXtJDD" From: Bryan Drewery To: "Simon J. Gerraty" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56E5C2EB.1070206@FreeBSD.org> Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> In-Reply-To: <201603110135.u2B1Zd8a001604@repo.freebsd.org> --FsLaGPx9brUtgQhA83Ko1uKK85jHXtJDD Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 3/10/2016 5:35 PM, Simon J. Gerraty wrote: > Author: sjg > Date: Fri Mar 11 01:35:39 2016 > New Revision: 296637 > URL: https://svnweb.freebsd.org/changeset/base/296637 >=20 > Log: > Merge bmake-20160307 >=20 > Modified: =2E.. > head/share/mk/sys.dependfile.mk > index d12d939..745873f 100644 > --- a/share/mk/sys.dependfile.mk > +++ b/share/mk/sys.dependfile.mk > @@ -1,5 +1,5 @@ > # $FreeBSD$ > -# $Id: sys.dependfile.mk,v 1.6 2014/08/02 18:02:06 sjg Exp $ > +# $Id: sys.dependfile.mk,v 1.7 2016/02/20 01:57:39 sjg Exp $ > # > # @(#) Copyright (c) 2012, Simon J. Gerraty > # > @@ -49,8 +49,10 @@ _e :=3D ${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m= ):?$m:}@} > # MACHINE specific depend files are supported, but *not* default. > # If any already exist, we should follow suit. > _aml =3D ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MAC= HINE} > -# MACHINE must be the last entry in _aml ;-) > +# make sure we restore MACHINE > +_m :=3D ${MACHINE} > _e :=3D ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):= ?$m:}@}@} > +MACHINE :=3D ${_m} > .if !empty(_e) > .MAKE.DEPENDFILE ?=3D ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]} > .endif What changed in bmake to require this? Now in older checkouts I don't get MACHINE defined with DIRDEPS_BUILD without this change. That's not ideal since it breaks older builds. It seems the old version had @MACHINE in its own scope but now is in glob= al. > ~/git/freebsd # WITH_DIRDEPS_BUILD=3Dyes make -V MACHINE > make: "/root/git/freebsd/share/mk/local.meta.sys.mk" line 213: Malforme= d conditional (${MACHINE} =3D=3D "host") > make: "/root/git/freebsd/share/mk/local.meta.sys.mk" line 249: Malforme= d conditional (${MACHINE} =3D=3D "host") > make: "/root/git/freebsd/share/mk/local.meta.sys.mk" line 255: Malforme= d conditional (${MACHINE:Nhost:Ncommon} !=3D "" && ${MACHINE} !=3D ${HOST= _MACHINE}) > make: Fatal errors encountered -- cannot continue > make: stopped in /root/git/freebsd older bmake: > ~/git/freebsd # WITH_DIRDEPS_BUILD=3Dyes make.bak -V MACHINE > amd64 --=20 Regards, Bryan Drewery --FsLaGPx9brUtgQhA83Ko1uKK85jHXtJDD-- --Pl3n94xGq40cdCKAnSnnfM6wPHTae6TTl 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 iQEcBAEBAgAGBQJW5cL5AAoJEDXXcbtuRpfPIosIAJ1cILNyEWMacsSA4wfvQmMa +d3cnEQe1zTbsnnNCKWMDorlC3TdXlCDn4U74cRsrgdhQzh2wycTgBRUPiFgPN1P VcqB/H0h4n0bngB24z/fgyQz8rzshzosMrWzI8l/eEErOUnPrMzUjeL0QbgOvPWZ cgogbSXh6ESxuVKt+Zuf7rIPeO41APWu7oDfC9ZiuIGJ7YimldkDCR0QV6QKSHy5 ycOLg/YELT9DHbZKBgQv5Dh8adTfAlDXi+gVU7KJ8Fisxz2B2yFLbY/l0e/LspIf f0VlZ3ekMkNg6m3+y6yshMh1XFqb/mOo1JViawZ9wVX2EZME4s0k2QF5FL+74uo= =5rVh -----END PGP SIGNATURE----- --Pl3n94xGq40cdCKAnSnnfM6wPHTae6TTl-- From owner-svn-src-head@freebsd.org Sun Mar 13 19:50:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28CFBACF5B7; Sun, 13 Mar 2016 19:50:19 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE2FBF4A; Sun, 13 Mar 2016 19:50:18 +0000 (UTC) (envelope-from jceel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DJoHp7035699; Sun, 13 Mar 2016 19:50:17 GMT (envelope-from jceel@FreeBSD.org) Received: (from jceel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DJoHBH035698; Sun, 13 Mar 2016 19:50:17 GMT (envelope-from jceel@FreeBSD.org) Message-Id: <201603131950.u2DJoHBH035698@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jceel set sender to jceel@FreeBSD.org using -f From: Jakub Wojciech Klama Date: Sun, 13 Mar 2016 19:50:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296808 - head/usr.sbin/ctld X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 19:50:19 -0000 Author: jceel Date: Sun Mar 13 19:50:17 2016 New Revision: 296808 URL: https://svnweb.freebsd.org/changeset/base/296808 Log: Check value returned from ucl_parser_add_file(). Reviewed by: trasz Approved by: trasz (mentor) MFC after: 1 month Sponsored by: iXsystems, Inc. Modified: head/usr.sbin/ctld/uclparse.c Modified: head/usr.sbin/ctld/uclparse.c ============================================================================== --- head/usr.sbin/ctld/uclparse.c Sun Mar 13 19:42:59 2016 (r296807) +++ head/usr.sbin/ctld/uclparse.c Sun Mar 13 19:50:17 2016 (r296808) @@ -886,9 +886,8 @@ uclparse_conf(struct conf *newconf, cons conf = newconf; parser = ucl_parser_new(0); - ucl_parser_add_file(parser, path); - if (ucl_parser_get_error(parser)) { + if (!ucl_parser_add_file(parser, path)) { log_warn("unable to parse configuration file %s: %s", path, ucl_parser_get_error(parser)); return (1); From owner-svn-src-head@freebsd.org Sun Mar 13 20:51:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA1DBACFC95; Sun, 13 Mar 2016 20:51:46 +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 99E51D75; Sun, 13 Mar 2016 20:51:46 +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 u2DKpj5S056708; Sun, 13 Mar 2016 20:51:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DKpj7h056707; Sun, 13 Mar 2016 20:51:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603132051.u2DKpj7h056707@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sun, 13 Mar 2016 20:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296809 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 20:51:46 -0000 Author: bdrewery Date: Sun Mar 13 20:51:45 2016 New Revision: 296809 URL: https://svnweb.freebsd.org/changeset/base/296809 Log: Follow-up r296700: Fix incorrectly declaring these as .MAIN. This broke bootstrap-tools at least for DIRDEPS_BUILD. Sponsored by: EMC / Isilon Storage Division Modified: head/share/mk/local.sys.mk Modified: head/share/mk/local.sys.mk ============================================================================== --- head/share/mk/local.sys.mk Sun Mar 13 19:50:17 2016 (r296808) +++ head/share/mk/local.sys.mk Sun Mar 13 20:51:45 2016 (r296809) @@ -33,9 +33,9 @@ META_COOKIE= ${COOKIE.${.TARGET}:U${.OB META_COOKIE_RM= @rm -f ${META_COOKIE} META_COOKIE_TOUCH= @touch ${META_COOKIE} CLEANFILES+= ${META_TARGETS} -_meta_dep_before: .USEBEFORE +_meta_dep_before: .USEBEFORE .NOTMAIN ${META_COOKIE_RM} -_meta_dep_after: .USE +_meta_dep_after: .USE .NOTMAIN ${META_COOKIE_TOUCH} # Attach this to a target to allow it to benefit from meta mode's # not rerunning a command if it doesn't need to be considering its From owner-svn-src-head@freebsd.org Sun Mar 13 21:09:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 36A72ACDA82; Sun, 13 Mar 2016 21:09:10 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 12AE8F29; Sun, 13 Mar 2016 21:09:10 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DL99Rl060889; Sun, 13 Mar 2016 21:09:09 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DL99oN060887; Sun, 13 Mar 2016 21:09:09 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201603132109.u2DL99oN060887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Sun, 13 Mar 2016 21:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296810 - head/usr.bin/mkuzip X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 21:09:10 -0000 Author: sobomax Date: Sun Mar 13 21:09:08 2016 New Revision: 296810 URL: https://svnweb.freebsd.org/changeset/base/296810 Log: In the de-duplication mode, when found matching md5 checksum also read back block and compare actual content. Just output original block instead of back reference in the unlikely event of collision. Modified: head/usr.bin/mkuzip/mkuz_blockcache.c head/usr.bin/mkuzip/mkuzip.c Modified: head/usr.bin/mkuzip/mkuz_blockcache.c ============================================================================== --- head/usr.bin/mkuzip/mkuz_blockcache.c Sun Mar 13 20:51:45 2016 (r296809) +++ head/usr.bin/mkuzip/mkuz_blockcache.c Sun Mar 13 21:09:08 2016 (r296810) @@ -29,7 +29,9 @@ __FBSDID("$FreeBSD$"); #include +#include #include +#include #include #include #include @@ -49,6 +51,35 @@ struct mkuz_blkcache { static struct mkuz_blkcache blkcache; +static int +verify_match(int fd, off_t data_offset, void *data, ssize_t len, + struct mkuz_blkcache *bcep) +{ + void *vbuf; + ssize_t rlen; + int rval; + + rval = -1; + vbuf = malloc(len); + if (vbuf == NULL) { + goto e0; + } + if (lseek(fd, bcep->data_offset, SEEK_SET) < 0) { + goto e1; + } + rlen = read(fd, vbuf, len); + if (rlen != len) { + goto e2; + } + rval = (memcmp(data, vbuf, len) == 0) ? 1 : 0; +e2: + lseek(fd, data_offset, SEEK_SET); +e1: + free(vbuf); +e0: + return (rval); +} + struct mkuz_blkcache_hit * mkuz_blkcache_regblock(int fd, uint32_t blkno, off_t offset, ssize_t len, void *data) @@ -57,6 +88,7 @@ mkuz_blkcache_regblock(int fd, uint32_t MD5_CTX mcontext; off_t data_offset; unsigned char mdigest[16]; + int rval; data_offset = lseek(fd, 0, SEEK_CUR); if (data_offset < 0) { @@ -76,10 +108,23 @@ mkuz_blkcache_regblock(int fd, uint32_t } } if (bcep != NULL) { + rval = verify_match(fd, data_offset, data, len, bcep); + if (rval == 1) { #if defined(MKUZ_DEBUG) - printf("cache hit %d, %d, %d\n", (int)bcep->hit.offset, (int)data_offset, (int)len); + fprintf(stderr, "cache hit %d, %d, %d\n", + (int)bcep->hit.offset, (int)data_offset, (int)len); #endif - return (&bcep->hit); + return (&bcep->hit); + } + if (rval == 0) { +#if defined(MKUZ_DEBUG) + fprintf(stderr, "block MD5 collision, you should try lottery, " + "man!\n"); +#endif + return (NULL); + } + warn("verify_match"); + return (NULL); } bcep = malloc(sizeof(struct mkuz_blkcache)); if (bcep == NULL) Modified: head/usr.bin/mkuzip/mkuzip.c ============================================================================== --- head/usr.bin/mkuzip/mkuzip.c Sun Mar 13 20:51:45 2016 (r296809) +++ head/usr.bin/mkuzip/mkuzip.c Sun Mar 13 21:09:08 2016 (r296810) @@ -221,7 +221,7 @@ int main(int argc, char **argv) } toc = mkuz_safe_malloc((hdr.nblocks + 1) * sizeof(*toc)); - fdw = open(oname, O_WRONLY | O_TRUNC | O_CREAT, + fdw = open(oname, (en_dedup ? O_RDWR : O_WRONLY) | O_TRUNC | O_CREAT, S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH); if (fdw < 0) { err(1, "open(%s)", oname); From owner-svn-src-head@freebsd.org Sun Mar 13 21:26:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE707ACE261; Sun, 13 Mar 2016 21:26:19 +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 C085A1A6F; Sun, 13 Mar 2016 21:26:19 +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 u2DLQIkj066880; Sun, 13 Mar 2016 21:26:18 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DLQI8J066879; Sun, 13 Mar 2016 21:26:18 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603132126.u2DLQI8J066879@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Sun, 13 Mar 2016 21:26:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296811 - head/sys/netinet/tcp_stacks X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 21:26:20 -0000 Author: bz Date: Sun Mar 13 21:26:18 2016 New Revision: 296811 URL: https://svnweb.freebsd.org/changeset/base/296811 Log: Remove duplicate external declaration of tcprexmtthresh making gcc compiles barf. Modified: head/sys/netinet/tcp_stacks/fastpath.c Modified: head/sys/netinet/tcp_stacks/fastpath.c ============================================================================== --- head/sys/netinet/tcp_stacks/fastpath.c Sun Mar 13 21:09:08 2016 (r296810) +++ head/sys/netinet/tcp_stacks/fastpath.c Sun Mar 13 21:26:18 2016 (r296811) @@ -124,8 +124,6 @@ __FBSDID("$FreeBSD$"); #include -extern const int tcprexmtthresh; - VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); From owner-svn-src-head@freebsd.org Sun Mar 13 22:54:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D57AACF28F; Sun, 13 Mar 2016 22:54:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 5EA22616; Sun, 13 Mar 2016 22:54:15 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2DMsE8W094233; Sun, 13 Mar 2016 22:54:14 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2DMsETB094232; Sun, 13 Mar 2016 22:54:14 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201603132254.u2DMsETB094232@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Sun, 13 Mar 2016 22:54:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296813 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 22:54:15 -0000 Author: jilles Date: Sun Mar 13 22:54:14 2016 New Revision: 296813 URL: https://svnweb.freebsd.org/changeset/base/296813 Log: sh: Fix copying uninitialized field 'special'. This just copied uninitialized data and did not depend on it later, so it should not be dangerous. Found by: clang static analyzer Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sun Mar 13 22:32:03 2016 (r296812) +++ head/bin/sh/exec.c Sun Mar 13 22:54:14 2016 (r296813) @@ -332,6 +332,7 @@ find_command(const char *name, struct cm if (strchr(name, '/') != NULL) { entry->cmdtype = CMDNORMAL; entry->u.index = 0; + entry->special = 0; return; } @@ -408,6 +409,7 @@ find_command(const char *name, struct cm cmdp = &loc_cmd; cmdp->cmdtype = CMDNORMAL; cmdp->param.index = idx; + cmdp->special = 0; INTON; goto success; } @@ -420,6 +422,7 @@ find_command(const char *name, struct cm } entry->cmdtype = CMDUNKNOWN; entry->u.index = 0; + entry->special = 0; return; success: @@ -588,6 +591,7 @@ addcmdentry(const char *name, struct cmd } cmdp->cmdtype = entry->cmdtype; cmdp->param = entry->u; + cmdp->special = entry->special; INTON; } @@ -604,6 +608,7 @@ defun(const char *name, union node *func INTOFF; entry.cmdtype = CMDFUNCTION; entry.u.func = copyfunc(func); + entry.special = 0; addcmdentry(name, &entry); INTON; } From owner-svn-src-head@freebsd.org Sun Mar 13 23:05:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 634CCACF620; Sun, 13 Mar 2016 23:05:40 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1on0146.outbound.protection.outlook.com [157.56.110.146]) (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 5E872A6A; Sun, 13 Mar 2016 23:05:38 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=x76gGOyzJH3P4GGqbXWrm7TPAFcQFRKlyHKk6/l6im0=; b=YsTuwPJSaIryx7zurowSE//ZxxptpkV+ujG+y7S3ErdiQIk0jttZRpiX7GtQ9k08pxTbvN2JB5KoNJ0ibpQ35xviL4G7qnKcIfKO/fJEjnX6jwFgkvmOLZ0FmiLk6znXW3xyT6xEDPz9glY3l925YYP2xboUHO5Q+/XE3jSG6RE= Received: from CO2PR05CA019.namprd05.prod.outlook.com (10.141.241.147) by BLUPR05MB737.namprd05.prod.outlook.com (10.141.208.17) with Microsoft SMTP Server (TLS) id 15.1.427.16; Sun, 13 Mar 2016 22:32:24 +0000 Received: from BY2FFO11FD056.protection.gbl (2a01:111:f400:7c0c::123) by CO2PR05CA019.outlook.office365.com (2a01:111:e400:1429::19) with Microsoft SMTP Server (TLS) id 15.1.434.16 via Frontend Transport; Sun, 13 Mar 2016 22:32:24 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BY2FFO11FD056.mail.protection.outlook.com (10.1.15.193) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Sun, 13 Mar 2016 22:32:23 +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; Sun, 13 Mar 2016 15:32:22 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2DMWKD82313; Sun, 13 Mar 2016 15:32:20 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 80990385508; Sun, 13 Mar 2016 15:32:20 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake In-Reply-To: <56E5C2EB.1070206@FreeBSD.org> References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E5C2EB.1070206@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Sun, 13 Mar 2016 12:43:39 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14944.1457908340.1@kaos.jnpr.net> Content-Transfer-Encoding: quoted-printable Date: Sun, 13 Mar 2016 15:32:20 -0700 Message-ID: <14946.1457908340@kaos.jnpr.net> 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)(24454002)(450100001)(5003600100002)(81166005)(5008740100001)(1220700001)(1096002)(47776003)(46406003)(53416004)(105596002)(117636001)(50226001)(2950100001)(19580395003)(19580405001)(2810700001)(106466001)(4001430100002)(50466002)(23726003)(77096005)(2906002)(107886002)(110136002)(87936001)(50986999)(6806005)(4326007)(92566002)(86362001)(11100500001)(189998001)(76176999)(97756001)(76506005)(586003)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR05MB737; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD056; 1:GkyOiVhawFmr6q1E2QXzLCQKm97fiT5XK5iqatYIRRmxNJ2axXXN1BtQvGVBMvBpNp68mxM5wBIf3QINV1VTEmAlnDmfRpHHfKFrfC6SqmrjfWjmqxBJQB7mUqZccgIckZqFrW2pGh+MmL4m973tl54gW+MSgm5Tq3Kv91Nqcwjc+m+fQpvQhl2Ie/xb1WYmiFvhFLA/dEEm5aDoiaBzm3eif+HkM66c8MFOoIj6RRpmKOVmyU79wLVSnOtpuNfFqUxXCbWuvANtAToNgfSye/VAsVUJzANs2N2hbjnuZgxjowilPuqW+uO8a/pgyQKP/uj8Zc/N/jSX6TS/PBlgubL29pRnpPLtfwAvVPEhb4+kdjsqF+6l2UA8EUkkaJN/hnCg2PY/KNIXusyoKefYGNFU7DVaIG6liubhU8RJAmw= X-MS-Office365-Filtering-Correlation-Id: 87d27778-20c2-451e-9c46-08d34b8f5921 X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB737; 2:HcYmRMEsEsPPfz7c6SCA8s3AYBdDvsd/CAvwibkxwQ4PzwiFN7MgXlmmYjpMXSlGcyy+rlM3XNcBWXmOeSTo38syA0rWKy41Vbl1wYCegxSmws0QTdqmC4HYJhUpTpzhjLiXfL38u/c8sI45gSC6ljiQqmEjmsJ2K4OKE1ykDSFXMjJqEYiLn1iwuMV7tuU6; 3:IzS2hBJKbYVLl4tmLeoW6xCGuXI33INnTjzrd6JGKe6YPBTS4Wrktnl2gxVRzNYcGITrfNB1fyOTC9mZ4Zw3bv+PcQMCtpC8Z3C2xQ12uX/KoM9rSs77XvyMjaHhXUL0jauskdlwsixim5oKhOPXUBSBbtOTxZ5j4SLSPKw+o74p3/rmuSCZs3BYs6vsCwB/JAJSPPJlP+EyXbcb5i432K2+l/d38ZMsHVo8oxetNOQ=; 25:F2mEyFnVZwtVwfzfa0dfF/grx8CiY+4T2aH/MjD4eLkFo1PR91wY/BvuWs2lFbOcpZ0hkettoFdooXSUSVsBcYoJHS3l1U7LLDEceuHjCulNIUZz9iRWgPcCzHVuvBRF3LB/zh/kQ7+5c/fREONEOBrvrb2EOw5yo155LzRz/1cEgSSHljsYS2gsktMyn76ty+W8ffkx3FxB4p6fCwLoYGgokJCTeqiwH28z3pLqt3Q8o0Tge5A3QS7fogsxTQgTFGtZ6XjZ3isEQ9dX5MGxPJuHRJDRPdZ/qzrfpFnUscNVBJNqKr90dv262bHIcKjv57j9Q0vXd08313BEO8eH1w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR05MB737; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB737; 20:yMC8aM63a40nFRy0EhFWctqaCpjEpXTL/V0nbeRdeDLHoXoKWnfFx0ZAdI0Sw9bXprJCgzCcHA0WBARkIionXCcNnIXJj2A5FN8nNVpSnx8EwfZglX54FrHCDgAS+6vnxsNC3Nk4we06vXhJrGakxc4f84k7tjAB0aVfRydmUQHJPrQIkbdSC+emmC8x4LggjbDTXUsu99Iu+9kjyN7c2h2AcNo9sobuOuZfUjs8eimDNphXa+XfuftizKaIqj/5dPs7IgJ/sqQyfbzVsAbunnPYr+PpjpgPcdGsYJ0lHAgPwk3HqPh2ajUnSBsf/oym8//o43tDpBTR/HQ8CDmrui8SSGOzM5X9NwPGkMBfHjaB+yEJmjFqoYMIorSvRjGm6MsQrIBLRf5NUMlm5KpuXlXUvHbnYD8qdcX7/9FnbLeZc9BnH1g3ihGFM+xPbQBdbDIjrmM9VNzf0Yh725iQqfFtz4wN7ObBTlS+PUuJypVa/j1yWxx3gltkPJ2dViGe X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13015025)(5005006)(13018025)(8121501046)(13023025)(13024025)(3002001)(10201501046); SRVR:BLUPR05MB737; BCL:0; PCL:0; RULEID:; SRVR:BLUPR05MB737; X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB737; 4:9NoEGzRsKUkt0RZMqXx/wOvjvjZxsoDLv0y15htC93NqL/K2OkmaymK6Y92iX4kT6yPC1qo7NLudJDizhbjOqeqVUcbMxTVHeNIiDlGjQCEEbkh95aoEuBAxXvThX3zVADzEhRTdnqSn8aNZamCMIEnN1U7W13/heL6CD4b0y8XTOsFcIFK2ay5iPIwiKl7MzsqdoxbdXfC3ABTZYe3BAiUSSZVrSaqP/vxue0kc5F+0WzCsNT492IzYCQw3sJp0l1j8IgYJ0EYZ8W/PLbYprtmeNjZGMddE23uhkyaC2OgcnJGKfgTS50EVj8faQ+geADSyaihBUKZJXI6uZ7tgUspozi/TrKJOaHCkbsBsRXXbvFmmmvXeBkY+7Kz6/UOwAiO7JRs0y2J097wUD7IOmrba5ugudRVZ33IDCvAUsapG/CA74rIzUQ+4a3o/iC4Fa9coTdEKZ9ine3dK0Jr+3A== X-Forefront-PRVS: 0880FB6EC1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR05MB737; 23:o4tbU7ZWjsjUNRylAhaJMswHS/NM9JquUvjuDzBJZG?= =?us-ascii?Q?Xrx+FMwejE/+PFlAiXrtmdcfIJpGa7bfgtKJWoywzKKry98gT6YFDhZGFyOl?= =?us-ascii?Q?uWt+kQCqBZNS3ww/AYce0Nd2ZF73cAeYpoIu+3bZC2YzXXqEYlPFQ/xCisT6?= =?us-ascii?Q?fG0IYnPb7TpmfGDaCAvx4eKKZThkcZD0Qs1LfvQ4rziWOIOktZnt+UAtOGA+?= =?us-ascii?Q?zSzxrL1L2E61Ul2Wtb4wgAj8gU24G+xhgR0AL69V9vfcP/7Rg782NpBst61a?= =?us-ascii?Q?ikz91llMzV3YjMux87souO79IIPkEepxFTpbp+sooo2HujDDnC/6ZbwgC0Wx?= =?us-ascii?Q?u5yly0CQ32c2i+SyFTn/IA+LsDtnVoDEIct+0dpsLh7ykAhNBXpXX9eayzlL?= =?us-ascii?Q?4RZbHX9jPlZTlv9+fU3a9Xle01/7hRhK7FmKRM9kKsGbRj9eXJwSXqcp/SKn?= =?us-ascii?Q?q1bfOvJFRLauNDTZjZj3v/f0gYgqXTzwOFuUVc6VzFVeMY7Vj2GumAD3gRtl?= =?us-ascii?Q?JZfZ5uUmqjaNDyHp6unRpBCwNtvoug65rkNs1exk7oFB490CuBKafkXU7EZ1?= =?us-ascii?Q?EgFz6UW6E+c6VYfODgSJqrDi1FQ95AqkgpQpmHIgntOqecjEsYcYeB1whgm7?= =?us-ascii?Q?ZwSMTEqZtO0f1AF4PZ68ZaxI3eq5tllI9bpw6nGmrZjV6Hop4qxywiTStN/G?= =?us-ascii?Q?mv/AdDZ/Kb3mIVtayhUoYX1yiHVJYZp/bkD1ofliQjw/yTiaV1t7SYxcNoo4?= =?us-ascii?Q?QLvyKp+eedaZXLRq43gxQ9bGGLbdH9KBaFo1ptFPM6ZuLtU6NE9OJ43nbhzP?= =?us-ascii?Q?fJpFxY+7Ixo42KqZBIEXxXIOxNqHLeZh9sbwIBGbL2vi3GfgWAL5mXIDjurK?= =?us-ascii?Q?BiQbbMSO0ip84ITXxORDj5yNt+zHJIpQgultU/bGAOAZg4RMWxStgQYmp1Zm?= =?us-ascii?Q?Z1cZmbPlA3o0s7F4ogoouD9zUxRTjFO4tv7mWbVfEtuqWk0q8HQh1RGBZbXh?= =?us-ascii?Q?kg0iBVeHIvnZQSd3F31x+Jce7TVg6rSXYfJ+VoZcWg0FedyLVzb+W3mQBt06?= =?us-ascii?Q?+EwsvrluCY0jJqJqMZ0qSNDeOYCzJIRRQBRSKyr1cNHJTbPjvQBuPqkLIJv/?= =?us-ascii?Q?pDL7za3CA=3D?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR05MB737; 5:nk0qYdtBNcXZOEwDaMLBK4/eWNrApX7TwhOXXWmpY3Ce8K74Y5LPC1SU7mV6MxTS4qh71ZmO4r1Jp74L3gpZu+Zc4IuYdBfGkG06NeC69/V9+5528mKc4e/SU+8sJFINCPPBjfBeFxe1AUPVSvTErg==; 24:EZo1EyxpMv3oxfp/DCgbvuVnDHwxKQWowuEXPDvOH+4/VYiA5yxMMao9u6Pi7Ts3BOWqH/HQzRCjoY1V0aCZ5okvTzS0JNkaiEov/CbmvXQ= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2016 22:32:23.4813 (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: BLUPR05MB737 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 23:05:40 -0000 Bryan Drewery wrote: > > # MACHINE specific depend files are supported, but *not* default. > > # If any already exist, we should follow suit. > > _aml =3D ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MA= CHINE} > > -# MACHINE must be the last entry in _aml ;-) > > +# make sure we restore MACHINE > > +_m :=3D ${MACHINE} > > _e :=3D ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m)= :?$m:}@}@} > > +MACHINE :=3D ${_m} > > .if !empty(_e) > > .MAKE.DEPENDFILE ?=3D ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]} > > .endif > = > = > What changed in bmake to require this? Now in older checkouts I don't deleting the :@ loop iterator variable. > get MACHINE defined with DIRDEPS_BUILD without this change. That's not > ideal since it breaks older builds. Yes, I should mfc the above change? it is harmess with older bmake's. From owner-svn-src-head@freebsd.org Sun Mar 13 23:10:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C5D9ACF7C6; Sun, 13 Mar 2016 23:10:41 +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 1C69EC7C; Sun, 13 Mar 2016 23:10:41 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 148AB1794; Sun, 13 Mar 2016 23:10:41 +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 CA8561E1A4; Sun, 13 Mar 2016 23:10:40 +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 YZpLeb-KDX6x; Sun, 13 Mar 2016 23:10:33 +0000 (UTC) Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 39E151E19F To: "Simon J. Gerraty" References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E5C2EB.1070206@FreeBSD.org> <14946.1457908340@kaos.jnpr.net> Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56E5F36E.2020205@FreeBSD.org> Date: Sun, 13 Mar 2016 16:10:38 -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: <14946.1457908340@kaos.jnpr.net> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j6VenBe37iiIrdW4NfbjImIEuKEMk7NxM" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 23:10:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --j6VenBe37iiIrdW4NfbjImIEuKEMk7NxM Content-Type: multipart/mixed; boundary="99LghlrNwV6EwttR69cJ6w1JadICmepgH" From: Bryan Drewery To: "Simon J. Gerraty" Cc: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <56E5F36E.2020205@FreeBSD.org> Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E5C2EB.1070206@FreeBSD.org> <14946.1457908340@kaos.jnpr.net> In-Reply-To: <14946.1457908340@kaos.jnpr.net> --99LghlrNwV6EwttR69cJ6w1JadICmepgH Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/13/2016 3:32 PM, Simon J. Gerraty wrote: > Bryan Drewery wrote: >>> # MACHINE specific depend files are supported, but *not* default. >>> # If any already exist, we should follow suit. >>> _aml =3D ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${M= ACHINE} >>> -# MACHINE must be the last entry in _aml ;-) >>> +# make sure we restore MACHINE >>> +_m :=3D ${MACHINE} >>> _e :=3D ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m= ):?$m:}@}@} >>> +MACHINE :=3D ${_m} >>> .if !empty(_e) >>> .MAKE.DEPENDFILE ?=3D ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]= } >>> .endif >> >> >> What changed in bmake to require this? Now in older checkouts I don't >=20 > deleting the :@ loop iterator variable. >=20 >> get MACHINE defined with DIRDEPS_BUILD without this change. That's no= t >> ideal since it breaks older builds. >=20 > Yes, I should mfc the above change? it is harmess with older bmake's. >=20 This code is only in head. My problem is now bmake can only build commits after this one which breaks bisecting and older project branches which haven't or can't merge in head yet. Is the :@ iterator variable deletion change in bmake change necessary? --=20 Regards, Bryan Drewery --99LghlrNwV6EwttR69cJ6w1JadICmepgH-- --j6VenBe37iiIrdW4NfbjImIEuKEMk7NxM 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 iQEcBAEBAgAGBQJW5fNuAAoJEDXXcbtuRpfPr8sIAKNO3C4CyOwGzPrcTiFo+Hl3 hQXqApTdbv4PsLNb4BIOxzYdVnLpMeMl522YOUHipQLIYjmAImCo0MciJIxXW7ul WriL/Cz4nc4YZffPvc/vVfWK7vfbwWJaToyyfSxrEb4o4taBPO1N//Wl8e1RB0By baxn9RwBss5DEzu3GeI18NrEyRJngCxTXf61OP06jJgA0MAPTxYi/S94J38QlcwJ XjSnZKSn86gQVGq1/HxL+vLpybpbaRMW3W56Hv0sxvZiyFtlAShxN7lYaC+H9VRE whjezC8HQLrC7i9yAa0NU5PnTzChjRVqR2RXORTh2jBylO8wze1WBVQGZ7og9ic= =gtyJ -----END PGP SIGNATURE----- --j6VenBe37iiIrdW4NfbjImIEuKEMk7NxM-- From owner-svn-src-head@freebsd.org Sun Mar 13 23:29:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 526EFACFF2E; Sun, 13 Mar 2016 23:29:23 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0113.outbound.protection.outlook.com [65.55.169.113]) (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 9985C870; Sun, 13 Mar 2016 23:29:22 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=rLt5Qg40kbQQThoMd5qG5kNwE3gpn3fJhlB3ND31GEU=; b=DMwi6RQs7K13sBQn4RrmXtorHYcrIRbHi1trltFr0pcf5zuqikbFOTKyCy9L1s26gvNu6J0QcqK31f3M85xp4p8drDaN+1QAlsAVKTJDvheCqaZprV1ApfwTcqH/qkCRgiv3Z6vPV0e3irx2O+rOjK918TNGArXxRVo73JcQaH8= Received: from BLUPR05CA0047.namprd05.prod.outlook.com (10.141.20.17) by BLUPR0501MB1793.namprd05.prod.outlook.com (10.163.121.140) with Microsoft SMTP Server (TLS) id 15.1.434.16; Sun, 13 Mar 2016 23:29:15 +0000 Received: from BN1AFFO11OLC004.protection.gbl (2a01:111:f400:7c10::139) by BLUPR05CA0047.outlook.office365.com (2a01:111:e400:855::17) with Microsoft SMTP Server (TLS) id 15.1.434.16 via Frontend Transport; Sun, 13 Mar 2016 23:29:15 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BN1AFFO11OLC004.mail.protection.outlook.com (10.58.53.75) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Sun, 13 Mar 2016 23:29:13 +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; Sun, 13 Mar 2016 16:29:11 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2DNTAD42054; Sun, 13 Mar 2016 16:29:10 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id AB3B9385508; Sun, 13 Mar 2016 16:29:10 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake In-Reply-To: <56E5F36E.2020205@FreeBSD.org> References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E5C2EB.1070206@FreeBSD.org> <14946.1457908340@kaos.jnpr.net> <56E5F36E.2020205@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Sun, 13 Mar 2016 16:10:38 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15540.1457911750.1@kaos.jnpr.net> Date: Sun, 13 Mar 2016 16:29:10 -0700 Message-ID: <15542.1457911750@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11OLC004; 1:dhVkdkJXbYUjsrsGb+awQAufgQbrqujgui3KaWDKbQsDl+opVVfvvGqFADx67uuIC7SGgmGRMVyFDyDQgSCfLy7CG57C/I4VvimVqNwOj4tRw3Ln7XgaK/D5S8GAxb6VLcqjjcQbgLQyw01oTNylVX7Ox7qanrUj2ZNtUdet/a2DhIyPeFGe4pOdSf66Gfcy8zqXr0Ibjn0WsFXODmMPa95Omi8A7OZ1CBvOI6/ERBT34315Ab9r8Q9L9yIlgWGARgEhtTjJJftTd1sg5CZ78wxFVe+dIgWLwNgD9ZkATzjIH7lVG5lgCe/ygO5Z2sywu9UAtYswEZvQoAJcu1i7v3HR39E9spIOp1phyrmyHCSJT4xsPV5JTbkrXfY0pTjzregBFbaFzywTZuOw0iq2OA== X-Forefront-Antispam-Report: CIP:66.129.239.19; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(189002)(24454002)(199003)(81166005)(117636001)(4001430100002)(586003)(1220700001)(46406003)(1096002)(450100001)(6806005)(50226001)(97756001)(19580405001)(19580395003)(50986999)(110136002)(2810700001)(4326007)(2906002)(86362001)(105596002)(76176999)(77096005)(106466001)(93886004)(2950100001)(87936001)(23726003)(92566002)(47776003)(5003600100002)(5008740100001)(50466002)(107886002)(76506005)(189998001)(53416004)(11100500001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:BLUPR0501MB1793; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-MS-Office365-Filtering-Correlation-Id: 127197c8-6a43-4cfe-0278-08d34b974a2c X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB1793; 2:5PltmxNJXDOmn0/t0GfJbMXMXj6ERPyxZGmMwIv5FKwO4mB5pk9mZscydmT7DTyicUsojGzOIRwQJwK5iYwwXgD4Mwk78HpUKI5DA0vf73aYwj7VNxb4vCbZuk7QCg3o/av81VfkLQ5wWCzoKjUjvvAGMMfS5yvMjw0fjNsWg/NNFsYXMx2hfrnZk6b1aitK; 3:IIpD0mq0Zp/axgJoFsw5nshXHR7/JF+Xu7xi+p7PYL5Qy7XURciqCg16YbLa6oZ4X9Nj8r7T+xszTJBVG21W1vz1taXYsRCy302kDlo2DULoYLb8vvkkoAz5t1/qgGblczkre4KLaD2u08U+eXtrDpI1bG26sCERb+cUPYrBKFMNoEEAVyPMlSvSLHZOPacIxvTqS+3X3+D3NbgWbOz4uois5Pm6tYfkI4lD/eL/8Io=; 25:mds23vIwvENc7Ov7c+7+aYiLKmYOgsAkbcAyVWDu4ZYjoOiA22tSUeoxYDR2SinwrwEweY54URIUNCrjzbRDSniOlgXa95MeG+sEGqba4bpqs65XcaLyR2/+PGW9TeczaxkTgRMPDINuQJDfWBddDpAoDlMfPaJra/kqjj7pjv5IoSopHdv0j/QiaXSDt9pQRtyk9k+/0/xq1+YDQAKLciFHVHmSGRK24pi1XoGqKgO9ROW03TTUa+/PblEp35utT7YSh6241Mfn5MkuD24rja0qwPoT/+IkLezq7S0IcoeJNQUeQWnSiZh9/rAkWEeIN+ce+ckmsELiocHrcwQRXg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0501MB1793; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB1793; 20:dz1vh8Re71NllbrtutuucFjxl7H0kGpgwOG9Nb1BYQ5jdxItrJ+WlJFH+prLzzjnA+hj+mfuEP8PrJzXANgs0OJ6ZV/f2KRXGsGXyjfQr5OXO/t/lwSGZlxpGP4t1zECD7ylQ71EdVIa1jM4gt/aWBmbXcLekFBAh6MjDv9kPaIrih+BDdGJpk8ovcU6PE8hBybf7TfHK3rpo/lsRjGSKNvA1Hn+vJ16Cj0GUXZe0elcjMyaEgSk4QRunp05akJ/3ie9US++1ZqzNh/nmfcqsvdVjwr6L73JdGBYbwB2DORGN87qJwY4fJzYODi0z2NL0/KM/UvvUc4CodzBHPdpge7ZMdF184CLpeaZyNT/zHiIvAEO3t7BovHA6FWbHG7o4o6HRYntbtu1R4EYtszZTQdl+q6Dqv/PIYCxX8C6zv0bKLtjI3AVRbNPBXfZikH3SU3DGEPIPD75i48JHNydb1WXcKaphRgnubngEAPblJPk36gIPPeJHReQRe7H/HoL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13017025)(13023025)(13024025)(5005006)(8121501046)(13018025)(3002001)(10201501046); SRVR:BLUPR0501MB1793; BCL:0; PCL:0; RULEID:; SRVR:BLUPR0501MB1793; X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB1793; 4:jJ90Zk6ohfsf7aXuFyXnSiDsdtqEeQSoS7FYWIPqvy1i8lbogBHcD9w3htLU0eeN1Ghy8Q8rqiGR3lOSg6ThwXSoTjpegXc9NLE3tlq7lTVwdKERpX2XJ/7uwSoWEkvjk3wR6Cc84Gvw3KBKCrR/tWdeihXVAQNDYvcgLDDVjRQk/tHo5N8qYXiwat5fZzxzukZWJswNJucDfevC4sHk1It1z19UEqs88a3i+E/YY1OqPuCFtgqKHCC4c4/gQI9CyRVvxzclzPZDB914IG7Y37VJh64G4WiZJQAEUXeofAtzhUOubH4MBx8oXPmnRheXJiuC5N+ttw5W1hp9PL70o0tAeIPpgdiftXIfXzGBaowY0USKY1Mgl2kB+gIeimehW5qYIARz8vHOzTsXuC2UY+sfboFvPbHRoJadty+ibqIwTkXV2yhzBAVEbwViXWU5J16sJws3WKq/4gryvWaibA== X-Forefront-PRVS: 0880FB6EC1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BLUPR0501MB1793; 23:fw9DSPXOUYMH4FObuB3gBnO/OQyfQnM2DwdYLs8?= =?us-ascii?Q?kixgVJq7Qs9bKPZyxdF9wUAs3Q5otYpMP6ucEPlSLrOXAqxoJX05rYIfHnGA?= =?us-ascii?Q?4jKX84Ag6bkwXMHluUd4KP4ZRs+OJaLxYpis3UEwib5kRrZsp4X5VeF742/E?= =?us-ascii?Q?erZVl7pW0hFk/hcW5ri3VH+VOu5fKPrMlPqp5NW2dGVn9UDR2REghZe5iuaU?= =?us-ascii?Q?BAfmFmzW0k5KirA3KrRq6n8RTWixwW5utsqaF2eYM7MZcDb3a5DCIPGBuM+g?= =?us-ascii?Q?vuzSz6gWYlDkkk4m5oMxsMYi560QpVIkpT5GnMswSUdaWaxDcMgIGvMQb9XJ?= =?us-ascii?Q?GNYsr2Bni3xiX/mYYiizbK1VWMGNjKjbJwzAViaQZNLcvhotrbIl3Ws8DCSf?= =?us-ascii?Q?8lhzbBqIt0wssBr5OJNctEs8wMqk6N//utYw10nW5N1XrE0ZTdUnoUfyszYk?= =?us-ascii?Q?2yFBBjscvZmwXpBGij1YgECBY4grZy4IReBvXdxjjvZdGIm6++66nmblH+sG?= =?us-ascii?Q?U4jQQ/z2AhpEHNM2TFhcFcfNpMoy9IdAGPWTvquAGQT2eXOL2rzTWFo0y9zS?= =?us-ascii?Q?RshVniFLEvF2CsQHYsgRNHiVFSK6RDiBBZyjydyZZKPcrVbXPntBrnUIM9qB?= =?us-ascii?Q?kmz9xPs7qDs80HRevpdubW0fBlXR824/Z9lqh3+G/aKks6IjafYklMfV+RLk?= =?us-ascii?Q?XXbV1m/rxrYLVpIS1m37QFuKLww3c5eA3zpFwbSm+t8n+X4NvJihUtx/zW2y?= =?us-ascii?Q?kTtHhglknvr8k8Oq1cE37045LDcpRZFeScw4j68o5ahItFxu2eSfFAJfJvGK?= =?us-ascii?Q?fSQOUHjy14pUvuZGjBrZuq0Ti9mo+ChSLajiUGaUaNayqS1dXbkoqEynVZIX?= =?us-ascii?Q?05hjT1bgQFFCzybAJdRW1iHIDwtzqRzMn7wWgAS25lrY+pJ+r4oXa65mWqtl?= =?us-ascii?Q?nQP9yr+RCbROejphNGOGacsVwgXbTpSM/UahhHFTn1ZAn5kAy64FvENp1zaH?= =?us-ascii?Q?08TFJOJqt4vB5VwEESNxNg/sxIEG+ZrCzXkyEmFzMQYNsLCkBYW7vGLiGF5M?= =?us-ascii?Q?FjqrPbe8waz9LAIgvtiDLYixUXhKJkv4tGo6BSFe0vgIed/EputXWi8L2y+w?= =?us-ascii?Q?0EW+QRjnqLvXO5aLiOLQiFj7Bapxu5Q9j?= X-Microsoft-Exchange-Diagnostics: 1; BLUPR0501MB1793; 5:ZGMOVUtNX85nRI/M+9zqqAK6fiYquD8U14UpzkmbJqu5M7pBPpxOU0KOMxY9hFwiX76k/QyEiRPvl7A6fF902Ctg699Ueje43A6YAIi23UTHu7LPBFPioyThll46x03s+MIB3xZsMKIGSfFOOJJPqA==; 24:zywHCeqCHzt3sIDnODHHSYen3+KRWYF5KbqrsP+GYCrijxpYltqBOlqysRGV6b2QpEcJ421NzKDjyHMi20eHn1vhKcO2N3dj8kFSKyFix8o= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2016 23:29:13.0783 (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: BLUPR0501MB1793 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Mar 2016 23:29:23 -0000 Bryan Drewery wrote: > This code is only in head. My problem is now bmake can only build > commits after this one which breaks bisecting and older project branches > which haven't or can't merge in head yet. > > Is the :@ iterator variable deletion change in bmake change necessary? In the sense of good hygiene, yes. Obviously make will work without it since its been that way for 15 years, but this AFAIK is the only makefile affected. From owner-svn-src-head@freebsd.org Mon Mar 14 00:12:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EA947ACF53A; Mon, 14 Mar 2016 00:12:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22b.google.com (mail-ig0-x22b.google.com [IPv6:2607:f8b0:4001:c05::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BFF81662; Mon, 14 Mar 2016 00:12:32 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22b.google.com with SMTP id av4so50469595igc.1; Sun, 13 Mar 2016 17:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=rgdcmM1LJHOiX7sXI42V3/P+cxooRRYIzrJkiNqU16I=; b=aGnKpc8FeONoVi37oOZF19qmGCYvMzFRJp9l1EF8cQtHjOrB0i5z+cghj2wwsshTmT CPE6JhwiolQdRwVs7PX6kKUQhXXBZNR2y3ZBbchrpp0IkIlQnbf8+IJYWrb4jbcYyk1G yd3F5qFo9WMGVEI9rBjwA6dJc9dT3VDTZI4wZypytx01Txch4rshCIfZ6dLNTAtgf98u xsV5Z0CW6G9kjKAMFgMfnBqzDJ2pl8vDSkHVHguRpR/quBxbJ/i0r7ifMxZWuFYdv/Qb v9m7MVRyw/tx832g6H7GCrhhymxikTBoU2TEZdnKkXX+LFOUZwSmk52+warj3P4RHf4W nZlQ== 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=rgdcmM1LJHOiX7sXI42V3/P+cxooRRYIzrJkiNqU16I=; b=DGYTAe7lAIDxASRriRsU/SL8v6Soin6TwL1g7Eed02u46t7kKALIR0069yro73b/Jo dbW+Ew/sJyei9ssiXFg64/h+5Wv4kS1AQ4dCOiBJB5Gm0+RWEIeA2Cb9P0jk4Eq5If4Y lm/kOyxtB7QmCWXU26Ncv91RSOB5ZB9YC0U4KDP/C4iwvX/9FxFBaQ4rTv/t0G8F6Mx9 r/M+lAE3sf69QgzXuc/V4qexGIoE5J6jHPGXhyEoVRgx1K9DhklrHxyxA7upyRthyFYH 9hJlEfpfYvP2IOknxBLVwlEMrgA8zurWoAdwKlnI0PrlTKJoMY7nx439/YcPZI7rej5C SoFg== X-Gm-Message-State: AD7BkJL4IwjQbG7hC58ICAaMu5mgcM1vtRiNuoWS3d50qpP8w2X9nQ9lPSCb/5e/NatnRxP4vYXP4FVYDyWDgg== X-Received: by 10.50.2.35 with SMTP id 3mr14073548igr.33.1457914351837; Sun, 13 Mar 2016 17:12:31 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Sun, 13 Mar 2016 17:12:12 -0700 (PDT) In-Reply-To: <201603132126.u2DLQI8J066879@repo.freebsd.org> References: <201603132126.u2DLQI8J066879@repo.freebsd.org> From: Ed Maste Date: Mon, 14 Mar 2016 00:12:12 +0000 X-Google-Sender-Auth: TUQhCGQ3QS8-pJhN3GvezJI2ScA Message-ID: Subject: Re: svn commit: r296811 - head/sys/netinet/tcp_stacks To: "Bjoern A. Zeeb" Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 00:12:33 -0000 On 13 March 2016 at 21:26, Bjoern A. Zeeb wrote: > Author: bz > Date: Sun Mar 13 21:26:18 2016 > New Revision: 296811 > URL: https://svnweb.freebsd.org/changeset/base/296811 > > Log: > Remove duplicate external declaration of tcprexmtthresh making > gcc compiles barf. Thank you. From owner-svn-src-head@freebsd.org Mon Mar 14 00:34:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E327ACFD2A; Mon, 14 Mar 2016 00:34:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F37BEFE; Mon, 14 Mar 2016 00:34:14 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2E0YD78023912; Mon, 14 Mar 2016 00:34:13 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E0YCcW023909; Mon, 14 Mar 2016 00:34:12 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603140034.u2E0YCcW023909@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Mon, 14 Mar 2016 00:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296816 - head/cddl/contrib/opensolaris/lib/libdtrace/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 00:34:14 -0000 Author: pfg Date: Mon Mar 14 00:34:12 2016 New Revision: 296816 URL: https://svnweb.freebsd.org/changeset/base/296816 Log: 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] MFC after: 1 week Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Sun Mar 13 23:32:59 2016 (r296815) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 14 00:34:12 2016 (r296816) @@ -24,6 +24,7 @@ */ /* * Copyright (c) 2013, Joyent, Inc. All rights reserved. + * Copyright (c) 2016, Pedro Giffuni. All rights reserved. */ #include @@ -721,22 +722,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; @@ -817,17 +816,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: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Sun Mar 13 23:32:59 2016 (r296815) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c Mon Mar 14 00:34:12 2016 (r296816) @@ -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: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c ============================================================================== --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Sun Mar 13 23:32:59 2016 (r296815) +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c Mon Mar 14 00:34:12 2016 (r296816) @@ -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-head@freebsd.org Mon Mar 14 00:51:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA71CACF333; Mon, 14 Mar 2016 00:51:46 +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 94EF01ADE; Mon, 14 Mar 2016 00:51:46 +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 u2E0pjlo029372; Mon, 14 Mar 2016 00:51:45 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E0pjwH029371; Mon, 14 Mar 2016 00:51:45 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603140051.u2E0pjwH029371@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 14 Mar 2016 00:51:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296819 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 00:51:46 -0000 Author: bdrewery Date: Mon Mar 14 00:51:45 2016 New Revision: 296819 URL: https://svnweb.freebsd.org/changeset/base/296819 Log: Reword SX_NOADAPTIVE description to be clear that adaptive is default. The default changed in r193011. MFC after: 1 week Modified: head/share/man/man9/sx.9 Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Mon Mar 14 00:42:19 2016 (r296818) +++ head/share/man/man9/sx.9 Mon Mar 14 00:51:45 2016 (r296819) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2014 +.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-head@freebsd.org Mon Mar 14 00:52:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DF9FACF425 for ; Mon, 14 Mar 2016 00:52:46 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm19-vm0.bullet.mail.bf1.yahoo.com (nm19-vm0.bullet.mail.bf1.yahoo.com [98.139.213.162]) (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 56FF51CE4 for ; Mon, 14 Mar 2016 00:52:45 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1457916437; bh=utff5ChIZM6+tdnZ1fS7bpq8f/cEtlprbIYKXdw6yZE=; h=Subject:To:References:From:Date:In-Reply-To:From:Subject; b=ZdmiJEGHQZcPwIZ+4F+7q5Ph8s+T+ammvji+4R7wBGs+gTf9yxWtPhpKp75Ug+SHCt+xsHJrbYrk6Ob6Ozlvo/YDgsblKVZu4jV1kmZycl3ztXbTS4a4Wi+xU4GSVscfsrZhRFUgbDQp06+H9c25tUyKWNhw2tmgbHHSBs4QPa/O24o7OykQqP3+T+kBsbTnWGzCTM1lufk6pGtVS0mqh4VowOHsmb2tccLvcHxJg+Lrmb9p1Gu2W+w5EAT/hynrC/iXGNTNP3QOFZaqhm7nNMIwJYX7P7J3dXRVzhXCbbtHzEzTal2rUJxFajr0IBul5gkai2X7jmI6stBx7K+PhA== Received: from [66.196.81.173] by nm19.bullet.mail.bf1.yahoo.com with NNFMP; 14 Mar 2016 00:47:17 -0000 Received: from [98.139.211.200] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 14 Mar 2016 00:47:17 -0000 Received: from [127.0.0.1] by smtp209.mail.bf1.yahoo.com with NNFMP; 14 Mar 2016 00:47:17 -0000 X-Yahoo-Newman-Id: 779930.26715.bm@smtp209.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 8zjYR3oVM1k_qPCzkLdz8Tcsva6OpWPVtSth0.RGAFAF_8J zcUYtTY45Kia9linx_7WD5sPhRc02O1HK.zfadhsudVcyWUjz9dphu_CEiHn csqs0m2.XFSmbddVUP_6Yazn.Hj58Y4TATUEHTs.7dvNFlbB.s1HJgKaTh_R 9F_5.LJd7efyLzVkq1dg1f6lI7gyuCLbEysMv7YvcwvzYLoxMUKkzyQACrg. AF0Wjo9L_zi1JIES._HiYVQMevPTlNlwmXp.P38U96BRoet.1yoKqb8LtvRK GgjuMGI8LkPKbFakFp6sN7mQ6VUtMJNb5a4KYO5VKT7gFyHK4NvkRXZhKVkJ XCcYKfpivi5E0AsRCL5vW9VQYoajYAsZo0ixnjwrODP20qPJO6.pVlozyAxl 5TmZgl8SUXKeJopEdDPGiUgKCremIofSK_zCpx0Z950WsebZYSIup6bS22qC Tdzpk_n5Dmnx9xSsIFuBDUjze.s_nJxx0Gi_oJYGFhSrwRwWzzaSOI7CNssI VI8J07eEYjars7XKaM2b7zz9a0pjvpADd X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r296816 - head/cddl/contrib/opensolaris/lib/libdtrace/common To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603140034.u2E0YCcW023909@repo.freebsd.org> From: Pedro Giffuni Message-ID: <56E60A52.4010708@FreeBSD.org> Date: Sun, 13 Mar 2016 19:48:18 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <201603140034.u2E0YCcW023909@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 00:52:46 -0000 On 03/13/16 19:34, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Mar 14 00:34:12 2016 > New Revision: 296816 > URL: https://svnweb.freebsd.org/changeset/base/296816 > > Log: > 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] > MFC after: 1 week > > Modified: > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_regset.c > head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_strtab.c > > Modified: head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c > ============================================================================== > --- head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Sun Mar 13 23:32:59 2016 (r296815) > +++ head/cddl/contrib/opensolaris/lib/libdtrace/common/dt_module.c Mon Mar 14 00:34:12 2016 (r296816) > @@ -24,6 +24,7 @@ > */ > /* > * Copyright (c) 2013, Joyent, Inc. All rights reserved. > + * Copyright (c) 2016, Pedro Giffuni. All rights reserved. > */ > FWIW, I rarely add my copyright to files, however in the case of CDDL'd files this is a license requirement. Pedro. From owner-svn-src-head@freebsd.org Mon Mar 14 01:55:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 63B50AD07E8; Mon, 14 Mar 2016 01:55:33 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0121.outbound.protection.outlook.com [207.46.100.121]) (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 8EA89F0E; Mon, 14 Mar 2016 01:55:32 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vpLXjNckiTsROIMsEUJ7mmiuHRXXJ75iedZDSyKJegQ=; b=PumvWOP7+Q5aNT2FD50Op+3ISPeR68dxyhr6dAMbYdDsUhQtrGD5oOwYxiVihoe88OfHfalPe/FNk8IUYgSExcADiyVKET19HIdNSSBR7eUulL89S61Cb4Vi1dQelDIoGbGBxOqWevlibF6sMPwerLjZ4CIqTu4qMCaPo1ysuIE= Received: from BLUPR05CA0042.namprd05.prod.outlook.com (10.141.20.12) by CO2PR05MB746.namprd05.prod.outlook.com (10.141.227.142) with Microsoft SMTP Server (TLS) id 15.1.415.20; Sun, 13 Mar 2016 22:21:15 +0000 Received: from BN1BFFO11FD023.protection.gbl (2a01:111:f400:7c10::1:123) by BLUPR05CA0042.outlook.office365.com (2a01:111:e400:855::12) with Microsoft SMTP Server (TLS) id 15.1.434.16 via Frontend Transport; Sun, 13 Mar 2016 22:21:14 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; FreeBSD.org; dkim=none (message not signed) header.d=none;FreeBSD.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BN1BFFO11FD023.mail.protection.outlook.com (10.58.144.86) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Sun, 13 Mar 2016 22:21:14 +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; Sun, 13 Mar 2016 15:21:04 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2DML4D71687; Sun, 13 Mar 2016 15:21:04 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id 4AE0E385508; Sun, 13 Mar 2016 15:21:04 -0700 (PDT) To: Bryan Drewery CC: , , , Subject: Re: svn commit: r296637 - in head: contrib/bmake contrib/bmake/mk contrib/bmake/unit-tests share/mk usr.bin/bmake In-Reply-To: <56E33536.2000407@FreeBSD.org> References: <201603110135.u2B1Zd8a001604@repo.freebsd.org> <56E243ED.5050803@FreeBSD.org> <81518.1457728319@kaos.jnpr.net> <56E33536.2000407@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Fri, 11 Mar 2016 13:14:30 -0800." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <14784.1457907664.1@kaos.jnpr.net> Date: Sun, 13 Mar 2016 15:21:04 -0700 Message-ID: <14785.1457907664@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(24454002)(189002)(189998001)(110136002)(586003)(50466002)(2810700001)(107886002)(4001430100002)(23726003)(76506005)(2950100001)(92566002)(46406003)(4326007)(77096005)(2906002)(53416004)(11100500001)(1096002)(50226001)(106466001)(1220700001)(87936001)(5008740100001)(6806005)(450100001)(19580405001)(86362001)(5003600100002)(19580395003)(47776003)(50986999)(76176999)(105596002)(97756001)(81166005)(117636001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR05MB746; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD023; 1:voOMjEUKaS65x+gSYQtRGICUJj32XDIDm7nBoOGYStgdMYOnWHimOgJ8hnBrs1MMmqV5eAtzVL+EDsUPWZmyQDRmK1xy8gpzNd0aopGxY1lo2GokQm5vjqWzFSZKHSOsZ7aPvxQImOhdyGOuz3TPvvC13nkog4SUWa15ZqSGMQNYuuL0+tDcYWkmOPL1gpSx3zEmS3XP7qcHTEoKCCN3sepcVylGnr3rpmw53tlTyFRA7gS/4ICw2JUKPH4nOJJTdFczJ+tDsuXUCEnBF2xWnlLD99nRT487aRfoMAU98uPXLhkXX4IjENdLe+7gNmQ0HisaYBPsTVCg1pqR25eAdoAwqRmohn5mov0Ek4E7F8OxnPuKs9Wzn2WGdG3w1YceQtb033GRM/gKiI45dpo112c38ekXhyTwZdlxF4epuJA= X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB746; 2:MKZ/u9Qoct05EETmkfISqceLVMnfJpby3aI4GrdlGpfdM5mgPbYYcfM7r0Dve4VUBLYyhGiP4+1UrwdG8cU4f6F8ttLLBAFrT5yQ6r4hIX7vbOZG/VZBm8NOvwBQSIIXkBftIqs4+9xLK1bhSupvYQ==; 3:Rq3HA70sm8lgiGd8BO5eB+08si85tLHmeIFyvbVcXqs30umLfWBTc7CgepCbm1ADYWFMLk4tOzL/T28XJRZL/8OHBMUvOkYqRFchELIxNAB3XnCGIC9NFLofjATO6kTJzEIlM+DDj2cHVabdK9ZMLP6Y+7pOw4Gc44kiD+R5VNPNw22XS4SwcqwFuxfBcWBkozNb/h7WGnKcBMoIGOXz9Q7QeNot62/jddZATyNSowQ=; 25:8wmLM5thqlIS+/OghpxCWUIxIDdMWYoApPD8d22gY1jroGTi+kYBe7HYdZYiBwGqyd0tZbz6btiT2Qbunob3z5xqUmABiYByhREB7oJOG7uyXf0A8aHiTktBd0skMTrA5BQscTlo7/W78Pma7mPmasxw7Ww1fqjNjgT2TCghsYwMWzicicF3uTlX1xYJ3DSUr/jZwoKW/1A6E9kPjbmiHNzy6HMy3OGjaTUCeLwnN88pQhH64xBpvbJOpdDjbQte3mSgyIsGJN3iHEaP5ckMqVTHHibWlOG1xJ0r/i8QD1MdVzWKyIGO6g3vgtKNvmFTrU+1zpATtqDr+BRJNXtQAQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CO2PR05MB746; X-MS-Office365-Filtering-Correlation-Id: e80ab409-becd-49f0-0119-08d34b8dca3e X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB746; 20:piVjqROLG/fkR+L0kCWrd2ZnV6OCfnFmAneNWOF9fES7fdxd8pG5zisr2lQThsNIicgBpO2Duwg5o7IpnMZSawKMP/bjFUSC+lTEB5aRwqh3ionSFSuXrD2pef82QQjQPNc2NrH4oKY5/C8x3RaTuoWded2gE+rTCV3vlgSbIYo+1I0RyhzaOBhOprdyQEbZ40jE4oXJ2nUAPL/XI+kFYhANIHC0eydy0VgEsiy81Mzo7fCVXhasHvd/jll15EKSu99+uNvInIIi5aWZ1jsa9roQA9/2v2aCeYd60mKLVvFcmuao3hCGx2ZI5MQo0l/OoRMgU2bhrUqNlF3P+ckfsAIcW77zkYuq2qT+hStFPrqmOLZefRNCCQ4u3UlsCb+t0bnbgaN3EjU/og3xG59MFiEIn2SHVo3GGBcJE+F6gFesYgKfpA+J/rf5XEoQo9xpvzpwVlLPGR5WN9UHeDPqpiEZo3FlJXlQxOlHfa62jtxxLEcGTDliZ7F2l/4vovD8 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(13017025)(13015025)(13018025)(13023025)(13024025)(10201501046)(3002001); SRVR:CO2PR05MB746; BCL:0; PCL:0; RULEID:; SRVR:CO2PR05MB746; X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB746; 4:J2578Zy4TFvhtPFctf7iYvi/9Z+MTn36xZqtSHi5i+g1ep6TykrnGTph+xcbz17IYOSy0RDNUASbEkewM4HN9LW0GSigUzIDJzwtKnB/haPBYoPcJFQv/bqprlerC+DanQx41U/3WDjsnCt/0/v8XPSshyQkiyFA4F6FvwGr3YDnizy65s2oO3PEehW1BjctlgqKuMBM1J+wLey0x1xQaey3wzNoZV4T4skBL29ETKTEMMa7Q1qBJt4whfXhlTblOhqi0ChXLRSYS3y+1WHGnL4iUTnqyQ08bS8oxTENrQyHSDM07h0lLS7Jnm3zuUy24qg5gi3zId5twpm4UCF7rCdzVxesBXrOAV1eQw8yGX/ZzoAabgiHAu5+l8CHMN4JCq04Z8lZRiHbNRaaPNP7pWGoBqlug2P3X75XV/K1d1uYSZdbUOXLrLBghCdofuVCfMLD5mlGkDhaEf54YSEyJQ== X-Forefront-PRVS: 0880FB6EC1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CO2PR05MB746; 23:281zkxJqIlclb7Fa5vEJJQikhqYlH45ALFVgwTuAwy?= =?us-ascii?Q?nnBTt9W9i1OOI8GyqfekPzzliwDk+5yK1WxxDOMAwuM95XFLEiisCg5UUdDu?= =?us-ascii?Q?2RC4YZE2kWHbCdq544r+R2gyumOq6Xpv8XuOqd/Un8YVJIaLPeHXc67LxgLY?= =?us-ascii?Q?0fMG1CHH/pkVD3SV2u7fa1tOIA5l7Dl7uT5esxnAAbWQWGM6h/x/QTFfCH59?= =?us-ascii?Q?edm8RespIUB08umwLTP8LwDkiy128N7ckRs8HAFt2WtJWZCLU15D/qoyebH7?= =?us-ascii?Q?o4SMUzG2xzp6hq5RHY4y/ZhPuuQnsvRI8/gATSxGRCHZ0GKVEsCgkcwIdzxW?= =?us-ascii?Q?vsc4dknzAr3W/5CvuJInLbOxaIJGU4o1/s5Z/BUxtqIkDvGJUrw6kFz5bfy0?= =?us-ascii?Q?Ibgst4XW26JprhHtQHO76yKy/rBG3QttnihVF7rc8H/b2FQ0HxiUD8hk3CEV?= =?us-ascii?Q?bs6lycHK8F1HGVQYjcRYWmVR4Y9VG1lziykiatc0fHXtnVVhbHTcD1P3PcCb?= =?us-ascii?Q?XS7SzPzQIl/hR1eb5SwgtrPAXU/wCNDTomld5F12YGSQiuLY+nCXlNa+dlc+?= =?us-ascii?Q?pQ6p51My0T9+0orlRMWeghUTWAobFO9VBA7FD3z2OH+SexXoIaRBavf5BDCK?= =?us-ascii?Q?Opci/cBod6JbECK2+uNDEo1PD75M4zWpWEGnozfNX0uWwrfq3uzGnR8a7pnm?= =?us-ascii?Q?7blbE6vhmA/9ggTPzZvvC6K5mcCxUis6uFuIyM3MBonActgr5dkD+BfFZjMj?= =?us-ascii?Q?AWbQPyYz8XzgOTNYcxfenFrelOwRYj1qJQbSdJFVArDrVsa0reC4i/I+r5is?= =?us-ascii?Q?UySYt9comR0FeGc+WG1SowIcIv1D/DZdwisked32H1xjPWVv+BbZCVz8klmy?= =?us-ascii?Q?vwjZdymDt1nR8p89ul6TjlXu757tVQzSQghMQV+M9DJVmw8H9Y2KdznA/rL4?= =?us-ascii?Q?gpIxD1TT7HKg/hYiaUxgeH7LZGXO+t4mkyrNF0AcZrsz01wVgcy9eu6k9VuK?= =?us-ascii?Q?3gOl8bj+/EEyfH1ym6AClNcYMxDXKPq5od4Tm0mFciPtbqEsQaWTojjmvqe9?= =?us-ascii?Q?YXdoM67pzmKXnLeESmOZofZ4ChJHFItKLDuq3YSUx9xaNBBpu7ke5xER0Bog?= =?us-ascii?Q?JxC3pWMsQ=3D?= X-Microsoft-Exchange-Diagnostics: 1; CO2PR05MB746; 5:n3f+2Z0aEU3umVrlKPVBTDMcbYRtEqmpAVp/z68u9cJgIWclUigkX/d+/ynTFHdBYVZurc+eQk5VCo0/LF8rDaidUQ+wBWan33mOLk3+/PN78GPcsfIvpNYSOamvXci6DCiw66BcecWiwNwJBRa6yQ==; 24:q6T+VNofZl6Yw+/tgxHgNVQTDVcAlOU29UqX+2kn9KTQqbO52mKZxqOOHjrOLfvLyASozj0oX7CZCfwd0qfgQNiejh52nZ9pGKvhcMTR1uY= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2016 22:21:14.1472 (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: CO2PR05MB746 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 01:55:33 -0000 Bryan Drewery wrote: > Older bmake (with default MAKESYSPATH=.../share/mk) running 'make > upgrade_checks' in top-level which builds latest bmake in usr.bin/bmake > which uses share/mk/bsd.dep.mk where I check MAKE_VERSION for .dinclude > support. Since usr.bin/bmake/Makefile overrides MAKE_VERSION then the > check later in bsd.dep.mk fails because it thinks .dinclude is available > when it is not. Ah I see. Yes, we can rename the variable in the Makefile. > I renamed it to _MAKE_VERSION to avoid the problem in > usr.bin/bmake/Makefile. From owner-svn-src-head@freebsd.org Mon Mar 14 04:39:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2C7EAD0748; Mon, 14 Mar 2016 04:39:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDFB5B3D; Mon, 14 Mar 2016 04:39:36 +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 u2E4dZ45096919; Mon, 14 Mar 2016 04:39:35 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E4dZNO096916; Mon, 14 Mar 2016 04:39:35 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603140439.u2E4dZNO096916@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 14 Mar 2016 04:39:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296823 - in head: sbin/ifconfig 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 04:39:37 -0000 Author: adrian Date: Mon Mar 14 04:39:35 2016 New Revision: 296823 URL: https://svnweb.freebsd.org/changeset/base/296823 Log: [net80211] handle unlisted information elements. This displays the IE names in ifconfig but it doesn't yet decode things. Submitted by: Idwer Vollering Differential Revision: https://reviews.freebsd.org/D3782 Modified: head/sbin/ifconfig/ifieee80211.c head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_input.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Mon Mar 14 01:35:46 2016 (r296822) +++ head/sbin/ifconfig/ifieee80211.c Mon Mar 14 04:39:35 2016 (r296823) @@ -3072,6 +3072,7 @@ iename(int elemid) case IEEE80211_ELEMID_CFPARMS: return " CFPARMS"; case IEEE80211_ELEMID_TIM: return " TIM"; case IEEE80211_ELEMID_IBSSPARMS:return " IBSSPARMS"; + case IEEE80211_ELEMID_BSSLOAD: return " BSSLOAD"; case IEEE80211_ELEMID_CHALLENGE:return " CHALLENGE"; case IEEE80211_ELEMID_PWRCNSTR: return " PWRCNSTR"; case IEEE80211_ELEMID_PWRCAP: return " PWRCAP"; @@ -3083,6 +3084,7 @@ iename(int elemid) case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; + case IEEE80211_ELEMID_APCHANREP:return " APCHANREP"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; } Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Mon Mar 14 01:35:46 2016 (r296822) +++ head/sys/net80211/ieee80211.h Mon Mar 14 04:39:35 2016 (r296823) @@ -708,6 +708,7 @@ enum { IEEE80211_ELEMID_TIM = 5, IEEE80211_ELEMID_IBSSPARMS = 6, IEEE80211_ELEMID_COUNTRY = 7, + IEEE80211_ELEMID_BSSLOAD = 11, IEEE80211_ELEMID_CHALLENGE = 16, /* 17-31 reserved for challenge text extension */ IEEE80211_ELEMID_PWRCNSTR = 32, @@ -725,6 +726,7 @@ enum { IEEE80211_ELEMID_QOS = 46, IEEE80211_ELEMID_RSN = 48, IEEE80211_ELEMID_XRATES = 50, + IEEE80211_ELEMID_APCHANREP = 51, IEEE80211_ELEMID_HTINFO = 61, IEEE80211_ELEMID_TPC = 150, IEEE80211_ELEMID_CCKM = 156, @@ -749,6 +751,7 @@ enum { IEEE80211_ELEMID_MESHGANN = 125, IEEE80211_ELEMID_MESHRANN = 126, /* 127 Extended Capabilities */ + IEEE80211_ELEMID_MESHEXTCAP = 127, /* 128-129 reserved */ IEEE80211_ELEMID_MESHPREQ = 130, IEEE80211_ELEMID_MESHPREP = 131, @@ -783,6 +786,78 @@ struct ieee80211_country_ie { #define IEEE80211_COUNTRY_MAX_SIZE \ (sizeof(struct ieee80211_country_ie) + 3*(IEEE80211_COUNTRY_MAX_BANDS-1)) +struct ieee80211_bss_load_ie { + uint8_t ie; + uint8_t len; + uint16_t sta_count; /* station count */ + uint8_t chan_load; /* channel utilization */ + uint8_t aac; /* available admission capacity */ +} __packed; + +struct ieee80211_ap_chan_report_ie { + uint8_t ie; + uint8_t len; + uint8_t class; /* operating class */ + /* Annex E, E.1 Country information and operating classes */ + uint8_t chan_list[0]; +} __packed; + +#define IEEE80211_EXTCAP_CMS (1ULL << 0) /* 20/40 BSS coexistence management support */ +#define IEEE80211_EXTCAP_RSVD_1 (1ULL << 1) +#define IEEE80211_EXTCAP_ECS (1ULL << 2) /* extended channel switching */ +#define IEEE80211_EXTCAP_RSVD_3 (1ULL << 3) +#define IEEE80211_EXTCAP_PSMP_CAP (1ULL << 4) /* PSMP capability */ +#define IEEE80211_EXTCAP_RSVD_5 (1ULL << 5) +#define IEEE80211_EXTCAP_S_PSMP_SUPP (1ULL << 6) +#define IEEE80211_EXTCAP_EVENT (1ULL << 7) +#define IEEE80211_EXTCAP_DIAGNOSTICS (1ULL << 8) +#define IEEE80211_EXTCAP_MCAST_DIAG (1ULL << 9) +#define IEEE80211_EXTCAP_LOC_TRACKING (1ULL << 10) +#define IEEE80211_EXTCAP_FMS (1ULL << 11) +#define IEEE80211_EXTCAP_PROXY_ARP (1ULL << 12) +#define IEEE80211_EXTCAP_CIR (1ULL << 13) /* collocated interference reporting */ +#define IEEE80211_EXTCAP_CIVIC_LOC (1ULL << 14) +#define IEEE80211_EXTCAP_GEOSPATIAL_LOC (1ULL << 15) +#define IEEE80211_EXTCAP_TFS (1ULL << 16) +#define IEEE80211_EXTCAP_WNM_SLEEPMODE (1ULL << 17) +#define IEEE80211_EXTCAP_TIM_BROADCAST (1ULL << 18) +#define IEEE80211_EXTCAP_BSS_TRANSITION (1ULL << 19) +#define IEEE80211_EXTCAP_QOS_TRAF_CAP (1ULL << 20) +#define IEEE80211_EXTCAP_AC_STA_COUNT (1ULL << 21) +#define IEEE80211_EXTCAP_M_BSSID (1ULL << 22) /* multiple BSSID field */ +#define IEEE80211_EXTCAP_TIMING_MEAS (1ULL << 23) +#define IEEE80211_EXTCAP_CHAN_USAGE (1ULL << 24) +#define IEEE80211_EXTCAP_SSID_LIST (1ULL << 25) +#define IEEE80211_EXTCAP_DMS (1ULL << 26) +#define IEEE80211_EXTCAP_UTC_TSF_OFFSET (1ULL << 27) +#define IEEE80211_EXTCAP_TLDS_BUF_STA_SUPP (1ULL << 28) /* TDLS peer U-APSP buffer STA support */ +#define IEEE80211_EXTCAP_TLDS_PPSM_SUPP (1ULL << 29) /* TDLS peer PSM support */ +#define IEEE80211_EXTCAP_TLDS_CH_SW (1ULL << 30) /* TDLS channel switching */ +#define IEEE80211_EXTCAP_INTERWORKING (1ULL << 31) +#define IEEE80211_EXTCAP_QOSMAP (1ULL << 32) +#define IEEE80211_EXTCAP_EBR (1ULL << 33) +#define IEEE80211_EXTCAP_SSPN_IF (1ULL << 34) +#define IEEE80211_EXTCAP_RSVD_35 (1ULL << 35) +#define IEEE80211_EXTCAP_MSGCF_CAP (1ULL << 36) +#define IEEE80211_EXTCAP_TLDS_SUPP (1ULL << 37) +#define IEEE80211_EXTCAP_TLDS_PROHIB (1ULL << 38) +#define IEEE80211_EXTCAP_TLDS_CH_SW_PROHIB (1ULL << 39) /* TDLS channel switching prohibited */ +#define IEEE80211_EXTCAP_RUF (1ULL << 40) /* reject unadmitted frame */ +/* service interval granularity */ +#define IEEE80211_EXTCAP_SIG \ + ((1ULL << 41) | (1ULL << 42) | (1ULL << 43)) +#define IEEE80211_EXTCAP_ID_LOC (1ULL << 44) +#define IEEE80211_EXTCAP_U_APSD_COEX (1ULL << 45) +#define IEEE80211_EXTCAP_WNM_NOTIFICATION (1ULL << 46) +#define IEEE80211_EXTCAP_RSVD_47 (1ULL << 47) +#define IEEE80211_EXTCAP_SSID (1ULL << 48) /* UTF-8 SSID */ +/* bits 49-n are reserved */ + +struct ieee80211_extcap_ie { + uint8_t ie; + uint8_t len; +} __packed; + /* * 802.11h Quiet Time Element. */ Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Mon Mar 14 01:35:46 2016 (r296822) +++ head/sys/net80211/ieee80211_input.c Mon Mar 14 04:39:35 2016 (r296823) @@ -570,6 +570,8 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_IBSSPARMS: case IEEE80211_ELEMID_CFPARMS: case IEEE80211_ELEMID_PWRCNSTR: + case IEEE80211_ELEMID_BSSLOAD: + case IEEE80211_ELEMID_APCHANREP: /* NB: avoid debugging complaints */ break; case IEEE80211_ELEMID_XRATES: @@ -601,6 +603,8 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_MESHCONF: scan->meshconf = frm; break; + case IEEE80211_ELEMID_MESHEXTCAP: + break; #endif case IEEE80211_ELEMID_VENDOR: if (iswpaoui(frm)) From owner-svn-src-head@freebsd.org Mon Mar 14 06:30:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12EB0AD0B83; Mon, 14 Mar 2016 06:30:39 +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 D8DC87A3; Mon, 14 Mar 2016 06:30:38 +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 u2E6Ubjo031150; Mon, 14 Mar 2016 06:30:37 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E6Ub9r031149; Mon, 14 Mar 2016 06:30:37 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603140630.u2E6Ub9r031149@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 14 Mar 2016 06:30:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296824 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 06:30:39 -0000 Author: wma Date: Mon Mar 14 06:30:37 2016 New Revision: 296824 URL: https://svnweb.freebsd.org/changeset/base/296824 Log: Fix GIC interrupt decoding in INTRNG code Bug was already fixed in not-INTRNG code, it needs to be corrected here as well. Source: https://reviews.freebsd.org/rS294422 Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: cognet, wma Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5029 Modified: head/sys/arm/arm/gic.c Modified: head/sys/arm/arm/gic.c ============================================================================== --- head/sys/arm/arm/gic.c Mon Mar 14 04:39:35 2016 (r296823) +++ head/sys/arm/arm/gic.c Mon Mar 14 06:30:37 2016 (r296824) @@ -755,7 +755,7 @@ gic_map_fdt(struct arm_gic_softc *sc, st * The hardware only supports active-high-level or rising-edge. */ tripol = isrc->isrc_cells[2]; - if (tripol & 0x0a) { + if (tripol & 0x0a && irq >= GIC_FIRST_SPI) { device_printf(sc->gic_dev, "unsupported trigger/polarity configuration " "0x%02x\n", tripol & 0x0f); From owner-svn-src-head@freebsd.org Mon Mar 14 07:05:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B323CACFA5B; Mon, 14 Mar 2016 07:05:42 +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 835CAE4B; Mon, 14 Mar 2016 07:05:42 +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 u2E75fn3043507; Mon, 14 Mar 2016 07:05:41 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E75fWT043502; Mon, 14 Mar 2016 07:05:41 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603140705.u2E75fWT043502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 14 Mar 2016 07:05:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296825 - in head/sys: arm/conf arm/mv arm/mv/armada38x boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 07:05:42 -0000 Author: wma Date: Mon Mar 14 07:05:41 2016 New Revision: 296825 URL: https://svnweb.freebsd.org/changeset/base/296825 Log: Make MPIC compatible with ARM_INTRNG After ARM_INTRNG introduction, MPIC code needed several modifications: - IRQ resource and its handler added - several DEVMETHODs of INTRNG interface implemented - defines enhanced to ensure code compiles as well for AXP as for A38X - added dummy MSI_IRQ, ERR_IRQ defines for Armada38x - MPIC driver was added to files.armada38x, ARM_INTRNG option enabled in kernconf file and regs of MPIC corrected in dts file. Instead of modifying Armada38X DTS, offsets to CPU registers defined in driver were changed. That required restoring 'reg' property of mpic node in ArmadaXP to state compliant with Linux DTS. Additionally, required ARM_INTRNG definitions were added to mv_common.c. Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: adrian, andrew, ian, skra Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5030 Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/mv/armada38x/files.armada38x head/sys/arm/mv/mpic.c head/sys/arm/mv/mvreg.h head/sys/boot/fdt/dts/arm/db78460.dts Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Mon Mar 14 06:30:37 2016 (r296824) +++ head/sys/arm/conf/ARMADA38X Mon Mar 14 07:05:41 2016 (r296825) @@ -23,6 +23,7 @@ options SCHED_ULE # ULE scheduler #options SCHED_4BSD # 4BSD scheduler options SMP +options ARM_INTRNG # Debugging #options DEBUG Modified: head/sys/arm/mv/armada38x/files.armada38x ============================================================================== --- head/sys/arm/mv/armada38x/files.armada38x Mon Mar 14 06:30:37 2016 (r296824) +++ head/sys/arm/mv/armada38x/files.armada38x Mon Mar 14 07:05:41 2016 (r296825) @@ -1,4 +1,5 @@ # $FreeBSD$ +arm/mv/mpic.c standard arm/mv/armada38x/armada38x.c standard arm/mv/armada38x/armada38x_mp.c optional smp Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Mon Mar 14 06:30:37 2016 (r296824) +++ head/sys/arm/mv/mpic.c Mon Mar 14 07:05:41 2016 (r296825) @@ -33,14 +33,20 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_platform.h" + #include #include #include #include #include #include +#include #include +#include +#include #include +#include #include #include @@ -48,11 +54,16 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include +#ifdef ARM_INTRNG +#include "pic_if.h" +#endif + #ifdef DEBUG #define debugf(fmt, args...) do { printf("%s(): ", __func__); \ printf(fmt,##args); } while (0) @@ -60,46 +71,63 @@ __FBSDID("$FreeBSD$"); #define debugf(fmt, args...) #endif -#define MPIC_INT_ERR 4 -#define MPIC_INT_MSI 96 +#define MPIC_INT_ERR 4 +#define MPIC_INT_MSI 96 -#define IRQ_MASK 0x3ff +#define IRQ_MASK 0x3ff -#define MPIC_CTRL 0x0 -#define MPIC_SOFT_INT 0x4 -#define MPIC_SOFT_INT_DRBL1 (1 << 5) -#define MPIC_ERR_CAUSE 0x20 -#define MPIC_ISE 0x30 -#define MPIC_ICE 0x34 - - -#define MPIC_IN_DRBL 0x78 -#define MPIC_IN_DRBL_MASK 0x7c -#define MPIC_CTP 0xb0 -#define MPIC_CTP 0xb0 -#define MPIC_IIACK 0xb4 -#define MPIC_ISM 0xb8 -#define MPIC_ICM 0xbc -#define MPIC_ERR_MASK 0xec0 +#define MPIC_CTRL 0x0 +#define MPIC_SOFT_INT 0x4 +#define MPIC_SOFT_INT_DRBL1 (1 << 5) +#define MPIC_ERR_CAUSE 0x20 +#define MPIC_ISE 0x30 +#define MPIC_ICE 0x34 +#define MPIC_INT_CTL(irq) (0x100 + (irq)*4) + +#define MPIC_INT_IRQ_FIQ_MASK(cpuid) (0x101 << (cpuid)) +#define MPIC_CTRL_NIRQS(ctrl) (((ctrl) >> 2) & 0x3ff) + +#define MPIC_IN_DRBL 0x08 +#define MPIC_IN_DRBL_MASK 0x0c +#define MPIC_PPI_CAUSE 0x10 +#define MPIC_CTP 0x40 +#define MPIC_IIACK 0x44 +#define MPIC_ISM 0x48 +#define MPIC_ICM 0x4c +#define MPIC_ERR_MASK 0xe50 + +#define MPIC_PPI 32 struct mv_mpic_softc { device_t sc_dev; - struct resource * mpic_res[3]; + struct resource * mpic_res[4]; bus_space_tag_t mpic_bst; bus_space_handle_t mpic_bsh; bus_space_tag_t cpu_bst; bus_space_handle_t cpu_bsh; bus_space_tag_t drbl_bst; bus_space_handle_t drbl_bsh; + struct mtx mtx; + + struct intr_irqsrc ** mpic_isrcs; + int nirqs; + void * intr_hand; }; static struct resource_spec mv_mpic_spec[] = { { SYS_RES_MEMORY, 0, RF_ACTIVE }, { SYS_RES_MEMORY, 1, RF_ACTIVE }, - { SYS_RES_MEMORY, 2, RF_ACTIVE }, + { SYS_RES_MEMORY, 2, RF_ACTIVE | RF_OPTIONAL }, + { SYS_RES_IRQ, 0, RF_ACTIVE | RF_OPTIONAL }, { -1, 0 } }; +static struct ofw_compat_data compat_data[] = { + {"mrvl,mpic", true}, + {"marvell,mpic", true}, + {NULL, false} +}; + static struct mv_mpic_softc *mv_mpic_sc = NULL; void mpic_send_ipi(int cpus, u_int ipi); @@ -109,9 +137,21 @@ static int mv_mpic_attach(device_t); uint32_t mv_mpic_get_cause(void); uint32_t mv_mpic_get_cause_err(void); uint32_t mv_mpic_get_msi(void); +static void mpic_unmask_irq(uintptr_t nb); +static void mpic_mask_irq(uintptr_t nb); +static void mpic_mask_irq_err(uintptr_t nb); +static void mpic_unmask_irq_err(uintptr_t nb); +static int mpic_intr(void *arg); +static void mpic_unmask_msi(void); +#ifndef ARM_INTRNG static void arm_mask_irq_err(uintptr_t); static void arm_unmask_irq_err(uintptr_t); -static void arm_unmask_msi(void); +#endif + +#define MPIC_WRITE(softc, reg, val) \ + bus_space_write_4((softc)->mpic_bst, (softc)->mpic_bsh, (reg), (val)) +#define MPIC_READ(softc, reg) \ + bus_space_read_4((softc)->mpic_bst, (softc)->mpic_bsh, (reg)) #define MPIC_CPU_WRITE(softc, reg, val) \ bus_space_write_4((softc)->cpu_bst, (softc)->cpu_bsh, (reg), (val)) @@ -130,7 +170,7 @@ mv_mpic_probe(device_t dev) if (!ofw_bus_status_okay(dev)) return (ENXIO); - if (!ofw_bus_is_compatible(dev, "mrvl,mpic")) + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) return (ENXIO); device_set_desc(dev, "Marvell Integrated Interrupt Controller"); @@ -142,6 +182,7 @@ mv_mpic_attach(device_t dev) { struct mv_mpic_softc *sc; int error; + uint32_t val; sc = (struct mv_mpic_softc *)device_get_softc(dev); @@ -151,11 +192,20 @@ mv_mpic_attach(device_t dev) sc->sc_dev = dev; + mtx_init(&sc->mtx, "MPIC lock", NULL, MTX_SPIN); + error = bus_alloc_resources(dev, mv_mpic_spec, sc->mpic_res); if (error) { device_printf(dev, "could not allocate resources\n"); return (ENXIO); } +#ifdef ARM_INTRNG + if (sc->mpic_res[3] == NULL) + device_printf(dev, "No interrupt to use.\n"); + else + bus_setup_intr(dev, sc->mpic_res[3], INTR_TYPE_CLK, + mpic_intr, NULL, sc, &sc->intr_hand); +#endif sc->mpic_bst = rman_get_bustag(sc->mpic_res[0]); sc->mpic_bsh = rman_get_bushandle(sc->mpic_res[0]); @@ -163,21 +213,182 @@ mv_mpic_attach(device_t dev) sc->cpu_bst = rman_get_bustag(sc->mpic_res[1]); sc->cpu_bsh = rman_get_bushandle(sc->mpic_res[1]); - sc->drbl_bst = rman_get_bustag(sc->mpic_res[2]); - sc->drbl_bsh = rman_get_bushandle(sc->mpic_res[2]); + if (sc->mpic_res[2] != NULL) { + /* This is required only if MSIs are used. */ + sc->drbl_bst = rman_get_bustag(sc->mpic_res[2]); + sc->drbl_bsh = rman_get_bushandle(sc->mpic_res[2]); + } bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh, MPIC_CTRL, 1); MPIC_CPU_WRITE(mv_mpic_sc, MPIC_CTP, 0); - arm_unmask_msi(); + val = MPIC_READ(mv_mpic_sc, MPIC_CTRL); + sc->nirqs = MPIC_CTRL_NIRQS(val); + +#ifdef ARM_INTRNG + sc->mpic_isrcs = malloc(sc->nirqs * sizeof (*sc->mpic_isrcs), M_DEVBUF, + M_WAITOK | M_ZERO); + + if (intr_pic_register(dev, OF_xref_from_device(dev)) != 0) { + device_printf(dev, "could not register PIC\n"); + bus_release_resources(dev, mv_mpic_spec, sc->mpic_res); + return (ENXIO); + } +#endif + + mpic_unmask_msi(); return (0); } +#ifdef ARM_INTRNG +static int +mpic_intr(void *arg) +{ + struct mv_mpic_softc *sc; + struct trapframe *tf; + struct intr_irqsrc *isrc; + uint32_t cause, irqsrc; + unsigned int irq; + u_int cpuid; + + sc = arg; + tf = curthread->td_intr_frame; + cpuid = PCPU_GET(cpuid); + irq = 0; + + for (cause = MPIC_CPU_READ(sc, MPIC_PPI_CAUSE); cause > 0; + cause >>= 1, irq++) { + if (cause & 1) { + irqsrc = MPIC_READ(sc, MPIC_INT_CTL(irq)); + if ((irqsrc & MPIC_INT_IRQ_FIQ_MASK(cpuid)) == 0) + continue; + isrc = sc->mpic_isrcs[irq]; + if (isrc == NULL) { + device_printf(sc->sc_dev, "Stray interrupt %u detected\n", irq); + mpic_mask_irq(irq); + continue; + } + intr_irq_dispatch(isrc, tf); + } + } + + return (FILTER_HANDLED); +} + +static int +mpic_attach_isrc(struct mv_mpic_softc *sc, struct intr_irqsrc *isrc, u_int irq) +{ + const char *name; + + mtx_lock_spin(&sc->mtx); + if (sc->mpic_isrcs[irq] != NULL) { + mtx_unlock_spin(&sc->mtx); + return (sc->mpic_isrcs[irq] == isrc ? 0 : EEXIST); + } + sc->mpic_isrcs[irq] = isrc; + isrc->isrc_data = irq; + mtx_unlock_spin(&sc->mtx); + + name = device_get_nameunit(sc->sc_dev); + intr_irq_set_name(isrc, "%s", name); + + return (0); +} + +#ifdef FDT +static int +mpic_map_fdt(struct mv_mpic_softc *sc, struct intr_irqsrc *isrc, u_int *irqp) +{ + u_int irq; + int error; + + if (isrc->isrc_ncells != 1) + return (EINVAL); + + irq = isrc->isrc_cells[0]; + + error = mpic_attach_isrc(sc, isrc, irq); + if (error != 0) + return (error); + + isrc->isrc_nspc_num = irq; + isrc->isrc_trig = INTR_TRIGGER_CONFORM; + isrc->isrc_pol = INTR_POLARITY_CONFORM; + isrc->isrc_nspc_type = INTR_IRQ_NSPC_PLAIN; + + *irqp = irq; + + return (0); +} +#endif + +static int +mpic_register(device_t dev, struct intr_irqsrc *isrc, boolean_t *is_percpu) +{ + struct mv_mpic_softc *sc; + int error; + u_int irq = 0; + + sc = device_get_softc(dev); + +#ifdef FDT + if (isrc->isrc_type == INTR_ISRCT_FDT) + error = mpic_map_fdt(sc, isrc, &irq); + else +#endif + error = EINVAL; + + if (error == 0) + *is_percpu = irq < MPIC_PPI; + + return (error); +} + +static void +mpic_disable_source(device_t dev, struct intr_irqsrc *isrc) +{ + u_int irq; + + irq = isrc->isrc_data; + mpic_mask_irq(irq); +} + +static void +mpic_enable_source(device_t dev, struct intr_irqsrc *isrc) +{ + u_int irq; + + irq = isrc->isrc_data; + mpic_unmask_irq(irq); +} +static void +mpic_pre_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + mpic_disable_source(dev, isrc); +} + +static void +mpic_post_ithread(device_t dev, struct intr_irqsrc *isrc) +{ + + mpic_enable_source(dev, isrc); +} +#endif + static device_method_t mv_mpic_methods[] = { DEVMETHOD(device_probe, mv_mpic_probe), DEVMETHOD(device_attach, mv_mpic_attach), + +#ifdef ARM_INTRNG + DEVMETHOD(pic_register, mpic_register), + DEVMETHOD(pic_disable_source, mpic_disable_source), + DEVMETHOD(pic_enable_source, mpic_enable_source), + DEVMETHOD(pic_post_ithread, mpic_post_ithread), + DEVMETHOD(pic_pre_ithread, mpic_pre_ithread), +#endif { 0, 0 } }; @@ -189,8 +400,10 @@ static driver_t mv_mpic_driver = { static devclass_t mv_mpic_devclass; -DRIVER_MODULE(mpic, simplebus, mv_mpic_driver, mv_mpic_devclass, 0, 0); +EARLY_DRIVER_MODULE(mpic, simplebus, mv_mpic_driver, mv_mpic_devclass, 0, 0, + BUS_PASS_INTERRUPT); +#ifndef ARM_INTRNG int arm_get_next_irq(int last) { @@ -219,49 +432,42 @@ void arm_mask_irq(uintptr_t nb) { - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_CTP, 1); - - if (nb < ERR_IRQ) { - bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh, - MPIC_ICE, nb); - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ISM, nb); - } else if (nb < MSI_IRQ) - arm_mask_irq_err(nb); + mpic_mask_irq(nb); } static void arm_mask_irq_err(uintptr_t nb) { - uint32_t mask; - uint8_t bit_off; - bit_off = nb - ERR_IRQ; - mask = MPIC_CPU_READ(mv_mpic_sc, MPIC_ERR_MASK); - mask &= ~(1 << bit_off); - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ERR_MASK, mask); + mpic_mask_irq_err(nb); } void arm_unmask_irq(uintptr_t nb) { - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_CTP, 0); - - if (nb < ERR_IRQ) { - bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh, - MPIC_ISE, nb); - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ICM, nb); - } else if (nb < MSI_IRQ) - arm_unmask_irq_err(nb); - - if (nb == 0) - MPIC_CPU_WRITE(mv_mpic_sc, MPIC_IN_DRBL_MASK, 0xffffffff); + mpic_unmask_irq(nb); } void arm_unmask_irq_err(uintptr_t nb) { + + mpic_unmask_irq_err(nb); +} +#endif + +static void +mpic_unmask_msi(void) +{ + + mpic_unmask_irq(MPIC_INT_MSI); +} + +static void +mpic_unmask_irq_err(uintptr_t nb) +{ uint32_t mask; uint8_t bit_off; @@ -276,10 +482,42 @@ arm_unmask_irq_err(uintptr_t nb) } static void -arm_unmask_msi(void) +mpic_mask_irq_err(uintptr_t nb) +{ + uint32_t mask; + uint8_t bit_off; + + bit_off = nb - ERR_IRQ; + mask = MPIC_CPU_READ(mv_mpic_sc, MPIC_ERR_MASK); + mask &= ~(1 << bit_off); + MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ERR_MASK, mask); +} + +static void +mpic_unmask_irq(uintptr_t nb) +{ + + if (nb < ERR_IRQ) { + bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh, + MPIC_ISE, nb); + MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ICM, nb); + } else if (nb < MSI_IRQ) + mpic_unmask_irq_err(nb); + + if (nb == 0) + MPIC_CPU_WRITE(mv_mpic_sc, MPIC_IN_DRBL_MASK, 0xffffffff); +} + +static void +mpic_mask_irq(uintptr_t nb) { - arm_unmask_irq(MPIC_INT_MSI); + if (nb < ERR_IRQ) { + bus_space_write_4(mv_mpic_sc->mpic_bst, mv_mpic_sc->mpic_bsh, + MPIC_ICE, nb); + MPIC_CPU_WRITE(mv_mpic_sc, MPIC_ISM, nb); + } else if (nb < MSI_IRQ) + mpic_mask_irq_err(nb); } uint32_t @@ -313,6 +551,7 @@ mv_mpic_get_msi(void) uint32_t cause; uint8_t bit_off; + KASSERT(mv_mpic_sc->drbl_bst != NULL, ("No doorbell in mv_mpic_get_msi")); cause = MPIC_DRBL_READ(mv_mpic_sc, 0); if (cause) @@ -359,7 +598,8 @@ mv_msi_data(int irq, uint64_t *addr, uin return (0); } -#if defined(SMP) + +#if defined(SMP) && defined(SOC_MV_ARMADAXP) void intr_pic_init_secondary(void) { Modified: head/sys/arm/mv/mvreg.h ============================================================================== --- head/sys/arm/mv/mvreg.h Mon Mar 14 06:30:37 2016 (r296824) +++ head/sys/arm/mv/mvreg.h Mon Mar 14 07:05:41 2016 (r296825) @@ -67,7 +67,10 @@ #elif defined (SOC_MV_ARMADAXP) #define IRQ_CAUSE 0x18 #define IRQ_MASK 0x30 -#else /* !SOC_MV_DISCOVERY && !SOC_MV_LOKIPLUS */ +#elif defined (SOC_MV_ARMADA38X) +#define MSI_IRQ 0x3ff +#define ERR_IRQ 0x3ff +#else #define IRQ_CAUSE 0x0 #define IRQ_MASK 0x4 #define FIQ_MASK 0x8 Modified: head/sys/boot/fdt/dts/arm/db78460.dts ============================================================================== --- head/sys/boot/fdt/dts/arm/db78460.dts Mon Mar 14 06:30:37 2016 (r296824) +++ head/sys/boot/fdt/dts/arm/db78460.dts Mon Mar 14 07:05:41 2016 (r296825) @@ -75,7 +75,7 @@ interrupt-controller; #address-cells = <0>; #interrupt-cells = <1>; - reg = <0x20a00 0x500 0x21000 0x800 0x20400 0x100>; + reg = <0x20a00 0x500 0x21870 0x58 0x20400 0x100>; compatible = "mrvl,mpic"; }; From owner-svn-src-head@freebsd.org Mon Mar 14 07:14:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3028ACE118; Mon, 14 Mar 2016 07:14:36 +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 752D9647; Mon, 14 Mar 2016 07:14:36 +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 u2E7EZPD046604; Mon, 14 Mar 2016 07:14:35 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E7EZbe046600; Mon, 14 Mar 2016 07:14:35 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603140714.u2E7EZbe046600@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 14 Mar 2016 07:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296826 - in head/sys/arm: conf mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 07:14:36 -0000 Author: wma Date: Mon Mar 14 07:14:34 2016 New Revision: 296826 URL: https://svnweb.freebsd.org/changeset/base/296826 Log: Add support for USB3.0 on Armada38x This commit provides attachment of xhci-platform for A38X boards, making it possible to mount FreeBSD world from USB3.0 flash. 'xhci' device was added to files.mv (as optional) and kernconf of Armada38x was enhanced. It was also necessary to open programmable memory windows of USB3.0. fdt_win_setup needed improvement so it's able to traverse through children of internal-regs node. Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: hselasky Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5031 Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/mv/files.mv head/sys/arm/mv/mv_common.c head/sys/arm/mv/mvwin.h Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Mon Mar 14 07:05:41 2016 (r296825) +++ head/sys/arm/conf/ARMADA38X Mon Mar 14 07:14:34 2016 (r296826) @@ -71,6 +71,7 @@ device mpcore_timer # USB device usb device ehci +device xhci device umass device scbus device pass Modified: head/sys/arm/mv/files.mv ============================================================================== --- head/sys/arm/mv/files.mv Mon Mar 14 07:05:41 2016 (r296825) +++ head/sys/arm/mv/files.mv Mon Mar 14 07:14:34 2016 (r296826) @@ -27,5 +27,6 @@ dev/nand/nfc_mv.c optional nand dev/mvs/mvs_soc.c optional mvs dev/uart/uart_dev_ns8250.c optional uart dev/usb/controller/ehci_mv.c optional ehci +dev/usb/controller/xhci_mv.c optional xhci kern/kern_clocksource.c standard Modified: head/sys/arm/mv/mv_common.c ============================================================================== --- head/sys/arm/mv/mv_common.c Mon Mar 14 07:05:41 2016 (r296825) +++ head/sys/arm/mv/mv_common.c Mon Mar 14 07:14:34 2016 (r296826) @@ -79,6 +79,7 @@ static int win_eth_can_remap(int i); static int decode_win_cpu_valid(void); #endif static int decode_win_usb_valid(void); +static int decode_win_usb3_valid(void); static int decode_win_eth_valid(void); static int decode_win_pcie_valid(void); static int decode_win_sata_valid(void); @@ -93,6 +94,7 @@ static void decode_win_cpu_setup(void); static int decode_win_sdram_fixup(void); #endif static void decode_win_usb_setup(u_long); +static void decode_win_usb3_setup(u_long); static void decode_win_eth_setup(u_long); static void decode_win_sata_setup(u_long); @@ -100,6 +102,7 @@ static void decode_win_idma_setup(u_long static void decode_win_xor_setup(u_long); static void decode_win_usb_dump(u_long); +static void decode_win_usb3_dump(u_long); static void decode_win_eth_dump(u_long base); static void decode_win_idma_dump(u_long base); static void decode_win_xor_dump(u_long base); @@ -134,6 +137,7 @@ struct soc_node_spec { static struct soc_node_spec soc_nodes[] = { { "mrvl,ge", &decode_win_eth_setup, &decode_win_eth_dump }, { "mrvl,usb-ehci", &decode_win_usb_setup, &decode_win_usb_dump }, + { "marvell,armada-380-xhci", &decode_win_usb3_setup, &decode_win_usb3_dump }, { "mrvl,sata", &decode_win_sata_setup, NULL }, { "mrvl,xor", &decode_win_xor_setup, &decode_win_xor_dump }, { "mrvl,idma", &decode_win_idma_setup, &decode_win_idma_dump }, @@ -559,7 +563,7 @@ soc_decode_win(void) if (!decode_win_cpu_valid() || !decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_xor_valid()) + !decode_win_xor_valid() || !decode_win_usb3_valid()) return (EINVAL); decode_win_cpu_setup(); @@ -567,7 +571,7 @@ soc_decode_win(void) if (!decode_win_usb_valid() || !decode_win_eth_valid() || !decode_win_idma_valid() || !decode_win_pcie_valid() || !decode_win_sata_valid() || - !decode_win_xor_valid()) + !decode_win_xor_valid() || !decode_win_usb3_valid()) return (EINVAL); #endif if (MV_DUMP_WIN) @@ -600,6 +604,13 @@ WIN_REG_BASE_IDX_RD(win_usb, br, MV_WIN_ WIN_REG_BASE_IDX_WR(win_usb, cr, MV_WIN_USB_CTRL) WIN_REG_BASE_IDX_WR(win_usb, br, MV_WIN_USB_BASE) +#ifdef SOC_MV_ARMADA38X +WIN_REG_BASE_IDX_RD(win_usb3, cr, MV_WIN_USB3_CTRL) +WIN_REG_BASE_IDX_RD(win_usb3, br, MV_WIN_USB3_BASE) +WIN_REG_BASE_IDX_WR(win_usb3, cr, MV_WIN_USB3_CTRL) +WIN_REG_BASE_IDX_WR(win_usb3, br, MV_WIN_USB3_BASE) +#endif + WIN_REG_BASE_IDX_RD(win_eth, br, MV_WIN_ETH_BASE) WIN_REG_BASE_IDX_RD(win_eth, sz, MV_WIN_ETH_SIZE) WIN_REG_BASE_IDX_RD(win_eth, har, MV_WIN_ETH_REMAP) @@ -1118,6 +1129,85 @@ decode_win_usb_setup(u_long base) } /************************************************************************** + * USB3 windows routines + **************************************************************************/ +#ifdef SOC_MV_ARMADA38X +static int +decode_win_usb3_valid(void) +{ + + return (decode_win_can_cover_ddr(MV_WIN_USB3_MAX)); +} + +static void +decode_win_usb3_dump(u_long base) +{ + int i; + + for (i = 0; i < MV_WIN_USB3_MAX; i++) + printf("USB3.0 window#%d: c 0x%08x, b 0x%08x\n", i, + win_usb3_cr_read(base, i), win_usb3_br_read(base, i)); +} + +/* + * Set USB3 decode windows + */ +static void +decode_win_usb3_setup(u_long base) +{ + uint32_t br, cr; + int i, j; + + for (i = 0; i < MV_WIN_USB3_MAX; i++) { + win_usb3_cr_write(base, i, 0); + win_usb3_br_write(base, i, 0); + } + + /* Only access to active DRAM banks is required */ + for (i = 0; i < MV_WIN_DDR_MAX; i++) { + if (ddr_is_active(i)) { + br = ddr_base(i); + cr = (((ddr_size(i) - 1) & + (IO_WIN_SIZE_MASK << IO_WIN_SIZE_SHIFT)) | + (ddr_attr(i) << IO_WIN_ATTR_SHIFT) | + (ddr_target(i) << IO_WIN_TGT_SHIFT) | + IO_WIN_ENA_MASK); + + /* Set the first free USB3.0 window */ + for (j = 0; j < MV_WIN_USB3_MAX; j++) { + if (win_usb3_cr_read(base, j) & IO_WIN_ENA_MASK) + continue; + + win_usb3_br_write(base, j, br); + win_usb3_cr_write(base, j, cr); + break; + } + } + } +} +#else +/* + * Provide dummy functions to satisfy the build + * for SoCs not equipped with USB3 + */ +static int +decode_win_usb3_valid(void) +{ + + return (1); +} + +static void +decode_win_usb3_setup(u_long base) +{ +} + +static void +decode_win_usb3_dump(u_long base) +{ +} +#endif +/************************************************************************** * ETH windows routines **************************************************************************/ @@ -2077,6 +2167,17 @@ fdt_win_setup(void) return (ENXIO); child = OF_child(node); } + /* + * Next, move one more level down to internal-regs node (if + * it is present) and its children. This node also have + * "simple-bus" compatible. + */ + if ((child == 0) && (node == OF_finddevice("simple-bus"))) { + node = fdt_find_compatible(node, "simple-bus", 0); + if (node == 0) + return (0); + child = OF_child(node); + } } return (0); Modified: head/sys/arm/mv/mvwin.h ============================================================================== --- head/sys/arm/mv/mvwin.h Mon Mar 14 07:05:41 2016 (r296825) +++ head/sys/arm/mv/mvwin.h Mon Mar 14 07:14:34 2016 (r296826) @@ -242,6 +242,10 @@ #define MV_WIN_USB_BASE(n) (0x10 * (n) + 0x324) #define MV_WIN_USB_MAX 4 +#define MV_WIN_USB3_CTRL(n) (0x8 * (n)) +#define MV_WIN_USB3_BASE(n) (0x8 * (n) + 0x4) +#define MV_WIN_USB3_MAX 8 + #define MV_WIN_ETH_BASE(n) (0x8 * (n) + 0x200) #define MV_WIN_ETH_SIZE(n) (0x8 * (n) + 0x204) #define MV_WIN_ETH_REMAP(n) (0x4 * (n) + 0x280) From owner-svn-src-head@freebsd.org Mon Mar 14 07:24:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61C7AACE5D4; Mon, 14 Mar 2016 07:24:09 +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 3D01CB35; Mon, 14 Mar 2016 07:24:09 +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 u2E7O83D049782; Mon, 14 Mar 2016 07:24:08 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E7O885049781; Mon, 14 Mar 2016 07:24:08 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603140724.u2E7O885049781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 14 Mar 2016 07:24:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296827 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 07:24:09 -0000 Author: wma Date: Mon Mar 14 07:24:08 2016 New Revision: 296827 URL: https://svnweb.freebsd.org/changeset/base/296827 Log: Add xhci_mv.c Add missing xhci driver for Marvell systems. Submitted by: Bartosz Szczepanek Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: hselasky Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5031 Added: head/sys/dev/usb/controller/xhci_mv.c (contents, props changed) Added: head/sys/dev/usb/controller/xhci_mv.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/usb/controller/xhci_mv.c Mon Mar 14 07:24:08 2016 (r296827) @@ -0,0 +1,232 @@ +/*- + * Copyright (c) 2015 Semihalf. + * Copyright (c) 2015 Stormshield. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_bus.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#define XHCI_HC_DEVSTR "Marvell Integrated USB 3.0 controller" +#define XHCI_HC_VENDOR "Marvell" + +#define IS_DMA_32B 1 + +static device_attach_t xhci_attach; +static device_detach_t xhci_detach; + +static struct ofw_compat_data compat_data[] = { + {"marvell,armada-380-xhci", true}, + {NULL, false} +}; + +static int +xhci_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, XHCI_HC_DEVSTR); + + return (BUS_PROBE_DEFAULT); +} + +static int +xhci_attach(device_t dev) +{ + struct xhci_softc *sc = device_get_softc(dev); + int err = 0, rid = 0; + + sc->sc_bus.parent = dev; + sc->sc_bus.devices = sc->sc_devices; + sc->sc_bus.devices_max = XHCI_MAX_DEVICES; + + sc->sc_io_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (sc->sc_io_res == NULL) { + device_printf(dev, "Failed to map memory\n"); + xhci_detach(dev); + return (ENXIO); + } + + sc->sc_io_tag = rman_get_bustag(sc->sc_io_res); + sc->sc_io_hdl = rman_get_bushandle(sc->sc_io_res); + sc->sc_io_size = rman_get_size(sc->sc_io_res); + + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); + if (sc->sc_irq_res == NULL) { + device_printf(dev, "Failed to allocate IRQ\n"); + xhci_detach(dev); + return (ENXIO); + } + + sc->sc_bus.bdev = device_add_child(dev, "usbus", -1); + if (sc->sc_bus.bdev == NULL) { + device_printf(dev, "Failed to add USB device\n"); + xhci_detach(dev); + return (ENXIO); + } + + device_set_ivars(sc->sc_bus.bdev, &sc->sc_bus); + + sprintf(sc->sc_vendor, XHCI_HC_VENDOR); + device_set_desc(sc->sc_bus.bdev, XHCI_HC_DEVSTR); + + err = bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_BIO | INTR_MPSAFE, + NULL, (driver_intr_t *)xhci_interrupt, sc, &sc->sc_intr_hdl); + if (err != 0) { + device_printf(dev, "Failed to setup error IRQ, %d\n", err); + sc->sc_intr_hdl = NULL; + xhci_detach(dev); + return (err); + } + + err = xhci_init(sc, dev, IS_DMA_32B); + if (err != 0) { + device_printf(dev, "Failed to init XHCI, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + err = xhci_start_controller(sc); + if (err != 0) { + device_printf(dev, "Failed to start XHCI controller, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + err = device_probe_and_attach(sc->sc_bus.bdev); + if (err != 0) { + device_printf(dev, "Failed to initialize USB, with error %d\n", err); + xhci_detach(dev); + return (ENXIO); + } + + return (0); +} + +static int +xhci_detach(device_t dev) +{ + struct xhci_softc *sc = device_get_softc(dev); + device_t bdev; + int err; + + if (sc->sc_bus.bdev != NULL) { + bdev = sc->sc_bus.bdev; + device_detach(bdev); + device_delete_child(dev, bdev); + } + + /* during module unload there are lots of children leftover */ + device_delete_children(dev); + + if (sc->sc_irq_res != NULL && sc->sc_intr_hdl != NULL) { + err = bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intr_hdl); + if (err != 0) + device_printf(dev, "Could not tear down irq, %d\n", + err); + sc->sc_intr_hdl = NULL; + } + + if (sc->sc_irq_res != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, + rman_get_rid(sc->sc_irq_res), sc->sc_irq_res); + sc->sc_irq_res = NULL; + } + + if (sc->sc_io_res != NULL) { + bus_release_resource(dev, SYS_RES_MEMORY, + rman_get_rid(sc->sc_io_res), sc->sc_io_res); + sc->sc_io_res = NULL; + } + + xhci_uninit(sc); + + return (0); +} + +static device_method_t xhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, xhci_probe), + DEVMETHOD(device_attach, xhci_attach), + DEVMETHOD(device_detach, xhci_detach), + DEVMETHOD(device_suspend, bus_generic_suspend), + DEVMETHOD(device_resume, bus_generic_resume), + DEVMETHOD(device_shutdown, bus_generic_shutdown), + + DEVMETHOD_END +}; + +static driver_t xhci_driver = { + "xhci", + xhci_methods, + sizeof(struct xhci_softc), +}; + +static devclass_t xhci_devclass; + +DRIVER_MODULE(xhci, simplebus, xhci_driver, xhci_devclass, 0, 0); +MODULE_DEPEND(xhci, usb, 1, 1, 1); From owner-svn-src-head@freebsd.org Mon Mar 14 07:26:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29578ACE706; Mon, 14 Mar 2016 07:26:40 +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 EED52CE5; Mon, 14 Mar 2016 07:26:39 +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 u2E7Qclf049919; Mon, 14 Mar 2016 07:26:38 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E7QcAY049918; Mon, 14 Mar 2016 07:26:38 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603140726.u2E7QcAY049918@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Mon, 14 Mar 2016 07:26:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296828 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 07:26:40 -0000 Author: wma Date: Mon Mar 14 07:26:38 2016 New Revision: 296828 URL: https://svnweb.freebsd.org/changeset/base/296828 Log: pmap arm64: fixing pmap_invalidate_range It seems that if range within one page is given this page will not be invalidated at all. Clean it up. Submitted by: Dominik Ermel Obtained from: Semihalf Sponsored by: Cavium Reviewed by: wma, zbb Approved by: cognet (mentor) Differential Revision: https://reviews.freebsd.org/D5569 Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Mon Mar 14 07:24:08 2016 (r296827) +++ head/sys/arm64/arm64/pmap.c Mon Mar 14 07:26:38 2016 (r296828) @@ -772,12 +772,10 @@ pmap_invalidate_range(pmap_t pmap, vm_of vm_offset_t addr; sched_pin(); - sva >>= PAGE_SHIFT; - eva >>= PAGE_SHIFT; __asm __volatile("dsb sy"); - for (addr = sva; addr < eva; addr++) { + for (addr = sva; addr < eva; addr += PAGE_SIZE) { __asm __volatile( - "tlbi vaae1is, %0" : : "r"(addr)); + "tlbi vaae1is, %0" : : "r"(addr >> PAGE_SHIFT)); } __asm __volatile( "dsb sy \n" From owner-svn-src-head@freebsd.org Mon Mar 14 08:48:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0864AD07CB; Mon, 14 Mar 2016 08:48:17 +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 7A787F65; Mon, 14 Mar 2016 08:48:17 +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 u2E8mGox074224; Mon, 14 Mar 2016 08:48:16 GMT (envelope-from gnn@FreeBSD.org) Received: (from gnn@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2E8mGti074223; Mon, 14 Mar 2016 08:48:16 GMT (envelope-from gnn@FreeBSD.org) Message-Id: <201603140848.u2E8mGti074223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gnn set sender to gnn@FreeBSD.org using -f From: "George V. Neville-Neil" Date: Mon, 14 Mar 2016 08:48:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296829 - head/usr.sbin/bhyve X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 08:48:17 -0000 Author: gnn Date: Mon Mar 14 08:48:16 2016 New Revision: 296829 URL: https://svnweb.freebsd.org/changeset/base/296829 Log: Fix typo: nmd->cur_tx_ring should be used in pci_vtnet_netmap_writev() The buffer length should be checked to avoid overflow, but there is no API to get the slot length, so the hardcoded value is used. Return the currently-first request chain back to the available queue if there are no more packets. Report the link as up if we managed to open vale port. Use consistent coding style. Submitted by: btw MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5595 Modified: head/usr.sbin/bhyve/pci_virtio_net.c Modified: head/usr.sbin/bhyve/pci_virtio_net.c ============================================================================== --- head/usr.sbin/bhyve/pci_virtio_net.c Mon Mar 14 07:26:38 2016 (r296828) +++ head/usr.sbin/bhyve/pci_virtio_net.c Mon Mar 14 08:48:16 2016 (r296829) @@ -381,7 +381,7 @@ pci_vtnet_tap_rx(struct pci_vtnet_softc vq_endchains(vq, 1); } -static int +static __inline int pci_vtnet_netmap_writev(struct nm_desc *nmd, struct iovec *iov, int iovcnt) { int r, i; @@ -396,7 +396,7 @@ pci_vtnet_netmap_writev(struct nm_desc * r++; if (r > nmd->last_tx_ring) r = nmd->first_tx_ring; - if (r == nmd->cur_rx_ring) + if (r == nmd->cur_tx_ring) break; continue; } @@ -405,6 +405,8 @@ pci_vtnet_netmap_writev(struct nm_desc * buf = NETMAP_BUF(ring, idx); for (i = 0; i < iovcnt; i++) { + if (len + iov[i].iov_len > 2048) + break; memcpy(&buf[len], iov[i].iov_base, iov[i].iov_len); len += iov[i].iov_len; } @@ -418,7 +420,7 @@ pci_vtnet_netmap_writev(struct nm_desc * return (len); } -static inline int +static __inline int pci_vtnet_netmap_readv(struct nm_desc *nmd, struct iovec *iov, int iovcnt) { int len = 0; @@ -548,6 +550,7 @@ pci_vtnet_netmap_rx(struct pci_vtnet_sof * No more packets, but still some avail ring * entries. Interrupt if needed/appropriate. */ + vq_retchain(vq); vq_endchains(vq, 0); return; } @@ -884,8 +887,9 @@ pci_vtnet_init(struct vmctx *ctx, struct pci_set_cfgdata16(pi, PCIR_SUBDEV_0, VIRTIO_TYPE_NET); pci_set_cfgdata16(pi, PCIR_SUBVEND_0, VIRTIO_VENDOR); - /* Link is up if we managed to open tap device. */ - sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0); + /* Link is up if we managed to open tap device or vale port. */ + sc->vsc_config.status = (opts == NULL || sc->vsc_tapfd >= 0 || + sc->vsc_nmd != NULL); /* use BAR 1 to map MSI-X table and PBA, if we're using MSI-X */ if (vi_intr_init(&sc->vsc_vs, 1, fbsdrun_virtio_msix())) From owner-svn-src-head@freebsd.org Mon Mar 14 09:10:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3F78ACF2E6; Mon, 14 Mar 2016 09:10:31 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from zxy.spb.ru (zxy.spb.ru [195.70.199.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 967A4E65; Mon, 14 Mar 2016 09:10:31 +0000 (UTC) (envelope-from slw@zxy.spb.ru) Received: from slw by zxy.spb.ru with local (Exim 4.86 (FreeBSD)) (envelope-from ) id 1afOW5-000P1J-6N; Mon, 14 Mar 2016 12:10:21 +0300 Date: Mon, 14 Mar 2016 12:10:21 +0300 From: Slawa Olhovchenkov To: "George V. Neville-Neil" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296829 - head/usr.sbin/bhyve Message-ID: <20160314091021.GE94639@zxy.spb.ru> References: <201603140848.u2E8mGti074223@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603140848.u2E8mGti074223@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: slw@zxy.spb.ru X-SA-Exim-Scanned: No (on zxy.spb.ru); SAEximRunCond expanded to false X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 09:10:31 -0000 On Mon, Mar 14, 2016 at 08:48:16AM +0000, George V. Neville-Neil wrote: > Author: gnn > Date: Mon Mar 14 08:48:16 2016 > New Revision: 296829 > URL: https://svnweb.freebsd.org/changeset/base/296829 > > Log: > Fix typo: nmd->cur_tx_ring should be used in pci_vtnet_netmap_writev() > The buffer length should be checked to avoid overflow, but there > is no API to get the slot length, so the hardcoded value is used. What about netmap_ring:nr_buf_size? From owner-svn-src-head@freebsd.org Mon Mar 14 14:55:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 563C6AD0FAB; Mon, 14 Mar 2016 14:55:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 09443FFE; Mon, 14 Mar 2016 14:55:16 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EEtFK9014611; Mon, 14 Mar 2016 14:55:15 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EEtFSL014609; Mon, 14 Mar 2016 14:55:15 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603141455.u2EEtFSL014609@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 14 Mar 2016 14:55:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296861 - in head/sys: arm/arm powerpc/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 14:55:17 -0000 Author: bz Date: Mon Mar 14 14:55:15 2016 New Revision: 296861 URL: https://svnweb.freebsd.org/changeset/base/296861 Log: Only check for SYS_freebsd6_lseek if the syscall code is defined. Whether this is the right or best solution is unclear but it fixes the build for now. Modified: head/sys/arm/arm/vm_machdep.c head/sys/powerpc/powerpc/exec_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Mon Mar 14 14:15:26 2016 (r296860) +++ head/sys/arm/arm/vm_machdep.c Mon Mar 14 14:55:15 2016 (r296861) @@ -40,6 +40,8 @@ * Utah $Hdr: vm_machdep.c 1.16.1.1 89/06/23$ */ +#include "opt_compat.h" + #include __FBSDID("$FreeBSD$"); @@ -180,7 +182,7 @@ cpu_set_syscall_retval(struct thread *td /* * __syscall returns an off_t while most other syscalls return an * int. As an off_t is 64-bits and an int is 32-bits we need to - * place the returned data into r1. As the lseek and frerebsd6_lseek + * place the returned data into r1. As the lseek and freebsd6_lseek * syscalls also return an off_t they do not need this fixup. */ call = frame->tf_r7; @@ -189,8 +191,11 @@ cpu_set_syscall_retval(struct thread *td register_t code = ap[_QUAD_LOWWORD]; if (td->td_proc->p_sysent->sv_mask) code &= td->td_proc->p_sysent->sv_mask; - fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) - ? 1 : 0; + fixup = ( +#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) + code != SYS_freebsd6_lseek && +#endif + code != SYS_lseek) ? 1 : 0; } #endif Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Mon Mar 14 14:15:26 2016 (r296860) +++ head/sys/powerpc/powerpc/exec_machdep.c Mon Mar 14 14:55:15 2016 (r296861) @@ -879,8 +879,11 @@ cpu_set_syscall_retval(struct thread *td int code = tf->fixreg[FIRSTARG + 1]; if (p->p_sysent->sv_mask) code &= p->p_sysent->sv_mask; - fixup = (code != SYS_freebsd6_lseek && code != SYS_lseek) ? - 1 : 0; + fixup = ( +#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) + code != SYS_freebsd6_lseek && +#endif + code != SYS_lseek) ? 1 : 0; } else fixup = 0; From owner-svn-src-head@freebsd.org Mon Mar 14 15:02:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7F136ACF22F; Mon, 14 Mar 2016 15:02:01 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mx1.sbone.de", Issuer "SBone.DE" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 146EA839; Mon, 14 Mar 2016 15:02:00 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 E1D4D25D385E; Mon, 14 Mar 2016 15:01:49 +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 04DEBC78381; Mon, 14 Mar 2016 15:01:49 +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 RNPunjYdgnqY; Mon, 14 Mar 2016 15:01:46 +0000 (UTC) Received: from [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6] (orange-tun0-ula.sbone.de [IPv6:fde9:577b:c1a9:4420:cabc:c8ff:fe8b:4fe6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 3E7E7C7837F; Mon, 14 Mar 2016 15:01:45 +0000 (UTC) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Subject: Re: svn commit: r296825 - in head/sys: arm/conf arm/mv arm/mv/armada38x boot/fdt/dts/arm From: "Bjoern A. Zeeb" In-Reply-To: <201603140705.u2E75fWT043502@repo.freebsd.org> Date: Mon, 14 Mar 2016 15:01:42 +0000 Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <6F3C2D5F-21BD-4B29-AD1A-C643212911A8@lists.zabbadoz.net> References: <201603140705.u2E75fWT043502@repo.freebsd.org> To: Wojciech Macek X-Mailer: Apple Mail (2.2104) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 15:02:01 -0000 > On 14 Mar 2016, at 07:05 , Wojciech Macek wrote: >=20 > Author: wma > Date: Mon Mar 14 07:05:41 2016 > New Revision: 296825 > URL: https://svnweb.freebsd.org/changeset/base/296825 >=20 > Log: > Make MPIC compatible with ARM_INTRNG >=20 > After ARM_INTRNG introduction, MPIC code needed several = modifications: > - IRQ resource and its handler added > - several DEVMETHODs of INTRNG interface implemented > - defines enhanced to ensure code compiles as well for AXP as for = A38X > - added dummy MSI_IRQ, ERR_IRQ defines for Armada38x > - MPIC driver was added to files.armada38x, ARM_INTRNG option enabled = in > kernconf file and regs of MPIC corrected in dts file. >=20 > Instead of modifying Armada38X DTS, offsets to CPU registers defined = in > driver were changed. That required restoring 'reg' property of mpic = node > in ArmadaXP to state compliant with Linux DTS. >=20 > Additionally, required ARM_INTRNG definitions were added to = mv_common.c. >=20 > Submitted by: Bartosz Szczepanek > Obtained from: Semihalf > Sponsored by: Stormshield > Reviewed by: adrian, andrew, ian, skra > Approved by: cognet (mentor) > Differential Revision: https://reviews.freebsd.org/D5030 >=20 > Modified: > head/sys/arm/conf/ARMADA38X > head/sys/arm/mv/armada38x/files.armada38x > head/sys/arm/mv/mpic.c > head/sys/arm/mv/mvreg.h > head/sys/boot/fdt/dts/arm/db78460.dts >=20 > Modified: head/sys/arm/mv/mpic.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/arm/mv/mpic.c Mon Mar 14 06:30:37 2016 = (r296824) > +++ head/sys/arm/mv/mpic.c Mon Mar 14 07:05:41 2016 = (r296825) >=20 > @@ -48,11 +54,16 @@ __FBSDID("$FreeBSD$"); > #include >=20 > #include > +#include This redefines at least IRQ_MASK now in this file and breaks the build. = Can you have a look and fix it? Thanks, /bz =E2=80=94=20 Bjoern A. Zeeb Charles Haddon Spurgeon: "Friendship is one of the sweetest joys of life. Many might have failed beneath the bitterness of their trial had they not found a friend." From owner-svn-src-head@freebsd.org Mon Mar 14 16:00:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAD72AD0C4F for ; Mon, 14 Mar 2016 16:00:46 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: from vfemail.net (onethreetwo.vfemail.net [199.16.11.132]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9BE20154A for ; Mon, 14 Mar 2016 16:00:45 +0000 (UTC) (envelope-from jbeich@freebsd.org) Received: (qmail 16967 invoked by uid 89); 14 Mar 2016 16:00:44 -0000 Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 14 Mar 2016 16:00:44 -0000 Received: (qmail 16950 invoked by uid 89); 14 Mar 2016 16:00:27 -0000 Received: by simscan 1.3.1 ppid: 16942, pid: 16946, t: 0.0043s scanners:none Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 14 Mar 2016 16:00:27 -0000 Received: (qmail 17314 invoked by uid 89); 14 Mar 2016 16:00:26 -0000 Received: by simscan 1.4.0 ppid: 17285, pid: 17311, t: 1.2348s scanners:none Received: from unknown (HELO nil) (amJlaWNoQHZmZW1haWwubmV0@172.16.100.27) by mail.vfemail.net with ESMTPA; 14 Mar 2016 16:00:25 -0000 From: Jan Beich To: Adrian Chadd Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296823 - in head: sbin/ifconfig sys/net80211 References: <201603140439.u2E4dZNO096916@repo.freebsd.org> Date: Mon, 14 Mar 2016 17:00:05 +0100 In-Reply-To: <201603140439.u2E4dZNO096916@repo.freebsd.org> (Adrian Chadd's message of "Mon, 14 Mar 2016 04:39:35 +0000 (UTC)") Message-ID: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:00:47 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Adrian Chadd writes: > Author: adrian > Date: Mon Mar 14 04:39:35 2016 > New Revision: 296823 > URL: https://svnweb.freebsd.org/changeset/base/296823 > > Log: > [net80211] handle unlisted information elements. >=20=20=20 > This displays the IE names in ifconfig but it doesn't yet decode things. >=20=20=20 > Submitted by: Idwer Vollering > Differential Revision: https://reviews.freebsd.org/D3782 [...] > Modified: head/sys/net80211/ieee80211.h [...] > +struct ieee80211_ap_chan_report_ie { > + uint8_t ie; > + uint8_t len; > + uint8_t class; /* operating class */ "class" is a reserved keyword in C++. www/firefox implements wifi geolocation in C++, so it's now broken. www/chromium is probably also affected. In file included from netwerk/wifi/Unified_cpp_netwerk_wifi0.cpp:20: In file included from netwerk/wifi/nsWifiScannerFreeBSD.cpp:19: In file included from /usr/include/net80211/ieee80211_ioctl.h:35: /usr/include/net80211/ieee80211.h:800:11: error: declaration of anonymous= class must be a definition uint8_t class; /* operating class */ ^ 1 error generated. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQF8BAEBCgBmBQJW5uAFXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXREQjQ0MzY3NEM3RDIzNTc4NkUxNDkyQ0VF NEM3Nzg4MzQ3OURCRERCAAoJEOTHeINHnb3bRAwIAJyZK+bu0wczkOc9ss868KyZ QpmH5m7aOwy9aYPi7iCeNkcyzV122fimv09JZdr7Fwo6/t+UnXyGsgwvry6QyN6w EPbFHj+toLBD3MoKIYDxhpcwAembkrcEnuyfvbZedTwT2nX+gLXSXlP6eFBeLmEE AiWOQyQ5ux6fAfbjftgSK6my6MtF7R2njDrwFyJgwVGUG/ZmsomgY9jYqmcwjYCD GSCnxJbNefbLVSDSaBHN9A3dNTD/w5bjeDtHvgg1LzronnFgzhmVfh91L5jhAFr5 b684Idj6dOji/GgcqfAhEyU1fuYdzG2HItdSfFciwxf56IA+af795fC5GKdt1Us= =9tN1 -----END PGP SIGNATURE----- --=-=-=-- From owner-svn-src-head@freebsd.org Mon Mar 14 16:19:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB3DDAD04A9; Mon, 14 Mar 2016 16:19:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 78B652BD; Mon, 14 Mar 2016 16:19:51 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EGJoNR041307; Mon, 14 Mar 2016 16:19:50 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EGJo0K041306; Mon, 14 Mar 2016 16:19:50 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603141619.u2EGJo0K041306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Mon, 14 Mar 2016 16:19:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296862 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:19:51 -0000 Author: bz Date: Mon Mar 14 16:19:50 2016 New Revision: 296862 URL: https://svnweb.freebsd.org/changeset/base/296862 Log: Fix the printf for PAE kernels where it'd be long long to unbreak the build. Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c Modified: head/sys/dev/drm2/i915/i915_gem_gtt.c ============================================================================== --- head/sys/dev/drm2/i915/i915_gem_gtt.c Mon Mar 14 14:55:15 2016 (r296861) +++ head/sys/dev/drm2/i915/i915_gem_gtt.c Mon Mar 14 16:19:50 2016 (r296862) @@ -565,9 +565,10 @@ void i915_gem_init_global_gtt(struct drm i915_ggtt_clear_range(dev, start / PAGE_SIZE, (end-start) / PAGE_SIZE); device_printf(dev->dev, - "taking over the fictitious range 0x%lx-0x%lx\n", - dev_priv->mm.gtt_base_addr + start, - dev_priv->mm.gtt_base_addr + start + dev_priv->mm.mappable_gtt_total); + "taking over the fictitious range 0x%jx-0x%jx\n", + (uintmax_t)(dev_priv->mm.gtt_base_addr + start), + (uintmax_t)(dev_priv->mm.gtt_base_addr + start + + dev_priv->mm.mappable_gtt_total)); vm_phys_fictitious_reg_range(dev_priv->mm.gtt_base_addr + start, dev_priv->mm.gtt_base_addr + start + dev_priv->mm.mappable_gtt_total, VM_MEMATTR_WRITE_COMBINING); From owner-svn-src-head@freebsd.org Mon Mar 14 16:27:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8ABA6AD0915; Mon, 14 Mar 2016 16:27:44 +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 5D03AC97; Mon, 14 Mar 2016 16:27:44 +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 u2EGRhlK044666; Mon, 14 Mar 2016 16:27:43 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EGRh4R044665; Mon, 14 Mar 2016 16:27:43 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603141627.u2EGRh4R044665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Mar 2016 16:27:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296863 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:27:44 -0000 Author: trasz Date: Mon Mar 14 16:27:43 2016 New Revision: 296863 URL: https://svnweb.freebsd.org/changeset/base/296863 Log: Add myself to MAINTAINERS. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/MAINTAINERS Modified: head/MAINTAINERS ============================================================================== --- head/MAINTAINERS Mon Mar 14 16:19:50 2016 (r296862) +++ head/MAINTAINERS Mon Mar 14 16:27:43 2016 (r296863) @@ -102,3 +102,6 @@ usr.sbin/dpv dteske Pre-commit review re usr.sbin/pkg pkg@ Please coordinate behavior or flag changes with pkg team. usr.sbin/sysrc dteske Pre-commit phabricator review requested. Keep in sync with bsdconfig(8) sysrc.subr. vmm(4) neel,grehan Pre-commit review requested. +autofs(5) trasz Pre-commit review recommended. +iscsi(4) trasz Pre-commit review recommended. +rctl(8) trasz Pre-commit review recommended. From owner-svn-src-head@freebsd.org Mon Mar 14 16:34:48 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B029DAD0BFA; Mon, 14 Mar 2016 16:34:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x22a.google.com (mail-ig0-x22a.google.com [IPv6:2607:f8b0:4001:c05::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 78F8F1E1; Mon, 14 Mar 2016 16:34:48 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x22a.google.com with SMTP id mh10so18618805igb.0; Mon, 14 Mar 2016 09:34:48 -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=0ucUHqdg5zM2A3okVGvBzLP6bzg4/SucCp0BX7XTH30=; b=kxpHZUND832frqR+8/+C1CWBIzgjD5AOq/ZkA9H6jnxaaEL30UP1z606N0Vew4LAvg 13AoswKxo1DXK1JUfB8a2b6x+LeBy+ZVxoOqWY+q4k5B9lpXHm4px2f5rJsVIwODbzYl es3bI/lPxi2imm+xzkZb052wUc1Fc+0tqNEv/3v0TTgb9FHhN0B13AQPiHcD/NiaE4Qc Yu00PtcMiZUwk8Ru0IuQwcK8HvEvypQUGQ94ri+crMxntYMnD+hvtn3YMw8xZEtufoPm mu3GkJtTkjBzOV03k4aLVS3eu2nPXhBb4taSgCqF6yzHAxysR0WJeQ96qnq4f2WaKeZO Yprw== 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=0ucUHqdg5zM2A3okVGvBzLP6bzg4/SucCp0BX7XTH30=; b=E41Ya+lYiWaWQsU91OdfaYgSqCaP8tyP+qw46V8CY/10sDL/4ZUJDkT6rHLfqLDT8i uv2bHh78kNNSvlGDM0lfQwBKZuejk04+FWY/XvCOQzbAVnUomYaaNhYLp5daaVmqg4bJ f74yShr8Oz+R1slbaSIB1LkAT0kn8chnkv7uRDKdr5fgjStDnCnVilEHQQnt39YjKR00 JnGzIPXPUV8nUX3Z0M+r3jF5Ck3xIbQMTGoPUS3aO88GlTndna40VgllMt90/ZR2owWy yAsNB5Ol/n2gGx4yI2cq81yaV9FEd7BOn5yAqtJZ4y4nSK8bZgCrjSuGlN+rIB7KjDqH NPsg== X-Gm-Message-State: AD7BkJIidqzadIft3l32vqNc6eUIyWYs8xn4LmmS7GvhXBvbFLcNmTLVnDvAmttYCPSFF96V12SNbbGPedqKjA== MIME-Version: 1.0 X-Received: by 10.50.67.180 with SMTP id o20mr14754527igt.37.1457973287946; Mon, 14 Mar 2016 09:34:47 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.36.14.19 with HTTP; Mon, 14 Mar 2016 09:34:47 -0700 (PDT) In-Reply-To: References: <201603140439.u2E4dZNO096916@repo.freebsd.org> Date: Mon, 14 Mar 2016 09:34:47 -0700 X-Google-Sender-Auth: 0Ilqj_43UMlJkmpijys9phglFEY Message-ID: Subject: Re: svn commit: r296823 - in head: sbin/ifconfig sys/net80211 From: Adrian Chadd To: Jan Beich 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:34:48 -0000 oops! I'll fix now Thanks! -a On 14 March 2016 at 09:00, Jan Beich wrote: > Adrian Chadd writes: > >> Author: adrian >> Date: Mon Mar 14 04:39:35 2016 >> New Revision: 296823 >> URL: https://svnweb.freebsd.org/changeset/base/296823 >> >> Log: >> [net80211] handle unlisted information elements. >> >> This displays the IE names in ifconfig but it doesn't yet decode things. >> >> Submitted by: Idwer Vollering >> Differential Revision: https://reviews.freebsd.org/D3782 > [...] >> Modified: head/sys/net80211/ieee80211.h > [...] >> +struct ieee80211_ap_chan_report_ie { >> + uint8_t ie; >> + uint8_t len; >> + uint8_t class; /* operating class */ > > "class" is a reserved keyword in C++. www/firefox implements wifi > geolocation in C++, so it's now broken. www/chromium is probably also > affected. > > In file included from netwerk/wifi/Unified_cpp_netwerk_wifi0.cpp:20: > In file included from netwerk/wifi/nsWifiScannerFreeBSD.cpp:19: > In file included from /usr/include/net80211/ieee80211_ioctl.h:35: > /usr/include/net80211/ieee80211.h:800:11: error: declaration of anonymous class must be a definition > uint8_t class; /* operating class */ > ^ > 1 error generated. From owner-svn-src-head@freebsd.org Mon Mar 14 16:52:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51657AD0239; Mon, 14 Mar 2016 16:52:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 23916FA1; Mon, 14 Mar 2016 16:52:07 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EGq6cc054026; Mon, 14 Mar 2016 16:52:06 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EGq6DM054025; Mon, 14 Mar 2016 16:52:06 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603141652.u2EGq6DM054025@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Mon, 14 Mar 2016 16:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296864 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 16:52:07 -0000 Author: adrian Date: Mon Mar 14 16:52:05 2016 New Revision: 296864 URL: https://svnweb.freebsd.org/changeset/base/296864 Log: class -> i_class. Thanks C++. Noticed by: jbeich@ Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Mon Mar 14 16:27:43 2016 (r296863) +++ head/sys/net80211/ieee80211.h Mon Mar 14 16:52:05 2016 (r296864) @@ -797,7 +797,7 @@ struct ieee80211_bss_load_ie { struct ieee80211_ap_chan_report_ie { uint8_t ie; uint8_t len; - uint8_t class; /* operating class */ + uint8_t i_class; /* operating class */ /* Annex E, E.1 Country information and operating classes */ uint8_t chan_list[0]; } __packed; From owner-svn-src-head@freebsd.org Mon Mar 14 17:41:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 07DF2ACF74D; Mon, 14 Mar 2016 17:41:20 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id BDD1E1D48; Mon, 14 Mar 2016 17:41:19 +0000 (UTC) (envelope-from rstone@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EHfIki069428; Mon, 14 Mar 2016 17:41:18 GMT (envelope-from rstone@FreeBSD.org) Received: (from rstone@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EHfHHU069418; Mon, 14 Mar 2016 17:41:17 GMT (envelope-from rstone@FreeBSD.org) Message-Id: <201603141741.u2EHfHHU069418@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rstone set sender to rstone@FreeBSD.org using -f From: Ryan Stone Date: Mon, 14 Mar 2016 17:41:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296865 - in head: sys/dev/pci sys/sys usr.sbin/iovctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 17:41:20 -0000 Author: rstone Date: Mon Mar 14 17:41:17 2016 New Revision: 296865 URL: https://svnweb.freebsd.org/changeset/base/296865 Log: Clean up repeated "All rights reserved" Modified: head/sys/dev/pci/pci_iov.c head/sys/dev/pci/pci_iov_private.h head/sys/dev/pci/pci_iov_schema.c head/sys/dev/pci/schema_private.h head/sys/sys/iov.h head/sys/sys/iov_schema.h head/usr.sbin/iovctl/iovctl.c head/usr.sbin/iovctl/iovctl.h head/usr.sbin/iovctl/parse.c head/usr.sbin/iovctl/validate.c Modified: head/sys/dev/pci/pci_iov.c ============================================================================== --- head/sys/dev/pci/pci_iov.c Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/dev/pci/pci_iov.c Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2013-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pci/pci_iov_private.h ============================================================================== --- head/sys/dev/pci/pci_iov_private.h Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/dev/pci/pci_iov_private.h Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2013-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pci/pci_iov_schema.c ============================================================================== --- head/sys/dev/pci/pci_iov_schema.c Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/dev/pci/pci_iov_schema.c Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2014-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/dev/pci/schema_private.h ============================================================================== --- head/sys/dev/pci/schema_private.h Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/dev/pci/schema_private.h Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014 Sandvine Inc. All rights reserved. + * Copyright (c) 2014 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/sys/iov.h ============================================================================== --- head/sys/sys/iov.h Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/sys/iov.h Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2013-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/sys/sys/iov_schema.h ============================================================================== --- head/sys/sys/iov_schema.h Mon Mar 14 16:52:05 2016 (r296864) +++ head/sys/sys/iov_schema.h Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2014-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/iovctl/iovctl.c ============================================================================== --- head/usr.sbin/iovctl/iovctl.c Mon Mar 14 16:52:05 2016 (r296864) +++ head/usr.sbin/iovctl/iovctl.c Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2013-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/iovctl/iovctl.h ============================================================================== --- head/usr.sbin/iovctl/iovctl.h Mon Mar 14 16:52:05 2016 (r296864) +++ head/usr.sbin/iovctl/iovctl.h Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2013-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2013-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/iovctl/parse.c ============================================================================== --- head/usr.sbin/iovctl/parse.c Mon Mar 14 16:52:05 2016 (r296864) +++ head/usr.sbin/iovctl/parse.c Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2014-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without Modified: head/usr.sbin/iovctl/validate.c ============================================================================== --- head/usr.sbin/iovctl/validate.c Mon Mar 14 16:52:05 2016 (r296864) +++ head/usr.sbin/iovctl/validate.c Mon Mar 14 17:41:17 2016 (r296865) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2014-2015 Sandvine Inc. All rights reserved. + * Copyright (c) 2014-2015 Sandvine Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without From owner-svn-src-head@freebsd.org Mon Mar 14 17:45:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C099FACF8EC; Mon, 14 Mar 2016 17:45: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 8C44E175; Mon, 14 Mar 2016 17:45: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 u2EHjdbK069620; Mon, 14 Mar 2016 17:45:39 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EHjd2B069619; Mon, 14 Mar 2016 17:45:39 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603141745.u2EHjd2B069619@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Mar 2016 17:45:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296866 - head/etc/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 17:45:40 -0000 Author: trasz Date: Mon Mar 14 17:45:39 2016 New Revision: 296866 URL: https://svnweb.freebsd.org/changeset/base/296866 Log: Fix autofs handling of filesystem labels containing plus signs and slashes. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/autofs/special_media Modified: head/etc/autofs/special_media ============================================================================== --- head/etc/autofs/special_media Mon Mar 14 17:41:17 2016 (r296865) +++ head/etc/autofs/special_media Mon Mar 14 17:45:39 2016 (r296866) @@ -19,6 +19,9 @@ print_available() { _fstype="${_fstype_and_label%% *}" if [ "${_fstype}" != "${_fstype_and_label}" ]; then _label="${_fstype_and_label#* }" + # Replace plus signs and slashes with minuses; + # leading plus signs have special meaning in maps, + _label="$(echo ${_label} | sed 's,[+/],-,g')" echo "${_label}" continue fi @@ -54,6 +57,10 @@ print_one() { fi _label="${_fstype_and_label#* }" + # Replace plus signs and slashes with minuses; + # leading plus signs have special meaning in maps, + # and multi-component keys are just not supported. + _label="$(echo ${_label} | sed 's,[+/],-,g')" if [ "${_label}" != "${_key}" ]; then # Labels don't match, try another device. continue From owner-svn-src-head@freebsd.org Mon Mar 14 18:07:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3A35AD002C; Mon, 14 Mar 2016 18:07:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 92696EF4; Mon, 14 Mar 2016 18:07:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EI6x89075528; Mon, 14 Mar 2016 18:06:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EI6xhp075527; Mon, 14 Mar 2016 18:06:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603141806.u2EI6xhp075527@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 14 Mar 2016 18:06:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296867 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 18:07:00 -0000 Author: glebius Date: Mon Mar 14 18:06:59 2016 New Revision: 296867 URL: https://svnweb.freebsd.org/changeset/base/296867 Log: Comment fix: statistics are not read-only. Modified: head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Mon Mar 14 17:45:39 2016 (r296866) +++ head/sys/netinet/tcp_var.h Mon Mar 14 18:06:59 2016 (r296867) @@ -666,7 +666,7 @@ struct xtcpcb { */ #define TCPCTL_DO_RFC1323 1 /* use RFC-1323 extensions */ #define TCPCTL_MSSDFLT 3 /* MSS default */ -#define TCPCTL_STATS 4 /* statistics (read-only) */ +#define TCPCTL_STATS 4 /* statistics */ #define TCPCTL_RTTDFLT 5 /* default RTT estimate */ #define TCPCTL_KEEPIDLE 6 /* keepalive idle timer */ #define TCPCTL_KEEPINTVL 7 /* interval to send keepalives */ From owner-svn-src-head@freebsd.org Mon Mar 14 18:08:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B9B2AD0118; Mon, 14 Mar 2016 18:08:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF7A1176; Mon, 14 Mar 2016 18:08:00 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EI7x7r075603; Mon, 14 Mar 2016 18:07:59 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EI7xqm075602; Mon, 14 Mar 2016 18:07:59 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603141807.u2EI7xqm075602@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 14 Mar 2016 18:07:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296868 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 18:08:00 -0000 Author: glebius Date: Mon Mar 14 18:07:59 2016 New Revision: 296868 URL: https://svnweb.freebsd.org/changeset/base/296868 Log: Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Mar 14 18:06:59 2016 (r296867) +++ head/sys/sys/sysctl.h Mon Mar 14 18:07:59 2016 (r296868) @@ -640,12 +640,11 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e #define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ - counter_u64_t *__ptr = (ptr); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ - __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ + ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ }) /* Oid for an opaque object. Specified by a pointer and a length. */ From owner-svn-src-head@freebsd.org Mon Mar 14 18:31:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A3FBAD0DED; Mon, 14 Mar 2016 18:31:38 +0000 (UTC) (envelope-from rysto32@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 37A63310; Mon, 14 Mar 2016 18:31:38 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: by mail-ig0-x235.google.com with SMTP id nk17so46661738igb.1; Mon, 14 Mar 2016 11:31:38 -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=d56D9s71xtHgSFJVUh1Q0IBiiGXSZAj9E7lY6BqSTJU=; b=ETJDSRq3PrlY/Jdphg3m4TQEcvkAGVD6CnnEqNsIKy4gcOH92Z87Ch+wyV7YMB4pt6 Ac8yvgAwcPUQHUK4OHx8R7aIfeSrHRWDLJsjwAPZdyG7GbhgE9TxXcwHzel2CZwje4h7 WxKbslXVBSSVeSNgD10Z340djIfv/6KHdOS4erx5OOnRO7E6Qj5a7Hd57eF0CCWqGpiQ ytPW2qNoxS9Uk6i3t5l1/PMcrA/Ea9yUZf7/wfp8TUXT2zlI+cW24pQYvK1AQ5+8HCYH RAnOTMhEcrwGzDCRQInKORnWg/k+gQl0A9CQXK3nOjnVKenpfDFMGsh1Zq88KrqoK9sh XFDQ== 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=d56D9s71xtHgSFJVUh1Q0IBiiGXSZAj9E7lY6BqSTJU=; b=NGwcS7QjjonXA3WYYGNPuEhQ328n9ZkYjuW6+PWNIDHJg6zJ6Eq0U384UHxKtMJKiT p+vhmQ4HAso4ptMfwBAc+2mllb0XJF+bl7sr8xkNoax/1ZlYOikfWskfEtpWF1sAR/1O ragBQi1rea7l+Pgw/qpiJQt0aZTMwCGEXnPyg53DIpfuKJrSFuMpgTPkXuKstxtNxkMn P8SrHVDgJB0sXVqSBtk8OmrIYx3nfIPVbQpJi4/NcvcYmBQOqdj2uFkUZuIZAzoI6svO 30DG60eIbhyp/yg8Ts1FDkYSA9ooLQS/2v2Q0OLfoGx8NwSarK6whY0xyVaZjZt97m5t +ykg== X-Gm-Message-State: AD7BkJIb2kyssDZJeneaf3MgtPFzLRYyjV+4uU4cunC2cjpPMEow/JSANpMaKRS3zN/1WNtSalYPp6Ig0uX16g== MIME-Version: 1.0 X-Received: by 10.50.138.5 with SMTP id qm5mr19458390igb.69.1457980297474; Mon, 14 Mar 2016 11:31:37 -0700 (PDT) Received: by 10.107.6.32 with HTTP; Mon, 14 Mar 2016 11:31:37 -0700 (PDT) In-Reply-To: <201603141807.u2EI7xqm075602@repo.freebsd.org> References: <201603141807.u2EI7xqm075602@repo.freebsd.org> Date: Mon, 14 Mar 2016 14:31:37 -0400 Message-ID: Subject: Re: svn commit: r296868 - head/sys/sys From: Ryan Stone 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-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 18:31:38 -0000 On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff wrote: > Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. > Is it useless? I believe that the point is to give a compiler error if an incompatible pointer type was passed as the ptr parameter. From owner-svn-src-head@freebsd.org Mon Mar 14 18:57:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BC54FAD169F; Mon, 14 Mar 2016 18:57:10 +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 8FF86698; Mon, 14 Mar 2016 18:57:10 +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 u2EIv99M090639; Mon, 14 Mar 2016 18:57:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EIv9e9090638; Mon, 14 Mar 2016 18:57:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603141857.u2EIv9e9090638@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Mon, 14 Mar 2016 18:57:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296870 - head/etc/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 18:57:10 -0000 Author: trasz Date: Mon Mar 14 18:57:09 2016 New Revision: 296870 URL: https://svnweb.freebsd.org/changeset/base/296870 Log: Restore accidentaly removed comment line. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/autofs/special_media Modified: head/etc/autofs/special_media ============================================================================== --- head/etc/autofs/special_media Mon Mar 14 18:54:29 2016 (r296869) +++ head/etc/autofs/special_media Mon Mar 14 18:57:09 2016 (r296870) @@ -21,6 +21,7 @@ print_available() { _label="${_fstype_and_label#* }" # Replace plus signs and slashes with minuses; # leading plus signs have special meaning in maps, + # and multi-component keys are just not supported. _label="$(echo ${_label} | sed 's,[+/],-,g')" echo "${_label}" continue From owner-svn-src-head@freebsd.org Mon Mar 14 20:33:20 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68082AD0A85; Mon, 14 Mar 2016 20:33:20 +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 52A063DA; Mon, 14 Mar 2016 20:33:20 +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 u2EKXI6l062338 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 14 Mar 2016 13:33:18 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2EKXIKE062337; Mon, 14 Mar 2016 13:33:18 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 14 Mar 2016 13:33:18 -0700 From: Gleb Smirnoff To: Ryan Stone Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296868 - head/sys/sys Message-ID: <20160314203318.GL1328@FreeBSD.org> References: <201603141807.u2EI7xqm075602@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 20:33:20 -0000 On Mon, Mar 14, 2016 at 02:31:37PM -0400, Ryan Stone wrote: R> On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff wrote: R> R> > Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. R> > R> R> Is it useless? I believe that the point is to give a compiler error if an R> incompatible pointer type was passed as the ptr parameter. Thanks for explanation! I will back out. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Mon Mar 14 20:34:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D313AD0B1F; Mon, 14 Mar 2016 20:34:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6BFFD81D; Mon, 14 Mar 2016 20:34:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EKYUG9021057; Mon, 14 Mar 2016 20:34:30 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EKYUHX021056; Mon, 14 Mar 2016 20:34:30 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603142034.u2EKYUHX021056@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Mon, 14 Mar 2016 20:34:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296871 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 20:34:31 -0000 Author: glebius Date: Mon Mar 14 20:34:30 2016 New Revision: 296871 URL: https://svnweb.freebsd.org/changeset/base/296871 Log: Revert r296868. The cast is useful to protect against passing incorrect argument type to the macro. Submitted by: rstone Modified: head/sys/sys/sysctl.h Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Mar 14 18:57:09 2016 (r296870) +++ head/sys/sys/sysctl.h Mon Mar 14 20:34:30 2016 (r296871) @@ -640,11 +640,12 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e #define SYSCTL_ADD_COUNTER_U64(ctx, parent, nbr, name, access, ptr, descr) \ ({ \ + counter_u64_t *__ptr = (ptr); \ CTASSERT(((access) & CTLTYPE) == 0 || \ ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_U64); \ sysctl_add_oid(ctx, parent, nbr, name, \ CTLTYPE_U64 | CTLFLAG_MPSAFE | (access), \ - ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ + __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ }) /* Oid for an opaque object. Specified by a pointer and a length. */ From owner-svn-src-head@freebsd.org Mon Mar 14 20:38:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06427AD0C30; Mon, 14 Mar 2016 20:38:34 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5CF4A63; Mon, 14 Mar 2016 20:38:33 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io0-x22d.google.com with SMTP id m184so237734456iof.1; Mon, 14 Mar 2016 13:38:33 -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=iRhCQrPiXGn4x5oZM0/d5oMf4UV/QCWrHRoK3ZsQ3HE=; b=dLFVThazcHmf1x5HWezdpBC2cLx+AWpSVOFwPvro2R284ix+vpDrAsGgZYwGJGqpdX 8GMcg4mIaab9lZxUXZusi8jDZa/6H/jXv8OUWQdXJ1Ce9UT7YowLfpC84GiuerHfU/G+ UDlsIHuSoIQ2PliLEDMDlbpG7uxF3ab7bNwwaI3ipd5RxTQZWCuRwovOSh1cN7u4w5gf Qejnz+fRHyOmwsOPb1HpV1G5UDswWjKuAIBkAJ7+cVUAUwH2cSmPQCxVC0nbXI8i+9+0 aps1LMryiz25rueGJUme2WDr2nAgZu2Nu+wlKLYhtMJ8emsRJXwCPPhM7tnQrjmEIiH2 FGqA== 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=iRhCQrPiXGn4x5oZM0/d5oMf4UV/QCWrHRoK3ZsQ3HE=; b=ScDWtYv0gbRn/MUTUndd9j5xvEIYx9XzjCp88Crwm5XYxnp7Ku05q/NAmqivY9ZWA2 8UyKZw/AFMD3v3YGIKEEKYm3hQ4TQ8tgzVjAqOV4sfKDSv0+05iKHllaRNpJ5y8AbavG whzlaH0Y2h7EzaqdJ3Y+Az9H0wf1WrBa0MfhmHUNZI2gUQPGN8oIcMW70b9Ph7f/edPM fOcjYXSCmm87n4u8rmbGA+PfL3CZyBCnw+uES4yhqjKUsKDLhii5C9cw2I98V61qw63O KrBZbFP5zFfomR+wVLrgsMZerk+d184HDbbqe+u7XcedsxHZpENThIZiyGUQpdi7nyox m+AQ== X-Gm-Message-State: AD7BkJK/JZQ+MkAGu25ZK3/5vaZdyES/bWrr+F6ZMm62Wslhk0ATmCMbr75ViOhwjBgpmRrX1n8VEjjKbnYjKQ== X-Received: by 10.107.157.70 with SMTP id g67mr23946141ioe.38.1457987912966; Mon, 14 Mar 2016 13:38:32 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Mon, 14 Mar 2016 13:38:13 -0700 (PDT) In-Reply-To: <201603142034.u2EKYUHX021056@repo.freebsd.org> References: <201603142034.u2EKYUHX021056@repo.freebsd.org> From: Ed Maste Date: Mon, 14 Mar 2016 16:38:13 -0400 X-Google-Sender-Auth: YkqIW5aF9-vvEmr8ZjCZh9g4C9c Message-ID: Subject: Re: svn commit: r296871 - head/sys/sys 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 20:38:34 -0000 On 14 March 2016 at 16:34, Gleb Smirnoff wrote: > Author: glebius > Date: Mon Mar 14 20:34:30 2016 > New Revision: 296871 > URL: https://svnweb.freebsd.org/changeset/base/296871 > > Log: > Revert r296868. The cast is useful to protect against passing incorrect > argument type to the macro. > > Submitted by: rstone It seems like this ought to have a comment so someone doesn't apply the same cleanup in the future :) From owner-svn-src-head@freebsd.org Mon Mar 14 20:47:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 030C9AD0F32; Mon, 14 Mar 2016 20:47:59 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::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 C36FEE9B; Mon, 14 Mar 2016 20:47:58 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-ig0-x22f.google.com with SMTP id mh10so24220076igb.0; Mon, 14 Mar 2016 13:47:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=iEF3gqaOw+b6Ioic+2Gmvm2GbzdJv0lRnqqFI2Gv+3U=; b=XVIUpcFiQVA6yMxpUsatB3cRgXRxF2YH1nDfqiSaXhlTVWxiGt8y3TcZC6O26zuqJw J1Hq2gC50gaQiXxdhD717lkq20ZhFp5xY+RMMoGxNRc6y76AwpZLlEgOfdHwWTNyIY80 a4m8JBg/K4WEK0YvW74NdOI3Qa6hON+mstblqVwQaX9f6aYYvhCp+vtADzdg8Dj2clBy CriZDtIqjJc8tQcJb4XgrxiNmjVadgcYrW1IB4aR5ZHJ4gpC82CeP08meUCXrAw6fG4u j0BMYOpS3sIvtyFDZwQ1yU0d97LrUGVjcga56VHEgYRTpWE8lZ1tZbeVKrGwKct0I3sk Cavg== 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=iEF3gqaOw+b6Ioic+2Gmvm2GbzdJv0lRnqqFI2Gv+3U=; b=jDyMM0XxOJ0rWgcrm/pTZLGNIu1fFG3RNihRne2iQ/GAuUeO6rv4gu0D3Z5HlsfTcB mQmVPgeONJmc9bCOpc70BYs8YhRFm0VxDi2ibJjbdPlqsGfggtAGUNYRo/tnJQcfLvVO 0FGgpfRs5V1lK5IMg8MjNNNBqH/ZnB3Nu6LaAUwlBZel8uPcUM5IQq5UW+2mzhdE5w+x 1tWANPYZMBPSFu1VUQ9rV6+yT0T9WPs4KpIQ8M8ZXgMTJfHMtBLEXDGqboe1U54mc6bE 0aSr21Wa2idlNNDnTLb9eyYrQGEf85FBNQPsSt/ddaATUErmC1L4/mjy4R7+ont2f1tx 4olQ== X-Gm-Message-State: AD7BkJK055Q+t2OaazMkjYl4KdkinNNcCQNuayTAg9j8s6WOzcXQrRLl7S7AQwTvRMaDymB0vkgIKbpurhQrYA== X-Received: by 10.50.2.35 with SMTP id 3mr18912985igr.33.1457988477611; Mon, 14 Mar 2016 13:47:57 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.39.66 with HTTP; Mon, 14 Mar 2016 13:47:37 -0700 (PDT) In-Reply-To: <201603131453.u2DErC3q041251@repo.freebsd.org> References: <201603131453.u2DErC3q041251@repo.freebsd.org> From: Ed Maste Date: Mon, 14 Mar 2016 16:47:37 -0400 X-Google-Sender-Auth: TXdIWX4a8gXquAVm93lOormfSZc Message-ID: Subject: Re: svn commit: r296799 - head/usr.bin/grep/regex To: Ian Lepore 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 20:47:59 -0000 On 13 March 2016 at 10:53, Ian Lepore wrote: > Author: ian > Date: Sun Mar 13 14:53:12 2016 > New Revision: 296799 > URL: https://svnweb.freebsd.org/changeset/base/296799 > > Log: > Fix a bug in bsdgrep that caused the program to hang in a tight loop for > some combinations of command line options and search patterns. Thanks for this! I found a PR for bsdgrep (172677) that claims buildworld WITHOUT_GNU_GREP_COMPAT and WITH_BSDGREP fails but I haven't looked into it further. There are also quite a few bsdgrep PRs open if someone wants to take a look. From owner-svn-src-head@freebsd.org Mon Mar 14 21:34:21 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5270BAD1E96 for ; Mon, 14 Mar 2016 21:34:21 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 261BE630 for ; Mon, 14 Mar 2016 21:34:20 +0000 (UTC) (envelope-from bms@fastmail.net) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BF2C222B59 for ; Mon, 14 Mar 2016 17:34:19 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Mon, 14 Mar 2016 17:34:19 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=vpmywNMRGj+XyMMv4MP02dmeJTI=; b=mFnSy7 PClZ0uC7OrU6rkJrAf8PYlvNhBpjOFsMnMuPO1AZP09BH72q28YE1M1E+baIAb+H TG5f7uM1hNQG94sScFuD7pMw4ClDa1xV1WxGcnvkZMS4ut0E0dc4AGmpREb0p3o7 lE7rofIa7XqDcuwMkFDC4sJ8liAZomldWzBIM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=vpmywNMRGj+XyMM v4MP02dmeJTI=; b=ijSKonOdFcnQWOXJX54Hh5uvbCPkIbWNU+qUEMzO9fNQNMC FVPd1qphFnQowmLr8tiLqcjBVb3smZcat2w6j9JTGUGuqyyQnwe+Yf29u73kAI3o +SnhU+jij8fc1HYV2k8O0MjMhtBZHz7cTXq37+pYQrfM/Kb5001d0Gf7HGPQ= X-Sasl-enc: lVkS8P2AiwpQ1Hyk6hJJou5zIYSSyyJ6K6GUpKKOuaak 1457991259 Received: from pion.local (cpc95050-newt40-2-0-cust433.19-3.cable.virginm.net [94.175.27.178]) by mail.messagingengine.com (Postfix) with ESMTPA id 15617C00013; Mon, 14 Mar 2016 17:34:18 -0400 (EDT) Subject: Re: svn commit: r296826 - in head/sys/arm: conf mv To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603140714.u2E7EZbe046600@repo.freebsd.org> From: Bruce Simpson Message-ID: <56E72E5A.2060006@fastmail.net> Date: Mon, 14 Mar 2016 21:34:18 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <201603140714.u2E7EZbe046600@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 21:34:21 -0000 On 14/03/16 07:14, Wojciech Macek wrote: > Log: > Add support for USB3.0 on Armada38x Very cool. Do you know if any Armada (or other embedded) XHCI implementations like this support XHCI Debug Port 1.0 ? From owner-svn-src-head@freebsd.org Mon Mar 14 22:20:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8058FAD10EC; Mon, 14 Mar 2016 22:20:23 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4D92E662; Mon, 14 Mar 2016 22:20:23 +0000 (UTC) (envelope-from lidl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2EMKMVw052834; Mon, 14 Mar 2016 22:20:22 GMT (envelope-from lidl@FreeBSD.org) Received: (from lidl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2EMKMMW052833; Mon, 14 Mar 2016 22:20:22 GMT (envelope-from lidl@FreeBSD.org) Message-Id: <201603142220.u2EMKMMW052833@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: lidl set sender to lidl@FreeBSD.org using -f From: Kurt Lidl Date: Mon, 14 Mar 2016 22:20:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296873 - head/usr.bin/finger X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 14 Mar 2016 22:20:23 -0000 Author: lidl Date: Mon Mar 14 22:20:22 2016 New Revision: 296873 URL: https://svnweb.freebsd.org/changeset/base/296873 Log: Do not truncate office phones in finger's summary listing When finger is invoked as as "finger username", it produces the long listing by default, and phones numbers are pretty-printed by the prphone() function. When invoked as just "finger", the same pretty-printing happens, but is truncated at 9 characters. Given the summary listing is already greater than 80 columns, making it even wider is of no harm. Approved by: rpaulo (mentor) Differential Revision: https://reviews.freebsd.org/D5638 Modified: head/usr.bin/finger/sprint.c Modified: head/usr.bin/finger/sprint.c ============================================================================== --- head/usr.bin/finger/sprint.c Mon Mar 14 21:00:16 2016 (r296872) +++ head/usr.bin/finger/sprint.c Mon Mar 14 22:20:22 2016 (r296873) @@ -149,7 +149,7 @@ office: else if (pn->officephone) (void)printf(" %-7.7s", " "); if (pn->officephone) - (void)printf(" %-.9s", + (void)printf(" %-.15s", prphone(pn->officephone)); } else (void)printf(" %.*s", MAXHOSTNAME, w->host); From owner-svn-src-head@freebsd.org Tue Mar 15 00:05:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B0FAAD1078; Tue, 15 Mar 2016 00:05:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 38C0CF3B; Tue, 15 Mar 2016 00:05:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2F051NU086393; Tue, 15 Mar 2016 00:05:01 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F050ps086390; Tue, 15 Mar 2016 00:05:00 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603150005.u2F050ps086390@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Mar 2016 00:05:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296880 - in head: share/man/man9 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:05:02 -0000 Author: glebius Date: Tue Mar 15 00:05:00 2016 New Revision: 296880 URL: https://svnweb.freebsd.org/changeset/base/296880 Log: Provide sysctl(9) macro to deal with array of counter(9). Modified: head/share/man/man9/counter.9 head/sys/kern/subr_counter.c head/sys/sys/sysctl.h Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Mon Mar 14 23:49:16 2016 (r296879) +++ head/share/man/man9/counter.9 Tue Mar 15 00:05:00 2016 (r296880) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 7, 2014 +.Dd March 14, 2016 .Dt COUNTER 9 .Os .Sh NAME @@ -54,6 +54,8 @@ .In sys/sysctl.h .Fn SYSCTL_COUNTER_U64 parent nbr name access ptr descr .Fn SYSCTL_ADD_COUNTER_U64 ctx parent nbr name access ptr descr +.Fn SYSCTL_COUNTER_U64_ARRAY parent nbr name access ptr len descr +.Fn SYSCTL_ADD_COUNTER_U64_ARRAY ctx parent nbr name access ptr len descr .Sh DESCRIPTION .Nm is a generic facility to create counters @@ -150,6 +152,40 @@ argument should be a pointer to allocate A read of the oid returns value obtained through .Fn counter_u64_fetch . Any write to the oid zeroes it. +.It Fn SYSCTL_COUNTER_U64_ARRAY parent nbr name access ptr len descr +Declare a static +.Xr sysctl +oid that would represent an array of +.Nm . +The +.Fa ptr +argument should be a pointer to allocated array of +.Vt counter_u64_t's . +The +.Fa len +argument should specify number of elements in the array. +A read of the oid returns len-sized array of +.Vt uint64_t +values obtained through +.Fn counter_u64_fetch . +Any write to the oid zeroes all array elements. +.It Fn SYSCTL_ADD_COUNTER_U64_ARRAY ctx parent nbr name access ptr len descr +Create a +.Xr sysctl +oid that would represent an array of +.Nm . +The +.Fa ptr +argument should be a pointer to allocated array of +.Vt counter_u64_t's . +The +.Fa len +argument should specify number of elements in the array. +A read of the oid returns len-sized array of +.Vt uint64_t +values obtained through +.Fn counter_u64_fetch . +Any write to the oid zeroes all array elements. .El .Sh IMPLEMENTATION DETAILS On all architectures Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Mon Mar 14 23:49:16 2016 (r296879) +++ head/sys/kern/subr_counter.c Tue Mar 15 00:05:00 2016 (r296880) @@ -94,3 +94,27 @@ sysctl_handle_counter_u64(SYSCTL_HANDLER return (0); } + +int +sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS) +{ + uint64_t *out; + int error; + + out = malloc(arg2 * sizeof(uint64_t), M_TEMP, M_WAITOK); + for (int i = 0; i < arg2; i++) + out[i] = counter_u64_fetch(((counter_u64_t *)arg1)[i]); + + error = SYSCTL_OUT(req, out, arg2 * sizeof(uint64_t)); + + if (error || !req->newptr) + return (error); + + /* + * Any write attempt to a counter zeroes it. + */ + for (int i = 0; i < arg2; i++) + counter_u64_zero(((counter_u64_t *)arg1)[i]); + + return (0); +} Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Mon Mar 14 23:49:16 2016 (r296879) +++ head/sys/sys/sysctl.h Tue Mar 15 00:05:00 2016 (r296880) @@ -204,6 +204,7 @@ int sysctl_handle_long(SYSCTL_HANDLER_AR int sysctl_handle_string(SYSCTL_HANDLER_ARGS); int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); +int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS); int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); @@ -648,6 +649,26 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ }) +/* Oid for an array of counter(9)s. The pointer and length must be non zero. */ +#define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \ + SYSCTL_OID(parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ + (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) + +#define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \ + ptr, len, descr) \ +({ \ + counter_u64_t *__ptr = (ptr); \ + CTASSERT(((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ + sysctl_add_oid(ctx, parent, nbr, name, \ + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ + __ptr, len, sysctl_handle_counter_u64_array, "S", \ + __DESCR(descr)); \ +}) + /* Oid for an opaque object. Specified by a pointer and a length. */ #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ From owner-svn-src-head@freebsd.org Tue Mar 15 00:15:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B468AD1328; Tue, 15 Mar 2016 00:15:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 330E31383; Tue, 15 Mar 2016 00:15:12 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2F0FBio089440; Tue, 15 Mar 2016 00:15:11 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F0FATD089432; Tue, 15 Mar 2016 00:15:10 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603150015.u2F0FATD089432@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Mar 2016 00:15:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:15:12 -0000 Author: glebius Date: Tue Mar 15 00:15:10 2016 New Revision: 296881 URL: https://svnweb.freebsd.org/changeset/base/296881 Log: Redo r294869. The array of counters for TCP states doesn't belong to struct tcpstat, because the structure can be zeroed out by netstat(1) -z, and of course running connection counts shouldn't be touched. Place running connection counts into separate array, and provide separate read-only sysctl oid for it. Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c head/sys/netinet/tcp_input.c head/sys/netinet/tcp_subr.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timewait.c head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h Modified: head/contrib/bsnmp/snmp_mibII/mibII_tcp.c ============================================================================== --- head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/contrib/bsnmp/snmp_mibII/mibII_tcp.c Tue Mar 15 00:15:10 2016 (r296881) @@ -47,6 +47,7 @@ struct tcp_index { static uint64_t tcp_tick; static uint64_t tcp_stats_tick; static struct tcpstat tcpstat; +static uint64_t tcps_states[TCP_NSTATES]; static struct xinpgen *xinpgen; static size_t xinpgen_len; static u_int tcp_total; @@ -78,6 +79,17 @@ fetch_tcp_stats(void) return (-1); } + len = sizeof(tcps_states); + if (sysctlbyname("net.inet.tcp.states", &tcps_states, &len, NULL, + 0) == -1) { + syslog(LOG_ERR, "net.inet.tcp.states: %m"); + return (-1); + } + if (len != sizeof(tcps_states)) { + syslog(LOG_ERR, "net.inet.tcp.states: wrong size"); + return (-1); + } + tcp_stats_tick = get_ticks(); return (0); @@ -231,8 +243,8 @@ op_tcp(struct snmp_context *ctx __unused break; case LEAF_tcpCurrEstab: - value->v.uint32 = tcpstat.tcps_states[TCPS_ESTABLISHED] + - tcpstat.tcps_states[TCPS_CLOSE_WAIT]; + value->v.uint32 = tcps_states[TCPS_ESTABLISHED] + + tcps_states[TCPS_CLOSE_WAIT]; break; case LEAF_tcpInSegs: Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_input.c Tue Mar 15 00:15:10 2016 (r296881) @@ -235,16 +235,39 @@ VNET_DEFINE(struct inpcbhead, tcb); VNET_DEFINE(struct inpcbinfo, tcbinfo); /* - * TCP statistics are stored in an "array" of counter(9)s. + * TCP statistics are stored in an array of counter(9)s, which size matches + * size of struct tcpstat. TCP running connection count is a regular array. */ VNET_PCPUSTAT_DEFINE(struct tcpstat, tcpstat); -VNET_PCPUSTAT_SYSINIT(tcpstat); SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat, tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); +VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]); +SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD | + CTLFLAG_VNET, &VNET_NAME(tcps_states), TCP_NSTATES, + "TCP connection counts by TCP state"); + +static void +tcp_vnet_init(const void *unused) +{ + + COUNTER_ARRAY_ALLOC(VNET(tcps_states), TCP_NSTATES, M_WAITOK); + VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); +} +VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + tcp_vnet_init, NULL); #ifdef VIMAGE -VNET_PCPUSTAT_SYSUNINIT(tcpstat); +static void +tcp_vnet_uninit(const void *unused) +{ + + COUNTER_ARRAY_FREE(VNET(tcps_states), TCP_NSTATES); + VNET_PCPUSTAT_FREE(tcpstat); +} +VNET_SYSUNINIT(tcp_vnet_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, + tcp_vnet_uninit, NULL); #endif /* VIMAGE */ + /* * Kernel module interface for updating tcpstat. The argument is an index * into tcpstat treated as an array. Modified: head/sys/netinet/tcp_subr.c ============================================================================== --- head/sys/netinet/tcp_subr.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_subr.c Tue Mar 15 00:15:10 2016 (r296881) @@ -1542,7 +1542,7 @@ tcp_close(struct tcpcb *tp) #endif in_pcbdrop(inp); TCPSTAT_INC(tcps_closed); - TCPSTAT_DEC(tcps_states[tp->t_state]); + TCPSTATES_DEC(tp->t_state); KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); so = inp->inp_socket; soisdisconnected(so); @@ -1665,7 +1665,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) */ if (req->oldptr == NULL) { n = V_tcbinfo.ipi_count + - TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]); + counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); n += imax(n / 8, 10); req->oldidx = 2 * (sizeof xig) + n * sizeof(struct xtcpcb); return (0); @@ -1682,7 +1682,7 @@ tcp_pcblist(SYSCTL_HANDLER_ARGS) n = V_tcbinfo.ipi_count; INP_LIST_RUNLOCK(&V_tcbinfo); - m = TCPSTAT_FETCH(tcps_states[TCPS_SYN_RECEIVED]); + m = counter_u64_fetch(VNET(tcps_states)[TCPS_SYN_RECEIVED]); error = sysctl_wire_old_buffer(req, 2 * (sizeof xig) + (n + m) * sizeof(struct xtcpcb)); @@ -2986,8 +2986,8 @@ tcp_state_change(struct tcpcb *tp, int n int pstate = tp->t_state; #endif - TCPSTAT_DEC(tcps_states[tp->t_state]); - TCPSTAT_INC(tcps_states[newstate]); + TCPSTATES_DEC(tp->t_state); + TCPSTATES_INC(newstate); tp->t_state = newstate; TCP_PROBE6(state__change, NULL, tp, NULL, tp, NULL, pstate); } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_syncache.c Tue Mar 15 00:15:10 2016 (r296881) @@ -351,7 +351,7 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); - TCPSTAT_INC(tcps_states[TCPS_SYN_RECEIVED]); + TCPSTATES_INC(TCPS_SYN_RECEIVED); TCPSTAT_INC(tcps_sc_added); } @@ -365,7 +365,7 @@ syncache_drop(struct syncache *sc, struc SCH_LOCK_ASSERT(sch); - TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); + TCPSTATES_DEC(TCPS_SYN_RECEIVED); TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; @@ -1003,7 +1003,7 @@ syncache_expand(struct in_conninfo *inc, * sonewconn->tcp_usr_attach in TCPS_CLOSED state, then * syncache_socket() will change it to TCPS_SYN_RECEIVED. */ - TCPSTAT_DEC(tcps_states[TCPS_SYN_RECEIVED]); + TCPSTATES_DEC(TCPS_SYN_RECEIVED); TAILQ_REMOVE(&sch->sch_bucket, sc, sc_hash); sch->sch_length--; #ifdef TCP_OFFLOAD Modified: head/sys/netinet/tcp_timewait.c ============================================================================== --- head/sys/netinet/tcp_timewait.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_timewait.c Tue Mar 15 00:15:10 2016 (r296881) @@ -660,7 +660,7 @@ tcp_tw_2msl_stop(struct tcptw *tw, int r if (!reuse) uma_zfree(V_tcptw_zone, tw); - TCPSTAT_DEC(tcps_states[TCPS_TIME_WAIT]); + TCPSTATES_DEC(TCPS_TIME_WAIT); } struct tcptw * Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_usrreq.c Tue Mar 15 00:15:10 2016 (r296881) @@ -1883,7 +1883,7 @@ tcp_attach(struct socket *so) tp->t_state = TCPS_CLOSED; INP_WUNLOCK(inp); INP_INFO_RUNLOCK(&V_tcbinfo); - TCPSTAT_INC(tcps_states[TCPS_CLOSED]); + TCPSTATES_INC(TCPS_CLOSED); return (0); } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Tue Mar 15 00:05:00 2016 (r296880) +++ head/sys/netinet/tcp_var.h Tue Mar 15 00:15:10 2016 (r296881) @@ -588,9 +588,6 @@ struct tcpstat { uint64_t tcps_sig_err_sigopt; /* No signature expected by socket */ uint64_t tcps_sig_err_nosigopt; /* No signature provided by segment */ - /* Running connection count. */ - uint64_t tcps_states[TCP_NSTATES]; - uint64_t _pad[12]; /* 6 UTO, 6 TBD */ }; @@ -609,9 +606,6 @@ VNET_PCPUSTAT_DECLARE(struct tcpstat, tc #define TCPSTAT_ADD(name, val) \ VNET_PCPUSTAT_ADD(struct tcpstat, tcpstat, name, (val)) #define TCPSTAT_INC(name) TCPSTAT_ADD(name, 1) -#define TCPSTAT_DEC(name) TCPSTAT_ADD(name, -1) -#define TCPSTAT_FETCH(name) VNET_PCPUSTAT_FETCH(struct tcpstat, tcpstat, \ - name) /* * Kernel module consumers must use this accessor macro. @@ -621,6 +615,13 @@ void kmod_tcpstat_inc(int statnum); kmod_tcpstat_inc(offsetof(struct tcpstat, name) / sizeof(uint64_t)) /* + * Running TCP connection count by state. + */ +VNET_DECLARE(counter_u64_t, tcps_states[TCP_NSTATES]); +#define TCPSTATES_INC(state) counter_u64_add(VNET(tcps_states)[state], 1) +#define TCPSTATES_DEC(state) counter_u64_add(VNET(tcps_states)[state], -1) + +/* * TCP specific helper hook point identifiers. */ #define HHOOK_TCP_EST_IN 0 @@ -678,6 +679,7 @@ struct xtcpcb { #define TCPCTL_V6MSSDFLT 13 /* MSS default for IPv6 */ #define TCPCTL_SACK 14 /* Selective Acknowledgement,rfc 2018 */ #define TCPCTL_DROP 15 /* drop tcp connection */ +#define TCPCTL_STATES 16 /* connection counts by TCP state */ #ifdef _KERNEL #ifdef SYSCTL_DECL From owner-svn-src-head@freebsd.org Tue Mar 15 00:16:43 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E99CAD13C9; Tue, 15 Mar 2016 00:16:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::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 15898158D; Tue, 15 Mar 2016 00:16:43 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wm0-x22e.google.com with SMTP id l68so130452274wml.0; Mon, 14 Mar 2016 17:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3t8RqYgTUn0P3+QQstPBhCy7SNcLdbYB+dYHG1fS+44=; b=p6jNti/IXq5LelpoitY+gjZa4OvtkdmOTCUhyoL+5apFHiE9l53NqaCrZoVdoLLcpr I/l2kHhlrpe2FL9ojqGfTnWwd/xzEWUjjumSPH2J0x7i4khMytR2fpqaJmspSoZIaRZw EHx1o7AVAiDTg9F/Rxp1Lt/mhW0QhkYOtfgqMSsamPVsYxT4HxPVYWcsKoxdyOE9oIuV S4EEzS4vdVCLxhTV4NSDsk3fdbPfnTyNENCgH0WqbgcnpetEJkph/XBgVbUEVIk0pgsM Wd6DRIqlcpSG/6IscT4j5lkh8e8XrHKycX2KhbMR2yPMTScPz43iMc5khL9rYdrkX/v1 V0RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3t8RqYgTUn0P3+QQstPBhCy7SNcLdbYB+dYHG1fS+44=; b=QpnO8WkTpRmrBzFqkb5yk9Z8h31mcSt7ZXKZ1e6z5ajDu45Ph8SypJwnAAvgLXkOgF +rCT3naI8yowbb1TiYOOLA4WbKcmzO0mDd8Qiet613ifdjs7SGjylsI9Yj064qv3k5Ph uB5zQrvIsorFLtJ08QDd0cblAVxO3nUiwXwvFl3eJK6nmZ6OSpJPja/Di//gj4bN5mkf BNNWGr5GycwZ5fCGvuGpmvj3+KPFGfkObVRP9HsbfBsweMQgj1LCnh+tCR+JU9q1UbaR LXXjXLVoAKN0hjqbd4jE4xJaJ4/MsT7C+LmZyD5lcyEQpS/veGSR8+TvLHNzHOFLBA2r yG8g== X-Gm-Message-State: AD7BkJLymdFAWr0c7Vyn1dtP4bpc/1TmBosGHV0GkF9ewuYnsthFpxEwp2kap8Ak5Tfj5w== X-Received: by 10.28.141.10 with SMTP id p10mr19943383wmd.83.1458001001637; Mon, 14 Mar 2016 17:16:41 -0700 (PDT) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id cb2sm24545815wjc.16.2016.03.14.17.16.40 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 14 Mar 2016 17:16:40 -0700 (PDT) Date: Tue, 15 Mar 2016 01:16:38 +0100 From: Mateusz Guzik To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160315001638.GA29505@dft-labs.eu> References: <201603150005.u2F050ps086390@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <201603150005.u2F050ps086390@repo.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:16:43 -0000 On Tue, Mar 15, 2016 at 12:05:00AM +0000, Gleb Smirnoff wrote: > +int > +sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS) > +{ > + uint64_t *out; > + int error; > + > + out = malloc(arg2 * sizeof(uint64_t), M_TEMP, M_WAITOK); > + for (int i = 0; i < arg2; i++) > + out[i] = counter_u64_fetch(((counter_u64_t *)arg1)[i]); > + > + error = SYSCTL_OUT(req, out, arg2 * sizeof(uint64_t)); > + > + if (error || !req->newptr) > + return (error); > + > + /* > + * Any write attempt to a counter zeroes it. > + */ > + for (int i = 0; i < arg2; i++) > + counter_u64_zero(((counter_u64_t *)arg1)[i]); > + > + return (0); > +} > This never frees tha allocated buffer. It would be better to just put stuff to userspace in a loop and avoid allocations entirely. but does not look like there are no friendly macros for that. -- Mateusz Guzik From owner-svn-src-head@freebsd.org Tue Mar 15 00:19:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6E6CAD14CC; Tue, 15 Mar 2016 00:19:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 748BE186F; Tue, 15 Mar 2016 00:19:32 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2F0JVE0089695; Tue, 15 Mar 2016 00:19:31 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F0JVFr089691; Tue, 15 Mar 2016 00:19:31 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603150019.u2F0JVFr089691@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Mar 2016 00:19:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296882 - head/usr.bin/netstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:19:32 -0000 Author: glebius Date: Tue Mar 15 00:19:30 2016 New Revision: 296882 URL: https://svnweb.freebsd.org/changeset/base/296882 Log: Print running TCP connection counts with TCP statistics. Modified: head/usr.bin/netstat/inet.c head/usr.bin/netstat/main.c head/usr.bin/netstat/netstat.h head/usr.bin/netstat/nlist_symbols Modified: head/usr.bin/netstat/inet.c ============================================================================== --- head/usr.bin/netstat/inet.c Tue Mar 15 00:15:10 2016 (r296881) +++ head/usr.bin/netstat/inet.c Tue Mar 15 00:19:30 2016 (r296882) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #include #include #include "netstat.h" +#include "nl_defs.h" char *inetname(struct in_addr *); void inetprint(const char *, struct in_addr *, int, const char *, int, @@ -638,6 +639,7 @@ void tcp_stats(u_long off, const char *name, int af1 __unused, int proto __unused) { struct tcpstat tcpstat; + uint64_t tcps_states[TCP_NSTATES]; #ifdef INET6 if (tcp_done != 0) @@ -650,6 +652,10 @@ tcp_stats(u_long off, const char *name, sizeof(tcpstat), kread_counters) != 0) return; + if (fetch_stats_ro("net.inet.tcp.states", nl[N_TCPS_STATES].n_value, + &tcps_states, sizeof(tcps_states), kread_counters) != 0) + return; + xo_open_container("tcp"); xo_emit("{T:/%s}:\n", name); @@ -853,6 +859,28 @@ tcp_stats(u_long off, const char *name, #undef p2a #undef p3 xo_close_container("ecn"); + + xo_open_container("TCP connection count by state"); + xo_emit("{T:/TCP connection count by state}:\n"); + for (int i = 0; i < TCP_NSTATES; i++) { + /* + * XXXGL: is there a way in libxo to use %s + * in the "content string" of a format + * string? I failed to do that, that's why + * a temporary buffer is used to construct + * format string for xo_emit(). + */ + char fmtbuf[80]; + + if (sflag > 1 && tcps_states[i] == 0) + continue; + snprintf(fmtbuf, sizeof(fmtbuf), "\t{:%s/%%ju} " + "{Np:/connection ,connections} in %s state\n", + tcpstates[i], tcpstates[i]); + xo_emit(fmtbuf, (uintmax_t )tcps_states[i]); + } + xo_close_container("TCP connection count by state"); + xo_close_container("tcp"); } Modified: head/usr.bin/netstat/main.c ============================================================================== --- head/usr.bin/netstat/main.c Tue Mar 15 00:15:10 2016 (r296881) +++ head/usr.bin/netstat/main.c Tue Mar 15 00:19:30 2016 (r296882) @@ -551,15 +551,15 @@ main(int argc, char *argv[]) exit(0); } -int -fetch_stats(const char *sysctlname, u_long off, void *stats, size_t len, - int (*kreadfn)(u_long, void *, size_t)) +static int +fetch_stats_internal(const char *sysctlname, u_long off, void *stats, + size_t len, kreadfn_t kreadfn, int zero) { int error; if (live) { memset(stats, 0, len); - if (zflag) + if (zero) error = sysctlbyname(sysctlname, NULL, NULL, stats, len); else @@ -574,6 +574,23 @@ fetch_stats(const char *sysctlname, u_lo return (error); } +int +fetch_stats(const char *sysctlname, u_long off, void *stats, + size_t len, kreadfn_t kreadfn) +{ + + return (fetch_stats_internal(sysctlname, off, stats, len, kreadfn, + zflag)); +} + +int +fetch_stats_ro(const char *sysctlname, u_long off, void *stats, + size_t len, kreadfn_t kreadfn) +{ + + return (fetch_stats_internal(sysctlname, off, stats, len, kreadfn, 0)); +} + /* * Print out protocol statistics or control blocks (per sflag). * If the interface was not specifically requested, and the symbol Modified: head/usr.bin/netstat/netstat.h ============================================================================== --- head/usr.bin/netstat/netstat.h Tue Mar 15 00:15:10 2016 (r296881) +++ head/usr.bin/netstat/netstat.h Tue Mar 15 00:19:30 2016 (r296882) @@ -63,8 +63,10 @@ extern int unit; /* unit number for abov extern int live; /* true if we are examining a live system */ -int fetch_stats(const char *sysctlname, u_long addr, void *stats, - size_t len, int (*kreadfn)(u_long, void *, size_t)); +typedef int kreadfn_t(u_long, void *, size_t); +int fetch_stats(const char *, u_long, void *, size_t, kreadfn_t); +int fetch_stats_ro(const char *, u_long, void *, size_t, kreadfn_t); + int kread(u_long addr, void *buf, size_t size); uint64_t kread_counter(u_long addr); int kread_counters(u_long addr, void *buf, size_t size); Modified: head/usr.bin/netstat/nlist_symbols ============================================================================== --- head/usr.bin/netstat/nlist_symbols Tue Mar 15 00:15:10 2016 (r296881) +++ head/usr.bin/netstat/nlist_symbols Tue Mar 15 00:19:30 2016 (r296882) @@ -44,6 +44,7 @@ all _sctpstat all _sfstat all _tcbinfo all _tcpstat +all _tcps_states all _udbinfo all _udpstat all _unp_count From owner-svn-src-head@freebsd.org Tue Mar 15 00:21:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B35BFAD15A9; Tue, 15 Mar 2016 00:21:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 80DD61BDA; Tue, 15 Mar 2016 00:21:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2F0LWSF089860; Tue, 15 Mar 2016 00:21:32 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F0LWMo089859; Tue, 15 Mar 2016 00:21:32 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603150021.u2F0LWMo089859@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Tue, 15 Mar 2016 00:21:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296883 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:21:33 -0000 Author: glebius Date: Tue Mar 15 00:21:32 2016 New Revision: 296883 URL: https://svnweb.freebsd.org/changeset/base/296883 Log: Free the temporary buffer in sysctl_handle_counter_u64_array(). Submitted by: mjg Modified: head/sys/kern/subr_counter.c Modified: head/sys/kern/subr_counter.c ============================================================================== --- head/sys/kern/subr_counter.c Tue Mar 15 00:19:30 2016 (r296882) +++ head/sys/kern/subr_counter.c Tue Mar 15 00:21:32 2016 (r296883) @@ -106,6 +106,7 @@ sysctl_handle_counter_u64_array(SYSCTL_H out[i] = counter_u64_fetch(((counter_u64_t *)arg1)[i]); error = SYSCTL_OUT(req, out, arg2 * sizeof(uint64_t)); + free(out, M_TEMP); if (error || !req->newptr) return (error); From owner-svn-src-head@freebsd.org Tue Mar 15 00:21:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01A63AD16A2; Tue, 15 Mar 2016 00:21:50 +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 E03F51D51; Tue, 15 Mar 2016 00:21:49 +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 u2F0LmXD063273 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 14 Mar 2016 17:21:49 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2F0Lmwa063272; Mon, 14 Mar 2016 17:21:48 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 14 Mar 2016 17:21:48 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160315002148.GP1328@FreeBSD.org> References: <201603150005.u2F050ps086390@repo.freebsd.org> <20160315001638.GA29505@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160315001638.GA29505@dft-labs.eu> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 00:21:50 -0000 On Tue, Mar 15, 2016 at 01:16:38AM +0100, Mateusz Guzik wrote: M> On Tue, Mar 15, 2016 at 12:05:00AM +0000, Gleb Smirnoff wrote: M> > +int M> > +sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS) M> > +{ M> > + uint64_t *out; M> > + int error; M> > + M> > + out = malloc(arg2 * sizeof(uint64_t), M_TEMP, M_WAITOK); M> > + for (int i = 0; i < arg2; i++) M> > + out[i] = counter_u64_fetch(((counter_u64_t *)arg1)[i]); M> > + M> > + error = SYSCTL_OUT(req, out, arg2 * sizeof(uint64_t)); M> > + M> > + if (error || !req->newptr) M> > + return (error); M> > + M> > + /* M> > + * Any write attempt to a counter zeroes it. M> > + */ M> > + for (int i = 0; i < arg2; i++) M> > + counter_u64_zero(((counter_u64_t *)arg1)[i]); M> > + M> > + return (0); M> > +} M> > M> M> This never frees tha allocated buffer. M> M> It would be better to just put stuff to userspace in a loop and avoid M> allocations entirely. but does not look like there are no friendly M> macros for that. Thanks, Mateusz! Pointy hat is mine. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Mar 15 01:17:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05FF0AD0D1E; Tue, 15 Mar 2016 01:17:40 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C98EF1C50; Tue, 15 Mar 2016 01:17:39 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2F1HcOP008154; Tue, 15 Mar 2016 01:17:38 GMT (envelope-from sobomax@FreeBSD.org) Received: (from sobomax@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F1HcHA008153; Tue, 15 Mar 2016 01:17:38 GMT (envelope-from sobomax@FreeBSD.org) Message-Id: <201603150117.u2F1HcHA008153@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sobomax set sender to sobomax@FreeBSD.org using -f From: Maxim Sobolev Date: Tue, 15 Mar 2016 01:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296885 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 01:17:40 -0000 Author: sobomax Date: Tue Mar 15 01:17:38 2016 New Revision: 296885 URL: https://svnweb.freebsd.org/changeset/base/296885 Log: Fix build with HWPMC_HOOKS enabled. Modified: head/sys/mips/mips/mips_pic.c Modified: head/sys/mips/mips/mips_pic.c ============================================================================== --- head/sys/mips/mips/mips_pic.c Tue Mar 15 00:24:50 2016 (r296884) +++ head/sys/mips/mips/mips_pic.c Tue Mar 15 01:17:38 2016 (r296885) @@ -48,6 +48,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -217,8 +219,11 @@ mips_pic_intr(void *arg) KASSERT(i == 0, ("all interrupts handled")); #ifdef HWPMC_HOOKS - if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) + if (pmc_hook && (PCPU_GET(curthread)->td_pflags & TDP_CALLCHAIN)) { + struct trapframe *tf = PCPU_GET(curthread)->td_intr_frame; + pmc_hook(PCPU_GET(curthread), PMC_FN_USER_CALLCHAIN, tf); + } #endif return (FILTER_HANDLED); } From owner-svn-src-head@freebsd.org Tue Mar 15 01:24:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CAB69AD10AD; Tue, 15 Mar 2016 01:24:14 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id 9D06DE7; Tue, 15 Mar 2016 01:24:14 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (unknown [210.164.9.11]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id C6A39D78FE; Tue, 15 Mar 2016 01:18:33 +0000 (UTC) Date: Tue, 15 Mar 2016 10:18:25 +0900 From: Andrew Turner To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296861 - in head/sys: arm/arm powerpc/powerpc Message-ID: <20160315101825.0b8ecf13@zapp> In-Reply-To: <201603141455.u2EEtFSL014609@repo.freebsd.org> References: <201603141455.u2EEtFSL014609@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 01:24:14 -0000 On Mon, 14 Mar 2016 14:55:15 +0000 (UTC) "Bjoern A. Zeeb" wrote: > Author: bz > Date: Mon Mar 14 14:55:15 2016 > New Revision: 296861 > URL: https://svnweb.freebsd.org/changeset/base/296861 > > Log: > Only check for SYS_freebsd6_lseek if the syscall code is defined. > Whether this is the right or best solution is unclear but it fixes > the build for now. We should make it an error if someone tries to build an ARM kernel with COMPAT_FREEBSD6. I think there was some support for ARM in 6, however we have switched the ABI since then so any old programs will now fail to run. Having it would be even more of a bug on armv6. This was added for 10.0 and, given running arm (v4/v5) programs on an armv6 kernel is unsupported there should be no reason to include it in the kernel. Andrew From owner-svn-src-head@freebsd.org Tue Mar 15 01:33:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DE2DAD1410; Tue, 15 Mar 2016 01:33:14 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp004.me.com (mr11p00im-asmtp004.me.com [17.110.69.135]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1B70996E; Tue, 15 Mar 2016 01:33:14 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp004.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O4200KH01J7VK20@mr11p00im-asmtp004.me.com>; Tue, 15 Mar 2016 00:33:08 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-15_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1603150006 User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Mon, 14 Mar 2016 17:33:06 -0700 Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys From: Ravi Pokala Sender: "Pokala, Ravi" To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: Thread-topic: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys References: <201603150005.u2F050ps086390@repo.freebsd.org> In-reply-to: <201603150005.u2F050ps086390@repo.freebsd.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 01:33:14 -0000 -----Original Message----- From: on behalf of Gleb Smirnoff Date: 2016-03-14, Monday at 17:05 To: , , Subject: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys >Author: glebius >Date: Tue Mar 15 00:05:00 2016 >New Revision: 296880 >URL: https://svnweb.freebsd.org/changeset/base/296880 > >Log: > Provide sysctl(9) macro to deal with array of counter(9). Hi Gleb, To make sure I'm reading this correctly: (1) The sysctl operates on an opaque array of (uint64_t)s. The elements of the array are not individually accessible. (2) Reading the sysctl populates each element of the userspace array by calling counter_u64_fetch() on the corresponding element of the kernelspace array. (3) Writing the sysctl clears the kernelspace array by calling counter_u64_zero() on each element. For example, if you have a bunch of device statistics, this interface will let you get or clear them all in one shot, but they won't have distinct names. You would have to define an enum to set up names for the array indices. Does that sound correct? Thanks, Ravi (rpokala@) From owner-svn-src-head@freebsd.org Tue Mar 15 01:37:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E61DFAD153B; Tue, 15 Mar 2016 01:37:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id B7850B76; Tue, 15 Mar 2016 01:37:56 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (unknown [210.164.9.11]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id E4A2CD78FE; Tue, 15 Mar 2016 01:37:24 +0000 (UTC) Date: Tue, 15 Mar 2016 10:37:18 +0900 From: Andrew Turner To: Wojciech Macek Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296825 - in head/sys: arm/conf arm/mv arm/mv/armada38x boot/fdt/dts/arm Message-ID: <20160315103718.4f36a909@zapp> In-Reply-To: <201603140705.u2E75fWT043502@repo.freebsd.org> References: <201603140705.u2E75fWT043502@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 01:37:57 -0000 On Mon, 14 Mar 2016 07:05:41 +0000 (UTC) Wojciech Macek wrote: > Author: wma > Date: Mon Mar 14 07:05:41 2016 > New Revision: 296825 > URL: https://svnweb.freebsd.org/changeset/base/296825 > > Log: > Make MPIC compatible with ARM_INTRNG > > After ARM_INTRNG introduction, MPIC code needed several > modifications: > - IRQ resource and its handler added > - several DEVMETHODs of INTRNG interface implemented > - defines enhanced to ensure code compiles as well for AXP as for > A38X > - added dummy MSI_IRQ, ERR_IRQ defines for Armada38x > - MPIC driver was added to files.armada38x, ARM_INTRNG option > enabled in kernconf file and regs of MPIC corrected in dts file. > > Instead of modifying Armada38X DTS, offsets to CPU registers > defined in driver were changed. That required restoring 'reg' > property of mpic node in ArmadaXP to state compliant with Linux DTS. > > Additionally, required ARM_INTRNG definitions were added to > mv_common.c. > Submitted by: Bartosz Szczepanek > Obtained from: Semihalf > Sponsored by: Stormshield > Reviewed by: adrian, andrew, ian, skra > Approved by: cognet (mentor) > Differential Revision: https://reviews.freebsd.org/D5030 > > Modified: > head/sys/arm/conf/ARMADA38X > head/sys/arm/mv/armada38x/files.armada38x > head/sys/arm/mv/mpic.c > head/sys/arm/mv/mvreg.h > head/sys/boot/fdt/dts/arm/db78460.dts > > Modified: head/sys/arm/conf/ARMADA38X > ============================================================================== > --- head/sys/arm/conf/ARMADA38X Mon Mar 14 06:30:37 > 2016 (r296824) +++ head/sys/arm/conf/ARMADA38X Mon Mar > 14 07:05:41 2016 (r296825) @@ -23,6 +23,7 @@ options > SCHED_ULE # ULE scheduler #options > SCHED_4BSD # 4BSD scheduler > options SMP > +options ARM_INTRNG This file already had ARM_INTRNG set. It now has it twice. Andrew From owner-svn-src-head@freebsd.org Tue Mar 15 04:42:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A5ADEAD10EC; Tue, 15 Mar 2016 04:42:39 +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 630BF3A0; Tue, 15 Mar 2016 04:42:39 +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 u2F4gcrJ072843; Tue, 15 Mar 2016 04:42:38 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F4gbeK072837; Tue, 15 Mar 2016 04:42:37 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603150442.u2F4gbeK072837@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 Mar 2016 04:42:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296889 - in head: etc/mtree share/man/man7 tools/build/mk usr.sbin 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 04:42:39 -0000 Author: imp Date: Tue Mar 15 04:42:37 2016 New Revision: 296889 URL: https://svnweb.freebsd.org/changeset/base/296889 Log: Just install ar5523.bin into /usr/share/firmware and stop compiling it in. Differential Review: https://reviews.freebsd.org/D5639 Modified: head/etc/mtree/BSD.usr.dist head/share/man/man7/hier.7 head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.sbin/Makefile head/usr.sbin/uathload/Makefile head/usr.sbin/uathload/uathload.c Modified: head/etc/mtree/BSD.usr.dist ============================================================================== --- head/etc/mtree/BSD.usr.dist Tue Mar 15 04:03:15 2016 (r296888) +++ head/etc/mtree/BSD.usr.dist Tue Mar 15 04:42:37 2016 (r296889) @@ -428,6 +428,8 @@ uefisign .. .. + firmware + .. games fortune .. Modified: head/share/man/man7/hier.7 ============================================================================== --- head/share/man/man7/hier.7 Tue Mar 15 04:03:15 2016 (r296888) +++ head/share/man/man7/hier.7 Tue Mar 15 04:42:37 2016 (r296889) @@ -28,7 +28,7 @@ .\" @(#)hier.7 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd October 2, 2015 +.Dd March 15, 2016 .Dt HIER 7 .Os .Sh NAME @@ -545,6 +545,8 @@ Chinese translations of documents in /us .Pp .It Pa examples/ various examples for users and programmers +.It Pa firmware/ +Firmware images loaded by user land programs .It Pa games/ ASCII text files used by various games .It Pa groff_font/ Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 15 04:03:15 2016 (r296888) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Tue Mar 15 04:42:37 2016 (r296889) @@ -8024,6 +8024,7 @@ OLD_FILES+=usr/share/examples/libusb20/c OLD_FILES+=usr/share/examples/libusb20/util.c OLD_FILES+=usr/share/examples/libusb20/util.h OLD_DIRS+=usr/share/examples/libusb20 +OLD_FILES+=usr/share/firmware/ar5523.bin OLD_FILES+=usr/share/man/man1/uhsoctl.1.gz OLD_FILES+=usr/share/man/man1/usbhidaction.1.gz OLD_FILES+=usr/share/man/man1/usbhidctl.1.gz Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Tue Mar 15 04:03:15 2016 (r296888) +++ head/usr.sbin/Makefile Tue Mar 15 04:42:37 2016 (r296889) @@ -194,9 +194,7 @@ SUBDIR.${MK_TIMED}+= timed SUBDIR.${MK_TOOLCHAIN}+= config SUBDIR.${MK_TOOLCHAIN}+= crunch SUBDIR.${MK_UNBOUND}+= unbound -.if !(${COMPILER_TYPE} == "gcc" && ${COMPILER_VERSION} >= 50200) SUBDIR.${MK_USB}+= uathload -.endif SUBDIR.${MK_USB}+= uhsoctl SUBDIR.${MK_USB}+= usbconfig SUBDIR.${MK_USB}+= usbdump Modified: head/usr.sbin/uathload/Makefile ============================================================================== --- head/usr.sbin/uathload/Makefile Tue Mar 15 04:03:15 2016 (r296888) +++ head/usr.sbin/uathload/Makefile Tue Mar 15 04:42:37 2016 (r296889) @@ -3,28 +3,14 @@ PROG= uathload MAN= uathload.8 -SRCS= uathload.c ar5523.bin +SRCS= uathload.c +FILES= ar5523.bin +FILESDIR= ${SHAREDIR}/firmware +FILESMODE= 444 CLEANFILES= ar5523.bin -# It's hard to tag ar5523.o with the proper gnu note saying that it has a -# non-executable stack, so ld doesn't properly mark his executable as -# not having an executable stack. Mark it explicitly, but only for those -# platforms that support his feature (otherwise signals don't work). -# Note: Newer versions of ld than is in the tree ignore -z. -.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "powerpc64" -LDFLAGS+= -Wl,-z,noexecstack -.endif - -# The conversion from .bin to .o doesn't always produce a pedantically correct -# .o's. And it doesn't matter, so turn off the mismatch warnings since it is -# pure data. On mips64 here's no easy way to produce a proper .o. -LDFLAGS+= -Wl,--no-warn-mismatch - ar5523.bin: ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu uudecode -p ${.CURDIR}/../../sys/contrib/dev/uath/ar5523.bin.uu > ${.TARGET} -ar5523.o: ar5523.bin - ${LD} -b binary -d -warn-common -r -d -o ${.TARGET} ar5523.bin - .include Modified: head/usr.sbin/uathload/uathload.c ============================================================================== --- head/usr.sbin/uathload/uathload.c Tue Mar 15 04:03:15 2016 (r296888) +++ head/usr.sbin/uathload/uathload.c Tue Mar 15 04:42:37 2016 (r296889) @@ -140,23 +140,19 @@ main(int argc, char *argv[]) if (argc > 1) usage(); - if (argc == 1) { + if (argc == 1) fwname = argv[0]; - fw = open(fwname, O_RDONLY, 0); - if (fw < 0) - err(-1, "open(%s)", fwname); - if (fstat(fw, &sb) < 0) - err(-1, "fstat(%s)", fwname); - txdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fw, 0); - if (txdata == MAP_FAILED) - err(-1, "mmap(%s)", fwname); - len = sb.st_size; - } else { - fwname = "ar5523.bin (builtin)"; - fw = -1; - txdata = &_binary_ar5523_bin_start; - len = &_binary_ar5523_bin_end - &_binary_ar5523_bin_start; - } + else + fwname = "/usr/share/firmware/ar5523.bin"; + fw = open(fwname, O_RDONLY, 0); + if (fw < 0) + err(-1, "open(%s)", fwname); + if (fstat(fw, &sb) < 0) + err(-1, "fstat(%s)", fwname); + txdata = mmap(NULL, sb.st_size, PROT_READ, MAP_PRIVATE, fw, 0); + if (txdata == MAP_FAILED) + err(-1, "mmap(%s)", fwname); + len = sb.st_size; /* XXX verify device is an AR5005 part */ if (getdevname(devname, msgdev, datadev)) err(-1, "getdevname error"); From owner-svn-src-head@freebsd.org Tue Mar 15 04:56:41 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2995AAD1503; Tue, 15 Mar 2016 04:56:41 +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 EDC10BCA; Tue, 15 Mar 2016 04:56:40 +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 u2F4udau075970; Tue, 15 Mar 2016 04:56:39 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F4udoh075969; Tue, 15 Mar 2016 04:56:39 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603150456.u2F4udoh075969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 Mar 2016 04:56:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296890 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 04:56:41 -0000 Author: imp Date: Tue Mar 15 04:56:39 2016 New Revision: 296890 URL: https://svnweb.freebsd.org/changeset/base/296890 Log: Remove bare & 0x3; it encodes the values of BIO_READ and BIO_WRITE. It's also unnecessary since the only cases in this switch are those two. Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Tue Mar 15 04:42:37 2016 (r296889) +++ head/sys/dev/mfi/mfi.c Tue Mar 15 04:56:39 2016 (r296890) @@ -2141,7 +2141,7 @@ mfi_build_syspdio(struct mfi_softc *sc, pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; - switch (bio->bio_cmd & 0x03) { + switch (bio->bio_cmd) { case BIO_READ: flags = MFI_CMD_DATAIN | MFI_CMD_BIO; readop = 1; @@ -2200,7 +2200,7 @@ mfi_build_ldio(struct mfi_softc *sc, str bzero(cm->cm_frame, sizeof(union mfi_frame)); cm->cm_frame->header.context = context; io = &cm->cm_frame->io; - switch (bio->bio_cmd & 0x03) { + switch (bio->bio_cmd) { case BIO_READ: io->header.cmd = MFI_CMD_LD_READ; flags = MFI_CMD_DATAIN | MFI_CMD_BIO; From owner-svn-src-head@freebsd.org Tue Mar 15 05:17:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 659F7AD1A93; Tue, 15 Mar 2016 05:17:31 +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 3E6A168D; Tue, 15 Mar 2016 05:17:31 +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 u2F5HUTd082365; Tue, 15 Mar 2016 05:17:30 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F5HTkd082357; Tue, 15 Mar 2016 05:17:29 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603150517.u2F5HTkd082357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 Mar 2016 05:17:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296891 - in head/sys: cam dev/arcmsr dev/iir dev/isci dev/ncr dev/ppbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 05:17:31 -0000 Author: imp Date: Tue Mar 15 05:17:29 2016 New Revision: 296891 URL: https://svnweb.freebsd.org/changeset/base/296891 Log: Make sure we check for CAM_CDB_POINTER for all drivers. Also, for the drivers I've touched, filter out CAM_CDB_PHYS. Differential Revision: https://reviews.freebsd.org/D5585 Modified: head/sys/cam/cam_ccb.h head/sys/dev/arcmsr/arcmsr.c head/sys/dev/iir/iir.c head/sys/dev/isci/isci_controller.c head/sys/dev/isci/isci_io_request.c head/sys/dev/ncr/ncr.c head/sys/dev/ppbus/vpo.c Modified: head/sys/cam/cam_ccb.h ============================================================================== --- head/sys/cam/cam_ccb.h Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/cam/cam_ccb.h Tue Mar 15 05:17:29 2016 (r296891) @@ -725,6 +725,13 @@ struct ccb_scsiio { u_int init_id; /* initiator id of who selected */ }; +static __inline uint8_t * +scsiio_cdb_ptr(struct ccb_scsiio *ccb) +{ + return ((ccb->ccb_h.flags & CAM_CDB_POINTER) ? + ccb->cdb_io.cdb_ptr : ccb->cdb_io.cdb_bytes); +} + /* * ATA I/O Request CCB used for the XPT_ATA_IO function code. */ Modified: head/sys/dev/arcmsr/arcmsr.c ============================================================================== --- head/sys/dev/arcmsr/arcmsr.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/arcmsr/arcmsr.c Tue Mar 15 05:17:29 2016 (r296891) @@ -872,7 +872,7 @@ static void arcmsr_srb_timeout(void *arg ARCMSR_LOCK_ACQUIRE(&acb->isr_lock); if(srb->srb_state == ARCMSR_SRB_START) { - cmd = srb->pccb->csio.cdb_io.cdb_bytes[0]; + cmd = scsiio_cdb_ptr(&srb->pccb->csio)[0]; srb->srb_state = ARCMSR_SRB_TIMEOUT; srb->pccb->ccb_h.status |= CAM_CMD_TIMEOUT; arcmsr_srb_complete(srb, 1); @@ -997,7 +997,7 @@ static void arcmsr_build_srb(struct Comm arcmsr_cdb->LUN = pccb->ccb_h.target_lun; arcmsr_cdb->Function = 1; arcmsr_cdb->CdbLength = (u_int8_t)pcsio->cdb_len; - bcopy(pcsio->cdb_io.cdb_bytes, arcmsr_cdb->Cdb, pcsio->cdb_len); + bcopy(scsiio_cdb_ptr(pcsio), arcmsr_cdb->Cdb, pcsio->cdb_len); if(nseg != 0) { struct AdapterControlBlock *acb = srb->acb; bus_dmasync_op_t op; @@ -2453,10 +2453,11 @@ static int arcmsr_iop_message_xfer(struc struct CMD_MESSAGE_FIELD *pcmdmessagefld; int retvalue = 0, transfer_len = 0; char *buffer; - u_int32_t controlcode = (u_int32_t ) pccb->csio.cdb_io.cdb_bytes[5] << 24 | - (u_int32_t ) pccb->csio.cdb_io.cdb_bytes[6] << 16 | - (u_int32_t ) pccb->csio.cdb_io.cdb_bytes[7] << 8 | - (u_int32_t ) pccb->csio.cdb_io.cdb_bytes[8]; + uint8_t *ptr = scsiio_cdb_ptr(&pccb->csio); + u_int32_t controlcode = (u_int32_t ) ptr[5] << 24 | + (u_int32_t ) ptr[6] << 16 | + (u_int32_t ) ptr[7] << 8 | + (u_int32_t ) ptr[8]; /* 4 bytes: Areca io control code */ if ((pccb->ccb_h.flags & CAM_DATA_MASK) == CAM_DATA_VADDR) { buffer = pccb->csio.data_ptr; @@ -2683,7 +2684,7 @@ static void arcmsr_execute_srb(void *arg if(acb->devstate[target][lun] == ARECA_RAID_GONE) { u_int8_t block_cmd, cmd; - cmd = pccb->csio.cdb_io.cdb_bytes[0]; + cmd = scsiio_cdb_ptr(&pccb->csio)[0]; block_cmd = cmd & 0x0f; if(block_cmd == 0x08 || block_cmd == 0x0a) { printf("arcmsr%d:block 'read/write' command " @@ -2800,7 +2801,7 @@ static void arcmsr_handle_virtual_comman return; } pccb->ccb_h.status |= CAM_REQ_CMP; - switch (pccb->csio.cdb_io.cdb_bytes[0]) { + switch (scsiio_cdb_ptr(&pccb->csio)[0]) { case INQUIRY: { unsigned char inqdata[36]; char *buffer = pccb->csio.data_ptr; @@ -2853,6 +2854,12 @@ static void arcmsr_action(struct cam_sim int target = pccb->ccb_h.target_id; int error; + if (pccb->ccb_h.flags & CAM_CDB_PHYS) { + pccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(pccb); + return; + } + if(target == 16) { /* virtual device for iop message transfer */ arcmsr_handle_virtual_command(acb, pccb); Modified: head/sys/dev/iir/iir.c ============================================================================== --- head/sys/dev/iir/iir.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/iir/iir.c Tue Mar 15 05:17:29 2016 (r296891) @@ -744,9 +744,9 @@ gdt_next(struct gdt_softc *gdt) ccb->ccb_h.flags)); csio = &ccb->csio; ccbh = &ccb->ccb_h; - cmd = csio->cdb_io.cdb_bytes[0]; - /* Max CDB length is 12 bytes */ - if (csio->cdb_len > 12) { + cmd = scsiio_cdb_ptr(csio)[0]; + /* Max CDB length is 12 bytes, can't be phys addr */ + if (csio->cdb_len > 12 || (ccbh->flags & CAM_CDB_PHYS)) { ccbh->status = CAM_REQ_INVALID; --gdt_stat.io_count_act; xpt_done(ccb); Modified: head/sys/dev/isci/isci_controller.c ============================================================================== --- head/sys/dev/isci/isci_controller.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/isci/isci_controller.c Tue Mar 15 05:17:29 2016 (r296891) @@ -740,6 +740,11 @@ void isci_action(struct cam_sim *sim, un } break; case XPT_SCSI_IO: + if (ccb->ccb_h.flags & CAM_CDB_PHYS) { + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + break; + } isci_io_request_execute_scsi_io(ccb, controller); break; #if __FreeBSD_version >= 900026 @@ -802,6 +807,7 @@ isci_controller_release_queued_ccbs(stru { struct ISCI_REMOTE_DEVICE *dev; struct ccb_hdr *ccb_h; + uint8_t *ptr; int dev_idx; KASSERT(mtx_owned(&controller->lock), ("controller lock not owned")); @@ -821,8 +827,8 @@ isci_controller_release_queued_ccbs(stru if (ccb_h == NULL) continue; - isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, - ((union ccb *)ccb_h)->csio.cdb_io.cdb_bytes[0]); + ptr = scsiio_cdb_ptr(&((union ccb *)ccb_h)->csio); + isci_log_message(1, "ISCI", "release %p %x\n", ccb_h, *ptr); dev->queued_ccb_in_progress = (union ccb *)ccb_h; isci_io_request_execute_scsi_io( Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/isci/isci_io_request.c Tue Mar 15 05:17:29 2016 (r296891) @@ -86,6 +86,7 @@ isci_io_request_complete(SCI_CONTROLLER_ struct ISCI_REMOTE_DEVICE *isci_remote_device; union ccb *ccb; BOOL complete_ccb; + struct ccb_scsiio *csio; complete_ccb = TRUE; isci_controller = (struct ISCI_CONTROLLER *) sci_object_get_association(scif_controller); @@ -93,7 +94,7 @@ isci_io_request_complete(SCI_CONTROLLER_ (struct ISCI_REMOTE_DEVICE *) sci_object_get_association(remote_device); ccb = isci_request->ccb; - + csio = &ccb->csio; ccb->ccb_h.status &= ~CAM_STATUS_MASK; switch (completion_status) { @@ -124,7 +125,6 @@ isci_io_request_complete(SCI_CONTROLLER_ SCI_SSP_RESPONSE_IU_T * response_buffer; uint32_t sense_length; int error_code, sense_key, asc, ascq; - struct ccb_scsiio *csio = &ccb->csio; response_buffer = (SCI_SSP_RESPONSE_IU_T *) scif_io_request_get_response_iu_address( @@ -146,7 +146,7 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_log_message(1, "ISCI", "isci: bus=%x target=%x lun=%x cdb[0]=%x status=%x key=%x asc=%x ascq=%x\n", ccb->ccb_h.path_id, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, csio->cdb_io.cdb_bytes[0], + ccb->ccb_h.target_lun, scsiio_cdb_ptr(csio), csio->scsi_status, sense_key, asc, ascq); break; } @@ -157,7 +157,7 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_log_message(0, "ISCI", "isci: bus=%x target=%x lun=%x cdb[0]=%x remote device reset required\n", ccb->ccb_h.path_id, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]); + ccb->ccb_h.target_lun, scsiio_cdb_ptr(csio)); break; case SCI_IO_FAILURE_TERMINATED: @@ -165,7 +165,7 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_log_message(0, "ISCI", "isci: bus=%x target=%x lun=%x cdb[0]=%x terminated\n", ccb->ccb_h.path_id, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0]); + ccb->ccb_h.target_lun, scsiio_cdb_ptr(csio)); break; case SCI_IO_FAILURE_INVALID_STATE: @@ -208,7 +208,7 @@ isci_io_request_complete(SCI_CONTROLLER_ isci_log_message(1, "ISCI", "isci: bus=%x target=%x lun=%x cdb[0]=%x completion status=%x\n", ccb->ccb_h.path_id, ccb->ccb_h.target_id, - ccb->ccb_h.target_lun, ccb->csio.cdb_io.cdb_bytes[0], + ccb->ccb_h.target_lun, scsiio_cdb_ptr(csio), completion_status); ccb->ccb_h.status |= CAM_REQ_CMP_ERR; break; @@ -285,13 +285,13 @@ isci_io_request_complete(SCI_CONTROLLER_ * get a ready notification for this device. */ isci_log_message(1, "ISCI", "already queued %p %x\n", - ccb, ccb->csio.cdb_io.cdb_bytes[0]); + ccb, scsiio_cdb_ptr(csio)); isci_remote_device->queued_ccb_in_progress = NULL; } else { isci_log_message(1, "ISCI", "queue %p %x\n", ccb, - ccb->csio.cdb_io.cdb_bytes[0]); + scsiio_cdb_ptr(csio)); ccb->ccb_h.status |= CAM_SIM_QUEUED; TAILQ_INSERT_TAIL(&isci_remote_device->queued_ccbs, @@ -373,7 +373,7 @@ scif_cb_io_request_get_cdb_address(void struct ISCI_IO_REQUEST *isci_request = (struct ISCI_IO_REQUEST *)scif_user_io_request; - return (isci_request->ccb->csio.cdb_io.cdb_bytes); + return (scsiio_cdb_ptr(&isci_request->ccb->csio)); } /** Modified: head/sys/dev/ncr/ncr.c ============================================================================== --- head/sys/dev/ncr/ncr.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/ncr/ncr.c Tue Mar 15 05:17:29 2016 (r296891) @@ -3860,6 +3860,16 @@ ncr_action (struct cam_sim *sim, union c csio = &ccb->csio; /* + * Make sure we support this request. We can't do + * PHYS pointers. + */ + if (ccb->ccb_h.flags & CAM_CDB_PHYS) { + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + return; + } + + /* * Last time we need to check if this CCB needs to * be aborted. */ @@ -4070,8 +4080,7 @@ ncr_action (struct cam_sim *sim, union c /* ** command */ - /* XXX JGibbs - Support other command types */ - cp->phys.cmd.addr = vtophys (csio->cdb_io.cdb_bytes); + cp->phys.cmd.addr = vtophys (scsiio_cdb_ptr(csio)); cp->phys.cmd.size = csio->cdb_len; /* ** sense command @@ -4083,7 +4092,6 @@ ncr_action (struct cam_sim *sim, union c */ cp->sensecmd[0] = 0x03; cp->sensecmd[1] = ccb->ccb_h.target_lun << 5; - cp->sensecmd[4] = sizeof(struct scsi_sense_data); cp->sensecmd[4] = csio->sense_len; /* ** sense data Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Tue Mar 15 04:56:39 2016 (r296890) +++ head/sys/dev/ppbus/vpo.c Tue Mar 15 05:17:29 2016 (r296891) @@ -187,17 +187,19 @@ vpo_intr(struct vpo_data *vpo, struct cc #ifdef VP0_DEBUG int i; #endif + uint8_t *ptr; + ptr = scsiio_cdb_ptr(csio); if (vpo->vpo_isplus) { errno = imm_do_scsi(&vpo->vpo_io, VP0_INITIATOR, csio->ccb_h.target_id, - (char *)&csio->cdb_io.cdb_bytes, csio->cdb_len, + ptr, csio->cdb_len, (char *)csio->data_ptr, csio->dxfer_len, &vpo->vpo_stat, &vpo->vpo_count, &vpo->vpo_error); } else { errno = vpoio_do_scsi(&vpo->vpo_io, VP0_INITIATOR, csio->ccb_h.target_id, - (char *)&csio->cdb_io.cdb_bytes, csio->cdb_len, + ptr, csio->cdb_len, (char *)csio->data_ptr, csio->dxfer_len, &vpo->vpo_stat, &vpo->vpo_count, &vpo->vpo_error); } @@ -208,7 +210,7 @@ vpo_intr(struct vpo_data *vpo, struct cc /* dump of command */ for (i=0; icdb_len; i++) - printf("%x ", ((char *)&csio->cdb_io.cdb_bytes)[i]); + printf("%x ", ((char *)ptr)[i]); printf("\n"); #endif @@ -307,11 +309,15 @@ vpo_action(struct cam_sim *sim, union cc csio = &ccb->csio; + if (ccb->ccb_h.flags & CAM_CDB_PHYS) { + ccb->ccb_h.status = CAM_REQ_INVALID; + xpt_done(ccb); + break; + } #ifdef VP0_DEBUG device_printf(vpo->vpo_dev, "XPT_SCSI_IO (0x%x) request\n", - csio->cdb_io.cdb_bytes[0]); + scsiio_cdb_ptr(csio)); #endif - vpo_intr(vpo, csio); xpt_done(ccb); From owner-svn-src-head@freebsd.org Tue Mar 15 05:17:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 704B6AD1A97; Tue, 15 Mar 2016 05:17:32 +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 4228B690; Tue, 15 Mar 2016 05:17:32 +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 u2F5HVTR082408; Tue, 15 Mar 2016 05:17:31 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F5HVVw082407; Tue, 15 Mar 2016 05:17:31 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603150517.u2F5HVVw082407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Tue, 15 Mar 2016 05:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296892 - head/sys/boot/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 05:17:32 -0000 Author: imp Date: Tue Mar 15 05:17:31 2016 New Revision: 296892 URL: https://svnweb.freebsd.org/changeset/base/296892 Log: ms_abi is supported with gcc 4.5 or newer, so build it with gcc if it is 4.5 or newer. Modified: head/sys/boot/efi/Makefile Modified: head/sys/boot/efi/Makefile ============================================================================== --- head/sys/boot/efi/Makefile Tue Mar 15 05:17:29 2016 (r296891) +++ head/sys/boot/efi/Makefile Tue Mar 15 05:17:31 2016 (r296892) @@ -2,8 +2,9 @@ .include -# In-tree GCC does not support __attribute__((ms_abi)). -.if ${COMPILER_TYPE} != "gcc" +# In-tree GCC does not support __attribute__((ms_abi)), but gcc newer +# than 4.5 supports it. +.if ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm" .if ${MK_FDT} != "no" @@ -17,7 +18,6 @@ SUBDIR+= fdt SUBDIR+= libefi loader boot1 .endif -.endif # ${COMPILER_TYPE} != "gcc" +.endif # ${COMPILER_TYPE} != "gcc" || ${COMPILER_VERSION} >= 404500 .include - From owner-svn-src-head@freebsd.org Tue Mar 15 06:06:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D145AD0C92; Tue, 15 Mar 2016 06:06:10 +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 5E6E6C8C; Tue, 15 Mar 2016 06:06:10 +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 u2F669Ni097446; Tue, 15 Mar 2016 06:06:09 GMT (envelope-from wma@FreeBSD.org) Received: (from wma@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2F669EL097443; Tue, 15 Mar 2016 06:06:09 GMT (envelope-from wma@FreeBSD.org) Message-Id: <201603150606.u2F669EL097443@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: wma set sender to wma@FreeBSD.org using -f From: Wojciech Macek Date: Tue, 15 Mar 2016 06:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296893 - in head/sys/arm: conf mv X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 06:06:10 -0000 Author: wma Date: Tue Mar 15 06:06:09 2016 New Revision: 296893 URL: https://svnweb.freebsd.org/changeset/base/296893 Log: Remove redefinitions in ARMADA code * Rename IRQ_MASK to MPIC_IRQ_MASK not to overlap with register name from mvreg.h * Remove ARM_INTRNG from ARMADA38X, apparently was already included. Modified: head/sys/arm/conf/ARMADA38X head/sys/arm/mv/mpic.c Modified: head/sys/arm/conf/ARMADA38X ============================================================================== --- head/sys/arm/conf/ARMADA38X Tue Mar 15 05:17:31 2016 (r296892) +++ head/sys/arm/conf/ARMADA38X Tue Mar 15 06:06:09 2016 (r296893) @@ -23,7 +23,6 @@ options SCHED_ULE # ULE scheduler #options SCHED_4BSD # 4BSD scheduler options SMP -options ARM_INTRNG # Debugging #options DEBUG Modified: head/sys/arm/mv/mpic.c ============================================================================== --- head/sys/arm/mv/mpic.c Tue Mar 15 05:17:31 2016 (r296892) +++ head/sys/arm/mv/mpic.c Tue Mar 15 06:06:09 2016 (r296893) @@ -74,7 +74,7 @@ __FBSDID("$FreeBSD$"); #define MPIC_INT_ERR 4 #define MPIC_INT_MSI 96 -#define IRQ_MASK 0x3ff +#define MPIC_IRQ_MASK 0x3ff #define MPIC_CTRL 0x0 #define MPIC_SOFT_INT 0x4 @@ -409,10 +409,10 @@ arm_get_next_irq(int last) { u_int irq, next = -1; - irq = mv_mpic_get_cause() & IRQ_MASK; + irq = mv_mpic_get_cause() & MPIC_IRQ_MASK; CTR2(KTR_INTR, "%s: irq:%#x", __func__, irq); - if (irq != IRQ_MASK) { + if (irq != MPIC_IRQ_MASK) { if (irq == MPIC_INT_ERR) irq = mv_mpic_get_cause_err(); if (irq == MPIC_INT_MSI) From owner-svn-src-head@freebsd.org Tue Mar 15 06:07:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A127BAD0D4B for ; Tue, 15 Mar 2016 06:07:27 +0000 (UTC) (envelope-from wma@semihalf.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 71245ECF for ; Tue, 15 Mar 2016 06:07:27 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-io0-x233.google.com with SMTP id n190so12328046iof.0 for ; Mon, 14 Mar 2016 23:07:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=NNFEwYaezc1QQdhbhyIRt/5Vu34FJAuQ7KV1FfW1KSc=; b=19/y6tPCixG1MkVIjrb+CdnIhGplrxKTkISa8D6IToJSE4BpwVBM8b9ykUoi3cEGLs FOKuxsEqnfCSRQr31Q4R9u5WrK2arpVXSnNkXRR+xpW6P/V3p5FZkOBffh2qbFRtuJrw ArRXvJ4326yEEem+y17gwgbog1LFe+1IGfAKpIwUO1qEoJnzz7qyXZ65r/nHDVzl91Bg XEiTNJ0764LKu7EhsNvlFGF/AObfjWFQL/5bR7azmpRNgl9rRXO5STdwrfvTO7rKq68d zf96lkdnHiLyaAVduXVWbSRKVIpx/Ks2U+l3ekP7b8on9jQr654LUO+jO/PAw9rwr2bC zvHQ== 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:from:date :message-id:subject:to:cc; bh=NNFEwYaezc1QQdhbhyIRt/5Vu34FJAuQ7KV1FfW1KSc=; b=K2U25RUixT3z3JGoUUeV14252R/bQqEHXurivIdD01Ch/Nq+9bO8ch89IW6i6rs0jh BLS9f+DIst5b9bLHAgOBwC3W9emETP6ZC0Z5TEQPq8dYZ8L1m38C/Snm6Kuiaqn0QpZz lqoVm4wmv1pn/6ZCToC1FsPIKWPPBWr3j81XVTvKkqiv6XSly5bBfOqMZOJQV6KlNb5S YC+3jLDcJUukk7WmnbsXEFBPJBf9TVIZj9uTczkkhomtul/xjv/umVM7a2YRYBMav8nC a/Bmla1RzDuY715K6u/U80n2RpHgDpnGtS5iDvL2Z9Jzo3kKbSUfnxyxnFd+0oeexrFh I13g== X-Gm-Message-State: AD7BkJLJRFM/Z9udH+aY2ugYUsldCjXD6HtTGJTZfZ1vvOsJiXkh4wtq2pANXlCFwKdYVMraRah91M/mBdNA+g== X-Received: by 10.107.41.148 with SMTP id p142mr30832959iop.182.1458022046689; Mon, 14 Mar 2016 23:07:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.154.19 with HTTP; Mon, 14 Mar 2016 23:07:07 -0700 (PDT) In-Reply-To: <20160315103718.4f36a909@zapp> References: <201603140705.u2E75fWT043502@repo.freebsd.org> <20160315103718.4f36a909@zapp> From: Wojciech Macek Date: Tue, 15 Mar 2016 07:07:07 +0100 Message-ID: Subject: Re: svn commit: r296825 - in head/sys: arm/conf arm/mv arm/mv/armada38x boot/fdt/dts/arm To: Andrew Turner Cc: Wojciech Macek , 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 06:07:27 -0000 Fixed in https://svnweb.freebsd.org/changeset/base/296893 2016-03-15 2:37 GMT+01:00 Andrew Turner : > On Mon, 14 Mar 2016 07:05:41 +0000 (UTC) > Wojciech Macek wrote: > > > Author: wma > > Date: Mon Mar 14 07:05:41 2016 > > New Revision: 296825 > > URL: https://svnweb.freebsd.org/changeset/base/296825 > > > > Log: > > Make MPIC compatible with ARM_INTRNG > > > > After ARM_INTRNG introduction, MPIC code needed several > > modifications: > > - IRQ resource and its handler added > > - several DEVMETHODs of INTRNG interface implemented > > - defines enhanced to ensure code compiles as well for AXP as for > > A38X > > - added dummy MSI_IRQ, ERR_IRQ defines for Armada38x > > - MPIC driver was added to files.armada38x, ARM_INTRNG option > > enabled in kernconf file and regs of MPIC corrected in dts file. > > > > Instead of modifying Armada38X DTS, offsets to CPU registers > > defined in driver were changed. That required restoring 'reg' > > property of mpic node in ArmadaXP to state compliant with Linux DTS. > > > > Additionally, required ARM_INTRNG definitions were added to > > mv_common.c. > > Submitted by: Bartosz Szczepanek > > Obtained from: Semihalf > > Sponsored by: Stormshield > > Reviewed by: adrian, andrew, ian, skra > > Approved by: cognet (mentor) > > Differential Revision: https://reviews.freebsd.org/D5030 > > > > Modified: > > head/sys/arm/conf/ARMADA38X > > head/sys/arm/mv/armada38x/files.armada38x > > head/sys/arm/mv/mpic.c > > head/sys/arm/mv/mvreg.h > > head/sys/boot/fdt/dts/arm/db78460.dts > > > > Modified: head/sys/arm/conf/ARMADA38X > > > ============================================================================== > > --- head/sys/arm/conf/ARMADA38X Mon Mar 14 06:30:37 > > 2016 (r296824) +++ head/sys/arm/conf/ARMADA38X Mon Mar > > 14 07:05:41 2016 (r296825) @@ -23,6 +23,7 @@ options > > SCHED_ULE # ULE scheduler #options > > SCHED_4BSD # 4BSD scheduler > > options SMP > > +options ARM_INTRNG > > This file already had ARM_INTRNG set. It now has it twice. > > Andrew > From owner-svn-src-head@freebsd.org Tue Mar 15 06:16:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A58E9AD1021; Tue, 15 Mar 2016 06:16:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3B29C13E3; Tue, 15 Mar 2016 06:16:46 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id n186so137276874wmn.1; Mon, 14 Mar 2016 23:16: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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3JKY9bOLCOwSQ7DWtE0i9y9c7fsqE+NKEur0E5c3NwM=; b=OWIwKjrQjg8u9gbkXkeISjBc1UkwIlO8EEFkdWG2L+Gizmpj+/zL0qLhsWFi0JM7c8 4Z79R38hIFcwA75y+MUplNZA5iFkQz/NPvqdHaSF/bqhkXkijBTll3P3R1xBuQ5ocvCW JPx3mPMKPfW0ECLeK6l1TviPig9pvZeZfnIiapntLi4nOm7eqxdCj1NnYZ9Dv3U6PNFG eoHuV6DVQ1Y4rrDZeaFcZPB3xrlddZ8EEjfhRAiX9K4AJxuXSRF4aMklO21YTGoAhyP6 QNWT7Cev1WLNf1nzJ8X0RXAXjdNwTz/HBC10peKhPukV1wXOrP9n2KI1t33b9vlaWVeB J6PQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=3JKY9bOLCOwSQ7DWtE0i9y9c7fsqE+NKEur0E5c3NwM=; b=R8kLNZZk7khU8RdlKoF/TarPTdt0EDodBiEoN10xnQ63mE98fwx+45W8KalncUc1HM vi8zvzJsXKeuPlfEjhKlDprW3zE2VCVxLiy10Wlo8slZO0F6tfzR4g3ceq2fEQnEvXu9 50ek/Ny8ZkT08OaGpYDsSMSxj/XxAQO6uoJ8qhpXLYEa67fRBkS61ipRgcOPGlS+Kzyz agSeJFnCUIv3j5fxS5No5MOIqII2kHDvmF+i9Cdf+j6SnpHYzX+1T5Ejx7PxXdPZicee TQnEj4A3XfgRg24/3tk8fNaHYDcRjWJ2tUnLkWThU9xCBpdyaubJ3MQigWPTF6XtUAVn mCNQ== X-Gm-Message-State: AD7BkJLkpedSn4SKe+FQJt1ActfAQD3SqYqWKeE8Oyz/Tqvrqavk7Bvv5pOHCGK3DQf5Zw== X-Received: by 10.194.6.36 with SMTP id x4mr28276672wjx.122.1458022604692; Mon, 14 Mar 2016 23:16:44 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id z6sm19209596wme.9.2016.03.14.23.16.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Mar 2016 23:16:43 -0700 (PDT) Sender: Baptiste Daroussin Date: Tue, 15 Mar 2016 07:16:41 +0100 From: Baptiste Daroussin To: Ed Maste Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296769 - in head/sys/boot/efi: boot1 loader Message-ID: <20160315061641.GI11339@ivaldir.etoilebsd.net> References: <201603122144.u2CLiXv5023698@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="1E1Oui4vdubnXi3o" Content-Disposition: inline In-Reply-To: <201603122144.u2CLiXv5023698@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 06:16:46 -0000 --1E1Oui4vdubnXi3o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 >=20 > Log: > boot/efi: Prefer nm to objdump > =20 > Both objdump and nm are equally capable of reporting undefined symbols. > =20 > This gets us a step closer to building without binutils as we have an nm > implementation from ELF Tool Chain. > =20 > Reviewed by: bdrewery > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > Differential Revision: https://reviews.freebsd.org/D5613 >=20 > Modified: > head/sys/boot/efi/boot1/Makefile > head/sys/boot/efi/loader/Makefile >=20 > Modified: head/sys/boot/efi/boot1/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/boot/efi/boot1/Makefile Sat Mar 12 20:05:23 2016 (r296768) > +++ head/sys/boot/efi/boot1/Makefile Sat Mar 12 21:44:33 2016 (r296769) > @@ -73,8 +73,8 @@ LDADD+=3D -lstand > =20 > DPADD+=3D ${LDSCRIPT} > =20 > +NM?=3D nm > OBJCOPY?=3D objcopy > -OBJDUMP?=3D objdump > =20 > .if ${MACHINE_CPUARCH} =3D=3D "amd64" > EFI_TARGET=3D efi-app-x86_64 > @@ -85,8 +85,8 @@ EFI_TARGET=3D binary > .endif > =20 > boot1.efi: ${PROG} > - if [ `${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*' | wc -l` !=3D 0 ]; then \ > - ${OBJDUMP} -t ${.ALLSRC} | fgrep '*UND*'; \ > + if ${NM} ${.ALLSRC} | grep ' U '; then \ grep -q maybe to avoid extra noise? Bapt --1E1Oui4vdubnXi3o Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW56i0AAoJEGOJi9zxtz5a+uQQAKNpUwDXswYgeQn0fJBmMRNW 3a2HRkBbDkmFsndjR8+dFqggdu+mVd7DdnKW9J4lwUfreh2eTh82Axh+fQgncOH5 NMke9mcPeUiKIYyidGxSgFOonMoBsToWofPr0l3lsb7MS8zBLbCmz6u/nrnxHJwD vKR1cJ4P9HEII6IK1vGuA57BPfJMtLKM0wkpLwgc+EP4CZlZqkbgsCmutXPeGCNi pru3jI75XbXEcGUws99YJH7xEBF2gJbuyDgQ5nm5RQbMME6d9FxNIP6dFMzd2yaH jkFXYbcyHZWtP+9q4cgWb3rGkCUQVM2tbfepZTnMbgfjaI/7OWXLjbtr9E8DgPiN wrox/kR+zCRvbwdcP3PYMHyFwas+7bjYo7LwNVXCVzg4tNno4Ti56Jr/vL8g84TH 0KfMCDZKCkn76asAHMPScmYRn+JQyq4MIlf6NmZDXt1vNbVo0bJ2gkhOBUkFfObs FrXoWkvdnIlqfTrwGK1tVDY0AbqqMAGzEfukRi8f9GzYx+pqmPzz1qVF/OeS3WSK ci/BqaBNL86u4VXJzcsXTC5T4qfkhNE3yWrg7z/hZHMsrnCrHplOY2q9uQKMpd4/ Jmsa6OhubtNiGSFeSDrm1hHuws26OkJRK5darfB+Uuk39nOJPbbORiDCdNPPfZRs XrTTjrTFIt4Y0MHf7xoC =8tXk -----END PGP SIGNATURE----- --1E1Oui4vdubnXi3o-- From owner-svn-src-head@freebsd.org Tue Mar 15 07:40:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1B984AD111C; Tue, 15 Mar 2016 07:40:53 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA69A88; Tue, 15 Mar 2016 07:40:52 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 0A7D01FE024; Tue, 15 Mar 2016 08:40:50 +0100 (CET) Subject: Re: svn commit: r296868 - head/sys/sys To: Gleb Smirnoff , Ryan Stone References: <201603141807.u2EI7xqm075602@repo.freebsd.org> <20160314203318.GL1328@FreeBSD.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56E7BD28.2000606@selasky.org> Date: Tue, 15 Mar 2016 08:43:36 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160314203318.GL1328@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 07:40:53 -0000 On 03/14/16 21:33, Gleb Smirnoff wrote: > On Mon, Mar 14, 2016 at 02:31:37PM -0400, Ryan Stone wrote: > R> On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff wrote: > R> > R> > Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. > R> > > R> > R> Is it useless? I believe that the point is to give a compiler error if an > R> incompatible pointer type was passed as the ptr parameter. > > Thanks for explanation! I will back out. > Hi, I added the casts to get more checks with regard to the type safety in the sysctls, because sysctl_add_oid() uses "void *". They are not useless. Maybe this should be explained in a comment somewhere? Similarly you'll find a set of sizeof() compile time assert checks for the static sysctls. --HPS From owner-svn-src-head@freebsd.org Tue Mar 15 07:47:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 32F91AD154F; Tue, 15 Mar 2016 07:47:36 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F166F758; Tue, 15 Mar 2016 07:47:35 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 2B7E61FE024; Tue, 15 Mar 2016 08:47:24 +0100 (CET) Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys To: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603150005.u2F050ps086390@repo.freebsd.org> From: Hans Petter Selasky Message-ID: <56E7BEB3.7020301@selasky.org> Date: Tue, 15 Mar 2016 08:50:11 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201603150005.u2F050ps086390@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 07:47:36 -0000 On 03/15/16 01:05, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 15 00:05:00 2016 > New Revision: 296880 > URL: https://svnweb.freebsd.org/changeset/base/296880 > > Log: > Provide sysctl(9) macro to deal with array of counter(9). > > Modified: > head/share/man/man9/counter.9 > head/sys/kern/subr_counter.c > head/sys/sys/sysctl.h > > Modified: head/sys/sys/sysctl.h > ============================================================================== > --- head/sys/sys/sysctl.h Mon Mar 14 23:49:16 2016 (r296879) > +++ head/sys/sys/sysctl.h Tue Mar 15 00:05:00 2016 (r296880) > @@ -204,6 +204,7 @@ int sysctl_handle_long(SYSCTL_HANDLER_AR > int sysctl_handle_string(SYSCTL_HANDLER_ARGS); > int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); > int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); > +int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS); > > int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); > int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); > @@ -648,6 +649,26 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e > __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ > }) > > +/* Oid for an array of counter(9)s. The pointer and length must be non zero. */ > +#define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \ > + SYSCTL_OID(parent, nbr, name, \ > + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ > + (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ > + CTASSERT(((access) & CTLTYPE) == 0 || \ > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > + Gleb: I suggest you follow the example of the other static SYSCTLs, and extend the CTASSERT to also cover the size of the array: CTASSERT(((access) & CTLTYPE) == 0 || \ (((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE && \ (sizeof(*(ptr)) == 8 * (len)))) > +#define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \ > + ptr, len, descr) \ > +({ \ > + counter_u64_t *__ptr = (ptr); \ > + CTASSERT(((access) & CTLTYPE) == 0 || \ > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ Same here possibly. Maybe extend the CTASSERT() to also cover the size of the array? Would limit the "len" to a constant argument though. > + sysctl_add_oid(ctx, parent, nbr, name, \ > + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ > + __ptr, len, sysctl_handle_counter_u64_array, "S", \ > + __DESCR(descr)); \ > +}) > + > /* Oid for an opaque object. Specified by a pointer and a length. */ > #define SYSCTL_OPAQUE(parent, nbr, name, access, ptr, len, fmt, descr) \ > SYSCTL_OID(parent, nbr, name, CTLTYPE_OPAQUE|(access), \ --HPS From owner-svn-src-head@freebsd.org Tue Mar 15 09:23:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DB15DAD1FE6; Tue, 15 Mar 2016 09:23:25 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail109.syd.optusnet.com.au (mail109.syd.optusnet.com.au [211.29.132.80]) by mx1.freebsd.org (Postfix) with ESMTP id A01D2DD0; Tue, 15 Mar 2016 09:23:25 +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 mail109.syd.optusnet.com.au (Postfix) with ESMTPS id A125FD6778E; Tue, 15 Mar 2016 20:04:23 +1100 (AEDT) Date: Tue, 15 Mar 2016 20:04:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Hans Petter Selasky cc: Gleb Smirnoff , Ryan Stone , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296868 - head/sys/sys In-Reply-To: <56E7BD28.2000606@selasky.org> Message-ID: <20160315192238.B1463@besplex.bde.org> References: <201603141807.u2EI7xqm075602@repo.freebsd.org> <20160314203318.GL1328@FreeBSD.org> <56E7BD28.2000606@selasky.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=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=WNfKXsEaDt8PeAfE1v8A:9 a=CjuIK1q_8ugA:10 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 09:23:26 -0000 On Tue, 15 Mar 2016, Hans Petter Selasky wrote: > On 03/14/16 21:33, Gleb Smirnoff wrote: >> On Mon, Mar 14, 2016 at 02:31:37PM -0400, Ryan Stone wrote: >> R> On Mon, Mar 14, 2016 at 2:07 PM, Gleb Smirnoff >> wrote: >> R> >> R> > Remove useless cast in SYSCTL_ADD_COUNTER_U64 macro. There was no cast here. >> R> Is it useless? I believe that the point is to give a compiler error if >> an >> R> incompatible pointer type was passed as the ptr parameter. >> >> Thanks for explanation! I will back out. > > I added the casts to get more checks with regard to the type safety in the > sysctls, because sysctl_add_oid() uses "void *". They are not useless. Casts would reduce type safety. You actually added assignments. Assignments to void * would be little different from conversions to the void * parameter, but the assignments are to uint64_t * so they detect most type differences except an initial type of void * which might be correct (the caller should have started with uint64_t *, and it is too late to detect the error if the caller started with something like const volatile int32_t * and subverted this to void *. But if the sysctl is read-only, subverting its pointer from const int64_t * to int64_t * might be needed since lower levels don't support const). > Maybe this should be explained in a comment somewhere? A comment is not a place to explain what a cast is. The assignment doesn't work for what should the usual case of a static initializer. I don't see a good way to fix this. A not so good way is to add a union holding int *, long *, etc. to the sysctl data. Then for SYSCTL_INT() assign the pointer to the the int * union member, etc. Bruce From owner-svn-src-head@freebsd.org Tue Mar 15 11:03:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C556ACFA2B; Tue, 15 Mar 2016 11:03:47 +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 17D41D7A; Tue, 15 Mar 2016 11:03:47 +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 u2FB3kql088404; Tue, 15 Mar 2016 11:03:46 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FB3jYc088401; Tue, 15 Mar 2016 11:03:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603151103.u2FB3jYc088401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 15 Mar 2016 11:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296897 - in head/usr.sbin: autofs ctld iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 11:03:47 -0000 Author: trasz Date: Tue Mar 15 11:03:45 2016 New Revision: 296897 URL: https://svnweb.freebsd.org/changeset/base/296897 Log: Use the log_errno value passed to the function instead of the errno global variable. Suggested by: Daniel Braniss MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/autofs/log.c head/usr.sbin/ctld/log.c head/usr.sbin/iscsid/log.c Modified: head/usr.sbin/autofs/log.c ============================================================================== --- head/usr.sbin/autofs/log.c Tue Mar 15 10:45:55 2016 (r296896) +++ head/usr.sbin/autofs/log.c Tue Mar 15 11:03:45 2016 (r296897) @@ -88,6 +88,7 @@ log_common(int priority, int log_errno, { static char msgbuf[MSGBUF_LEN]; static char msgbuf_strvised[MSGBUF_LEN * 4 + 1]; + char *errstr; int ret; ret = vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); @@ -121,21 +122,23 @@ log_common(int priority, int log_errno, } } else { + errstr = strerror(log_errno); + if (peer_name != NULL) { fprintf(stderr, "%s: %s (%s): %s: %s\n", getprogname(), - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); syslog(priority, "%s (%s): %s: %s", - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); } else if (peer_addr != NULL) { fprintf(stderr, "%s: %s: %s: %s\n", getprogname(), - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); syslog(priority, "%s: %s: %s", - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); } else { fprintf(stderr, "%s: %s: %s\n", getprogname(), - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); syslog(priority, "%s: %s", - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); } } } Modified: head/usr.sbin/ctld/log.c ============================================================================== --- head/usr.sbin/ctld/log.c Tue Mar 15 10:45:55 2016 (r296896) +++ head/usr.sbin/ctld/log.c Tue Mar 15 11:03:45 2016 (r296897) @@ -88,6 +88,7 @@ log_common(int priority, int log_errno, { static char msgbuf[MSGBUF_LEN]; static char msgbuf_strvised[MSGBUF_LEN * 4 + 1]; + char *errstr; int ret; ret = vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); @@ -121,21 +122,23 @@ log_common(int priority, int log_errno, } } else { + errstr = strerror(log_errno); + if (peer_name != NULL) { fprintf(stderr, "%s: %s (%s): %s: %s\n", getprogname(), - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); syslog(priority, "%s (%s): %s: %s", - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); } else if (peer_addr != NULL) { fprintf(stderr, "%s: %s: %s: %s\n", getprogname(), - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); syslog(priority, "%s: %s: %s", - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); } else { fprintf(stderr, "%s: %s: %s\n", getprogname(), - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); syslog(priority, "%s: %s", - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); } } } Modified: head/usr.sbin/iscsid/log.c ============================================================================== --- head/usr.sbin/iscsid/log.c Tue Mar 15 10:45:55 2016 (r296896) +++ head/usr.sbin/iscsid/log.c Tue Mar 15 11:03:45 2016 (r296897) @@ -88,6 +88,7 @@ log_common(int priority, int log_errno, { static char msgbuf[MSGBUF_LEN]; static char msgbuf_strvised[MSGBUF_LEN * 4 + 1]; + char *errstr; int ret; ret = vsnprintf(msgbuf, sizeof(msgbuf), fmt, ap); @@ -121,21 +122,23 @@ log_common(int priority, int log_errno, } } else { + errstr = strerror(log_errno); + if (peer_name != NULL) { fprintf(stderr, "%s: %s (%s): %s: %s\n", getprogname(), - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); syslog(priority, "%s (%s): %s: %s", - peer_addr, peer_name, msgbuf_strvised, strerror(errno)); + peer_addr, peer_name, msgbuf_strvised, errstr); } else if (peer_addr != NULL) { fprintf(stderr, "%s: %s: %s: %s\n", getprogname(), - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); syslog(priority, "%s: %s: %s", - peer_addr, msgbuf_strvised, strerror(errno)); + peer_addr, msgbuf_strvised, errstr); } else { fprintf(stderr, "%s: %s: %s\n", getprogname(), - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); syslog(priority, "%s: %s", - msgbuf_strvised, strerror(errno)); + msgbuf_strvised, errstr); } } } From owner-svn-src-head@freebsd.org Tue Mar 15 11:10:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A4CA8ACFE2D; Tue, 15 Mar 2016 11:10:09 +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 733F01341; Tue, 15 Mar 2016 11:10:09 +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 u2FBA8Rs088651; Tue, 15 Mar 2016 11:10:08 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FBA83n088650; Tue, 15 Mar 2016 11:10:08 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603151110.u2FBA83n088650@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 15 Mar 2016 11:10:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296898 - head/usr.sbin/iscsid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 11:10:09 -0000 Author: trasz Date: Tue Mar 15 11:10:08 2016 New Revision: 296898 URL: https://svnweb.freebsd.org/changeset/base/296898 Log: Make fail() preserve the errno. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/usr.sbin/iscsid/iscsid.c Modified: head/usr.sbin/iscsid/iscsid.c ============================================================================== --- head/usr.sbin/iscsid/iscsid.c Tue Mar 15 11:03:45 2016 (r296897) +++ head/usr.sbin/iscsid/iscsid.c Tue Mar 15 11:10:08 2016 (r296898) @@ -290,7 +290,9 @@ void fail(const struct connection *conn, const char *reason) { struct iscsi_daemon_fail idf; - int error; + int error, saved_errno; + + saved_errno = errno; memset(&idf, 0, sizeof(idf)); idf.idf_session_id = conn->conn_session_id; @@ -299,6 +301,8 @@ fail(const struct connection *conn, cons error = ioctl(conn->conn_iscsi_fd, ISCSIDFAIL, &idf); if (error != 0) log_err(1, "ISCSIDFAIL"); + + errno = saved_errno; } /* From owner-svn-src-head@freebsd.org Tue Mar 15 15:19:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84ADCAD2E09; Tue, 15 Mar 2016 15:19:40 +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 5DA86F46; Tue, 15 Mar 2016 15:19:40 +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 u2FDcFOY036865; Tue, 15 Mar 2016 13:38:15 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FDcF5I036861; Tue, 15 Mar 2016 13:38:15 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603151338.u2FDcF5I036861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Mar 2016 13:38:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296899 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:19:40 -0000 Author: emaste Date: Tue Mar 15 13:38:15 2016 New Revision: 296899 URL: https://svnweb.freebsd.org/changeset/base/296899 Log: Fix atkbdmap.h generation for sc/vt consoles Keymap header files have historically been generated using the build host's /usr/sbin/kbdcontrol and using the host's keymap files. However, that introduces an issue when building a kernel to use vt(4) on a system using sc(4), or vice versa: kbdcontrol searches for keymap files in the /usr/share subdirectory appropriate for the host, not the target. With this change the build searches both the and sc keymap directories from the source tree. PR: 193865 Submitted by: Harald Schmalzbauer Modified: head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/conf/files.pc98 head/sys/conf/files.sparc64 Modified: head/sys/conf/files.amd64 ============================================================================== --- head/sys/conf/files.amd64 Tue Mar 15 11:10:08 2016 (r296898) +++ head/sys/conf/files.amd64 Tue Mar 15 13:38:15 2016 (r296899) @@ -50,12 +50,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.i386 ============================================================================== --- head/sys/conf/files.i386 Tue Mar 15 11:10:08 2016 (r296898) +++ head/sys/conf/files.i386 Tue Mar 15 13:38:15 2016 (r296899) @@ -49,12 +49,12 @@ font.h optional sc_dflt_font \ clean "font.h ${SC_DFLT_FONT}-8x14 ${SC_DFLT_FONT}-8x16 ${SC_DFLT_FONT}-8x8" # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Mar 15 11:10:08 2016 (r296898) +++ head/sys/conf/files.pc98 Tue Mar 15 13:38:15 2016 (r296899) @@ -46,7 +46,7 @@ svr4_assym.h optional compat_svr4 \ clean "svr4_assym.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # Modified: head/sys/conf/files.sparc64 ============================================================================== --- head/sys/conf/files.sparc64 Tue Mar 15 11:10:08 2016 (r296898) +++ head/sys/conf/files.sparc64 Tue Mar 15 13:38:15 2016 (r296899) @@ -8,17 +8,17 @@ # dependency lines other than the first are silently ignored. # atkbdmap.h optional atkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${ATKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > atkbdmap.h; else echo Error: atkbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "atkbdmap.h" # sunkbdmap.h optional sunkbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${SUNKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${SUNKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > sunkbdmap.h; else echo Error: sunkbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "sunkbdmap.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "/usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # From owner-svn-src-head@freebsd.org Tue Mar 15 15:24:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D245CAD1587; Tue, 15 Mar 2016 15:24:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 8A46E1B3A; Tue, 15 Mar 2016 15:24:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFOIDh071190; Tue, 15 Mar 2016 15:24:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFOIb3071188; Tue, 15 Mar 2016 15:24:18 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151524.u2FFOIb3071188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:24:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296901 - in head/sys/dev: gpio ofw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:24:19 -0000 Author: mmel Date: Tue Mar 15 15:24:18 2016 New Revision: 296901 URL: https://svnweb.freebsd.org/changeset/base/296901 Log: Use EARLY_DRIVER_MODULE() with BUS_PASS_BUS priority for ofw_gpiobus and ofw_iicbus. This causes enumeration of gpiobus/iicbus at the base driver attach time. Due to this, childern drivers can be also attached early. Modified: head/sys/dev/gpio/ofw_gpiobus.c head/sys/dev/ofw/ofw_iicbus.c Modified: head/sys/dev/gpio/ofw_gpiobus.c ============================================================================== --- head/sys/dev/gpio/ofw_gpiobus.c Tue Mar 15 15:24:14 2016 (r296900) +++ head/sys/dev/gpio/ofw_gpiobus.c Tue Mar 15 15:24:18 2016 (r296901) @@ -575,6 +575,7 @@ static devclass_t ofwgpiobus_devclass; DEFINE_CLASS_1(gpiobus, ofw_gpiobus_driver, ofw_gpiobus_methods, sizeof(struct gpiobus_softc), gpiobus_driver); -DRIVER_MODULE(ofw_gpiobus, gpio, ofw_gpiobus_driver, ofwgpiobus_devclass, 0, 0); +EARLY_DRIVER_MODULE(ofw_gpiobus, gpio, ofw_gpiobus_driver, ofwgpiobus_devclass, + 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_gpiobus, 1); MODULE_DEPEND(ofw_gpiobus, gpiobus, 1, 1, 1); Modified: head/sys/dev/ofw/ofw_iicbus.c ============================================================================== --- head/sys/dev/ofw/ofw_iicbus.c Tue Mar 15 15:24:14 2016 (r296900) +++ head/sys/dev/ofw/ofw_iicbus.c Tue Mar 15 15:24:18 2016 (r296901) @@ -80,8 +80,10 @@ static devclass_t ofwiicbus_devclass; DEFINE_CLASS_1(iicbus, ofw_iicbus_driver, ofw_iicbus_methods, sizeof(struct iicbus_softc), iicbus_driver); -DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); -DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, 0, 0); +EARLY_DRIVER_MODULE(ofw_iicbus, iicbb, ofw_iicbus_driver, ofwiicbus_devclass, + 0, 0, BUS_PASS_BUS); +EARLY_DRIVER_MODULE(ofw_iicbus, iichb, ofw_iicbus_driver, ofwiicbus_devclass, + 0, 0, BUS_PASS_BUS); MODULE_VERSION(ofw_iicbus, 1); MODULE_DEPEND(ofw_iicbus, iicbus, 1, 1, 1); From owner-svn-src-head@freebsd.org Tue Mar 15 15:24:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 852E1AD1611; Tue, 15 Mar 2016 15:24:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3E7EA1DDD; Tue, 15 Mar 2016 15:24:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFOtGe071254; Tue, 15 Mar 2016 15:24:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFOtIO071253; Tue, 15 Mar 2016 15:24:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603151524.u2FFOtIO071253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Mar 2016 15:24:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296902 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:24:56 -0000 Author: hselasky Date: Tue Mar 15 15:24:55 2016 New Revision: 296902 URL: https://svnweb.freebsd.org/changeset/base/296902 Log: Improve detection of extended QSFP diagnostics. The standards in the QSFP diagnostics area are not clear when the additional measurements are present or not. Use a valid temperature reading as an indicator for the presence of voltage and TX/RX power measurements. MFC after: 1 week Sponsored by: Mellanox Technologies Tested by: Netflix Differential Revision: https://reviews.freebsd.org/D5391 Reviewed by: gallatin Modified: head/sbin/ifconfig/sfp.c Modified: head/sbin/ifconfig/sfp.c ============================================================================== --- head/sbin/ifconfig/sfp.c Tue Mar 15 15:24:18 2016 (r296901) +++ head/sbin/ifconfig/sfp.c Tue Mar 15 15:24:55 2016 (r296902) @@ -625,14 +625,17 @@ get_sfp_voltage(struct i2c_info *ii, cha convert_sff_voltage(buf, size, xbuf); } -static void +static int get_qsfp_temp(struct i2c_info *ii, char *buf, size_t size) { uint8_t xbuf[2]; memset(xbuf, 0, sizeof(xbuf)); read_i2c(ii, SFF_8436_BASE, SFF_8436_TEMP, 2, xbuf); + if ((xbuf[0] == 0xFF && xbuf[1] == 0xFF) || (xbuf[0] == 0 && xbuf[1] == 0)) + return (-1); convert_sff_temp(buf, size, xbuf); + return (0); } static void @@ -779,22 +782,9 @@ static void print_qsfp_status(struct i2c_info *ii, int verbose) { char buf[80], buf2[40], buf3[40]; - uint8_t diag_type; uint32_t bitrate; int i; - /* Read diagnostic monitoring type */ - read_i2c(ii, SFF_8436_BASE, SFF_8436_DIAG_TYPE, 1, (caddr_t)&diag_type); - if (ii->error != 0) - return; - - /* - * Read monitoring data it is supplied. - * XXX: It is not exactly clear from standard - * how one can specify lack of measurements (passive cables case). - */ - if (diag_type != 0) - ii->do_diag = 1; ii->qsfp = 1; /* Transceiver type */ @@ -817,9 +807,13 @@ print_qsfp_status(struct i2c_info *ii, i printf("\tnominal bitrate: %u Mbps\n", bitrate); } - /* Request current measurements if they are provided: */ - if (ii->do_diag != 0) { - get_qsfp_temp(ii, buf, sizeof(buf)); + /* + * The standards in this area are not clear when the + * additional measurements are present or not. Use a valid + * temperature reading as an indicator for the presence of + * voltage and TX/RX power measurements. + */ + if (get_qsfp_temp(ii, buf, sizeof(buf)) == 0) { get_qsfp_voltage(ii, buf2, sizeof(buf2)); printf("\tmodule temperature: %s voltage: %s\n", buf, buf2); for (i = 1; i <= 4; i++) { From owner-svn-src-head@freebsd.org Tue Mar 15 15:25:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3E294AD16EC; Tue, 15 Mar 2016 15:25:28 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E7DB41FD9; Tue, 15 Mar 2016 15:25:27 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFPQGh071366; Tue, 15 Mar 2016 15:25:26 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFPQaY071364; Tue, 15 Mar 2016 15:25:26 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151525.u2FFPQaY071364@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:25:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296903 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:25:28 -0000 Author: mmel Date: Tue Mar 15 15:25:26 2016 New Revision: 296903 URL: https://svnweb.freebsd.org/changeset/base/296903 Log: CLK: Remove forgotten mutex from clk_fixed class. Modified: head/sys/dev/extres/clk/clk_fixed.c head/sys/dev/extres/clk/clk_fixed.h Modified: head/sys/dev/extres/clk/clk_fixed.c ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.c Tue Mar 15 15:24:55 2016 (r296902) +++ head/sys/dev/extres/clk/clk_fixed.c Tue Mar 15 15:25:26 2016 (r296903) @@ -42,13 +42,9 @@ __FBSDID("$FreeBSD$"); #include -#define DEVICE_LOCK(_sc) mtx_lock((_sc)->mtx) -#define DEVICE_UNLOCK(_sc) mtx_unlock((_sc)->mtx) - static int clknode_fixed_init(struct clknode *clk, device_t dev); static int clknode_fixed_recalc(struct clknode *clk, uint64_t *freq); struct clknode_fixed_sc { - struct mtx *mtx; int fixed_flags; uint64_t freq; uint32_t mult; @@ -74,6 +70,7 @@ clknode_fixed_init(struct clknode *clk, clknode_init_parent_idx(clk, 0); return(0); } + static int clknode_fixed_recalc(struct clknode *clk, uint64_t *freq) { @@ -90,8 +87,7 @@ clknode_fixed_recalc(struct clknode *clk } int -clknode_fixed_register(struct clkdom *clkdom, struct clk_fixed_def *clkdef, - struct mtx *dev_mtx) +clknode_fixed_register(struct clkdom *clkdom, struct clk_fixed_def *clkdef) { struct clknode *clk; struct clknode_fixed_sc *sc; @@ -103,7 +99,6 @@ clknode_fixed_register(struct clkdom *cl return (1); sc = clknode_get_softc(clk); - sc->mtx = dev_mtx; sc->fixed_flags = clkdef->fixed_flags; sc->freq = clkdef->freq; sc->mult = clkdef->mult; Modified: head/sys/dev/extres/clk/clk_fixed.h ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.h Tue Mar 15 15:24:55 2016 (r296902) +++ head/sys/dev/extres/clk/clk_fixed.h Tue Mar 15 15:25:26 2016 (r296903) @@ -47,7 +47,6 @@ struct clk_fixed_def { int fixed_flags; }; -int clknode_fixed_register(struct clkdom *clkdom, struct clk_fixed_def *clkdef, - struct mtx *dev_mtx); +int clknode_fixed_register(struct clkdom *clkdom, struct clk_fixed_def *clkdef); #endif /*_DEV_EXTRES_CLK_FIXED_H_*/ From owner-svn-src-head@freebsd.org Tue Mar 15 15:27:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A93C8AD1870; Tue, 15 Mar 2016 15:27:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 77A8111D5; Tue, 15 Mar 2016 15:27:17 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFRGsF071473; Tue, 15 Mar 2016 15:27:16 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFRGA7071468; Tue, 15 Mar 2016 15:27:16 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151527.u2FFRGA7071468@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:27:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296904 - in head/sys: conf 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:27:17 -0000 Author: mmel Date: Tue Mar 15 15:27:15 2016 New Revision: 296904 URL: https://svnweb.freebsd.org/changeset/base/296904 Log: CLK: Add enumerator for 'clocks' OFW node. Add bus device bindings for clk_fixed class. Added: head/sys/dev/extres/clk/clk_bus.c (contents, props changed) Modified: head/sys/conf/files head/sys/dev/extres/clk/clk.c head/sys/dev/extres/clk/clk.h head/sys/dev/extres/clk/clk_fixed.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 15 15:25:26 2016 (r296903) +++ head/sys/conf/files Tue Mar 15 15:27:15 2016 (r296904) @@ -1413,6 +1413,7 @@ dev/exca/exca.c optional cbb dev/extres/clk/clk.c optional ext_resources clk dev/extres/clk/clkdev_if.m optional ext_resources clk dev/extres/clk/clknode_if.m optional ext_resources clk +dev/extres/clk/clk_bus.c optional ext_resources clk fdt dev/extres/clk/clk_div.c optional ext_resources clk dev/extres/clk/clk_fixed.c optional ext_resources clk dev/extres/clk/clk_gate.c optional ext_resources clk Modified: head/sys/dev/extres/clk/clk.c ============================================================================== --- head/sys/dev/extres/clk/clk.c Tue Mar 15 15:25:26 2016 (r296903) +++ head/sys/dev/extres/clk/clk.c Tue Mar 15 15:27:15 2016 (r296904) @@ -1258,4 +1258,75 @@ clk_get_by_ofw_name(device_t dev, const return (rv); return (clk_get_by_ofw_index(dev, idx, clk)); } + +/* -------------------------------------------------------------------------- + * + * Support functions for parsing various clock related OFW things. + */ + +/* + * Get "clock-output-names" and (optional) "clock-indices" lists. + * Both lists are alocated using M_OFWPROP specifier. + * + * Returns number of items or 0. + */ +int +clk_parse_ofw_out_names(device_t dev, phandle_t node, const char ***out_names, + uint32_t *indices) +{ + int name_items, rv; + + *out_names = NULL; + indices = NULL; + if (!OF_hasprop(node, "clock-output-names")) + return (0); + rv = ofw_bus_string_list_to_array(node, "clock-output-names", + out_names); + if (rv <= 0) + return (0); + name_items = rv; + + if (!OF_hasprop(node, "clock-indices")) + return (name_items); + rv = OF_getencprop_alloc(node, "clock-indices", sizeof (uint32_t), + (void **)indices); + if (rv != name_items) { + device_printf(dev, " Size of 'clock-output-names' and " + "'clock-indices' differs\n"); + free(*out_names, M_OFWPROP); + free(indices, M_OFWPROP); + return (0); + } + return (name_items); +} + +/* + * Get output clock name for single output clock node. + */ +int +clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name) +{ + const char **out_names; + const char *tmp_name; + int rv; + + *name = NULL; + if (!OF_hasprop(node, "clock-output-names")) { + tmp_name = ofw_bus_get_name(dev); + if (tmp_name == NULL) + return (ENXIO); + *name = strdup(tmp_name, M_OFWPROP); + return (0); + } + rv = ofw_bus_string_list_to_array(node, "clock-output-names", + &out_names); + if (rv != 1) { + free(out_names, M_OFWPROP); + device_printf(dev, "Malformed 'clock-output-names' property\n"); + return (ENXIO); + } + *name = strdup(out_names[0], M_OFWPROP); + free(out_names, M_OFWPROP); + return (0); +} #endif Modified: head/sys/dev/extres/clk/clk.h ============================================================================== --- head/sys/dev/extres/clk/clk.h Tue Mar 15 15:25:26 2016 (r296903) +++ head/sys/dev/extres/clk/clk.h Tue Mar 15 15:27:15 2016 (r296904) @@ -131,6 +131,9 @@ const char *clk_get_name(clk_t clk); #ifdef FDT 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); +int clk_parse_ofw_clk_name(device_t dev, phandle_t node, const char **name); #endif #endif /* _DEV_EXTRES_CLK_H_ */ Added: head/sys/dev/extres/clk/clk_bus.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/clk/clk_bus.c Tue Mar 15 15:27:15 2016 (r296904) @@ -0,0 +1,93 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include + +#include + +#include +#include + +struct ofw_clkbus_softc { + struct simplebus_softc simplebus_sc; +}; + +static int +ofw_clkbus_probe(device_t dev) +{ + const char *name; + + name = ofw_bus_get_name(dev); + + if (name == NULL || strcmp(name, "clocks") != 0) + return (ENXIO); + + device_set_desc(dev, "OFW clocks bus"); + + return (0); +} + +static int +ofw_clkbus_attach(device_t dev) +{ + struct ofw_clkbus_softc *sc; + phandle_t node, child; + device_t cdev; + + sc = device_get_softc(dev); + node = ofw_bus_get_node(dev); + simplebus_init(dev, node); + + for (child = OF_child(node); child > 0; child = OF_peer(child)) { + cdev = simplebus_add_device(dev, child, 0, NULL, -1, NULL); + if (cdev != NULL) + device_probe_and_attach(cdev); + } + + return (bus_generic_attach(dev)); +} + +static device_method_t ofw_clkbus_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, ofw_clkbus_probe), + DEVMETHOD(device_attach, ofw_clkbus_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_1(ofw_clkbus, ofw_clkbus_driver, ofw_clkbus_methods, + sizeof(struct ofw_clkbus_softc), simplebus_driver); +static devclass_t ofw_clkbus_devclass; +EARLY_DRIVER_MODULE(ofw_clkbus, simplebus, ofw_clkbus_driver, + ofw_clkbus_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(ofw_clkbus, 1); Modified: head/sys/dev/extres/clk/clk_fixed.c ============================================================================== --- head/sys/dev/extres/clk/clk_fixed.c Tue Mar 15 15:25:26 2016 (r296903) +++ head/sys/dev/extres/clk/clk_fixed.c Tue Mar 15 15:27:15 2016 (r296904) @@ -27,7 +27,6 @@ #include __FBSDID("$FreeBSD$"); - #include #include #include @@ -35,15 +34,24 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include +#include +#include #include +#define CLK_TYPE_FIXED 1 +#define CLK_TYPE_FIXED_FACTOR 2 + static int clknode_fixed_init(struct clknode *clk, device_t dev); static int clknode_fixed_recalc(struct clknode *clk, uint64_t *freq); +static int clknode_fixed_set_freq(struct clknode *clk, uint64_t fin, + uint64_t *fout, int flags, int *stop); + struct clknode_fixed_sc { int fixed_flags; uint64_t freq; @@ -55,6 +63,7 @@ static clknode_method_t clknode_fixed_me /* Device interface */ CLKNODEMETHOD(clknode_init, clknode_fixed_init), CLKNODEMETHOD(clknode_recalc_freq, clknode_fixed_recalc), + CLKNODEMETHOD(clknode_set_freq, clknode_fixed_set_freq), CLKNODEMETHOD_END }; DEFINE_CLASS_1(clknode_fixed, clknode_fixed_class, clknode_fixed_methods, @@ -77,12 +86,31 @@ clknode_fixed_recalc(struct clknode *clk struct clknode_fixed_sc *sc; sc = clknode_get_softc(clk); - if (sc->freq != 0) - *freq = sc->freq; - else if ((sc->mult != 0) && (sc->div != 0)) + + if ((sc->mult != 0) && (sc->div != 0)) *freq = (*freq / sc->div) * sc->mult; else - *freq = 0; + *freq = sc->freq; + return (0); +} + +static int +clknode_fixed_set_freq(struct clknode *clk, uint64_t fin, uint64_t *fout, + int flags, int *stop) +{ + struct clknode_fixed_sc *sc; + + sc = clknode_get_softc(clk); + if (sc->mult == 0 || sc->div == 0) { + /* Fixed frequency clock. */ + *stop = 1; + if (*fout != sc->freq) + return (ERANGE); + return (0); + } + /* Fixed factor clock. */ + *stop = 0; + *fout = (*fout / sc->mult) * sc->div; return (0); } @@ -92,8 +120,6 @@ clknode_fixed_register(struct clkdom *cl struct clknode *clk; struct clknode_fixed_sc *sc; - if ((clkdef->freq == 0) && (clkdef->clkdef.parent_cnt == 0)) - panic("fixed clk: Frequency is not defined for clock source"); clk = clknode_create(clkdom, &clknode_fixed_class, &clkdef->clkdef); if (clk == NULL) return (1); @@ -107,3 +133,143 @@ clknode_fixed_register(struct clkdom *cl clknode_register(clkdom, clk); return (0); } + +#ifdef FDT + +static struct ofw_compat_data compat_data[] = { + {"fixed-clock", CLK_TYPE_FIXED}, + {"fixed-factor-clock", CLK_TYPE_FIXED_FACTOR}, + {NULL, 0}, +}; + +struct clk_fixed_softc { + device_t dev; + struct clkdom *clkdom; +}; + +static int +clk_fixed_probe(device_t dev) +{ + + if (ofw_bus_search_compatible(dev, compat_data)->ocd_data != 0) { + device_set_desc(dev, "Fixed clock"); + return (BUS_PROBE_DEFAULT); + } + return (ENXIO); +} + +static int +clk_fixed_init_fixed(struct clk_fixed_softc *sc, phandle_t node, + struct clk_fixed_def *def) +{ + uint32_t freq; + int rv; + + def->clkdef.id = 1; + rv = OF_getencprop(node, "clock-frequency", &freq, sizeof(freq)); + if (rv <= 0) + return (ENXIO); + def->freq = freq; + return (0); +} + +static int +clk_fixed_init_fixed_factor(struct clk_fixed_softc *sc, phandle_t node, + struct clk_fixed_def *def) +{ + int rv; + clk_t parent; + + def->clkdef.id = 1; + 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)); + if (rv <= 0) + return (ENXIO); + /* Get name of parent clock */ + rv = clk_get_by_ofw_name(sc->dev, "clocks", &parent); + if (rv != 0) + return (ENXIO); + def->clkdef.parent_names = malloc(sizeof(char *), M_OFWPROP, M_WAITOK); + def->clkdef.parent_names[0] = clk_get_name(parent); + def->clkdef.parent_cnt = 1; + clk_release(parent); + return (0); +} + +static int +clk_fixed_attach(device_t dev) +{ + struct clk_fixed_softc *sc; + intptr_t clk_type; + phandle_t node; + struct clk_fixed_def def; + int rv; + + sc = device_get_softc(dev); + sc->dev = dev; + node = ofw_bus_get_node(dev); + clk_type = ofw_bus_search_compatible(dev, compat_data)->ocd_data; + + bzero(&def, sizeof(def)); + if (clk_type == CLK_TYPE_FIXED) + rv = clk_fixed_init_fixed(sc, node, &def); + else if (clk_type == CLK_TYPE_FIXED_FACTOR) + rv = clk_fixed_init_fixed_factor(sc, node, &def); + else + rv = ENXIO; + if (rv != 0) { + device_printf(sc->dev, "Cannot FDT parameters.\n"); + goto fail; + } + rv = clk_parse_ofw_clk_name(dev, node, &def.clkdef.name); + if (rv != 0) { + device_printf(sc->dev, "Cannot parse clock name.\n"); + goto fail; + } + sc->clkdom = clkdom_create(dev); + KASSERT(sc->clkdom != NULL, ("Clock domain is NULL")); + + rv = clknode_fixed_register(sc->clkdom, &def); + if (rv != 0) { + device_printf(sc->dev, "Cannot register fixed clock.\n"); + rv = ENXIO; + goto fail; + } + + rv = clkdom_finit(sc->clkdom); + if (rv != 0) { + device_printf(sc->dev, "Clk domain finit fails.\n"); + rv = ENXIO; + goto fail; + } +#ifdef CLK_DEBUG + clkdom_dump(sc->clkdom); +#endif + free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + free(def.clkdef.parent_names, M_OFWPROP); + return (bus_generic_attach(dev)); + +fail: + free(__DECONST(char *, def.clkdef.name), M_OFWPROP); + free(def.clkdef.parent_names, M_OFWPROP); + return (rv); +} + +static device_method_t clk_fixed_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, clk_fixed_probe), + DEVMETHOD(device_attach, clk_fixed_attach), + + DEVMETHOD_END +}; + +DEFINE_CLASS_0(clk_fixed, clk_fixed_driver, clk_fixed_methods, + sizeof(struct clk_fixed_softc)); +static devclass_t clk_fixed_devclass; +EARLY_DRIVER_MODULE(clk_fixed, simplebus, clk_fixed_driver, + clk_fixed_devclass, 0, 0, BUS_PASS_BUS + BUS_PASS_ORDER_MIDDLE); +MODULE_VERSION(clk_fixed, 1); + +#endif From owner-svn-src-head@freebsd.org Tue Mar 15 15:28:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 37972AD1953; Tue, 15 Mar 2016 15:28:26 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EDDB914BD; Tue, 15 Mar 2016 15:28:25 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFSOj0071558; Tue, 15 Mar 2016 15:28:24 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFSOi5071554; Tue, 15 Mar 2016 15:28:24 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151528.u2FFSOi5071554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:28:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296905 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:28:26 -0000 Author: mmel Date: Tue Mar 15 15:28:24 2016 New Revision: 296905 URL: https://svnweb.freebsd.org/changeset/base/296905 Log: CLK: Add and use explicit locking for access to clock device registers. Implicit locking (for read/write/modify) is not sufficient for complex cases. Modified: head/sys/dev/extres/clk/clk_div.c head/sys/dev/extres/clk/clk_gate.c head/sys/dev/extres/clk/clk_mux.c head/sys/dev/extres/clk/clkdev_if.m Modified: head/sys/dev/extres/clk/clk_div.c ============================================================================== --- head/sys/dev/extres/clk/clk_div.c Tue Mar 15 15:27:15 2016 (r296904) +++ head/sys/dev/extres/clk/clk_div.c Tue Mar 15 15:28:24 2016 (r296905) @@ -46,6 +46,10 @@ __FBSDID("$FreeBSD$"); CLKDEV_READ_4(clknode_get_device(_clk), off, val) #define MD4(_clk, off, clr, set ) \ CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) static int clknode_div_init(struct clknode *clk, device_t dev); static int clknode_div_recalc(struct clknode *clk, uint64_t *req); @@ -86,7 +90,9 @@ clknode_div_init(struct clknode *clk, de sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); rv = RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); if (rv != 0) return (rv); @@ -171,12 +177,17 @@ clknode_div_set_freq(struct clknode *clk (*fout != (_fin / divider))) return (ERANGE); + DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, (sc->i_mask << sc->i_shift) | (sc->f_mask << sc->f_shift), (i_div << sc->i_shift) | (f_div << sc->f_shift)); - if (rv != 0) + if (rv != 0) { + DEVICE_UNLOCK(clk); return (rv); + } RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); + sc->divider = divider; } Modified: head/sys/dev/extres/clk/clk_gate.c ============================================================================== --- head/sys/dev/extres/clk/clk_gate.c Tue Mar 15 15:27:15 2016 (r296904) +++ head/sys/dev/extres/clk/clk_gate.c Tue Mar 15 15:28:24 2016 (r296905) @@ -46,7 +46,10 @@ __FBSDID("$FreeBSD$"); CLKDEV_READ_4(clknode_get_device(_clk), off, val) #define MD4(_clk, off, clr, set ) \ CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) - +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) static int clknode_gate_init(struct clknode *clk, device_t dev); static int clknode_gate_set_gate(struct clknode *clk, bool enable); @@ -77,7 +80,9 @@ clknode_gate_init(struct clknode *clk, d int rv; sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); rv = RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); if (rv != 0) return (rv); reg = (reg >> sc->shift) & sc->mask; @@ -95,11 +100,15 @@ clknode_gate_set_gate(struct clknode *cl sc = clknode_get_softc(clk); sc->ungated = enable; + DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, sc->mask << sc->shift, (sc->ungated ? sc->on_value : sc->off_value) << sc->shift); - if (rv != 0) + if (rv != 0) { + DEVICE_UNLOCK(clk); return (rv); + } RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); return(0); } Modified: head/sys/dev/extres/clk/clk_mux.c ============================================================================== --- head/sys/dev/extres/clk/clk_mux.c Tue Mar 15 15:27:15 2016 (r296904) +++ head/sys/dev/extres/clk/clk_mux.c Tue Mar 15 15:28:24 2016 (r296905) @@ -46,6 +46,10 @@ __FBSDID("$FreeBSD$"); CLKDEV_READ_4(clknode_get_device(_clk), off, val) #define MD4(_clk, off, clr, set ) \ CLKDEV_MODIFY_4(clknode_get_device(_clk), off, clr, set) +#define DEVICE_LOCK(_clk) \ + CLKDEV_DEVICE_LOCK(clknode_get_device(_clk)) +#define DEVICE_UNLOCK(_clk) \ + CLKDEV_DEVICE_UNLOCK(clknode_get_device(_clk)) static int clknode_mux_init(struct clknode *clk, device_t dev); static int clknode_mux_set_mux(struct clknode *clk, int idx); @@ -76,9 +80,12 @@ clknode_mux_init(struct clknode *clk, de sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); rv = RD4(clk, sc->offset, ®); - if (rv != 0) + DEVICE_UNLOCK(clk); + if (rv != 0) { return (rv); + } reg = (reg >> sc->shift) & sc->mask; clknode_init_parent_idx(clk, reg); return(0); @@ -93,11 +100,16 @@ clknode_mux_set_mux(struct clknode *clk, sc = clknode_get_softc(clk); + DEVICE_LOCK(clk); rv = MD4(clk, sc->offset, sc->mask << sc->shift, (idx & sc->mask) << sc->shift); - if (rv != 0) + if (rv != 0) { + DEVICE_UNLOCK(clk); return (rv); + } RD4(clk, sc->offset, ®); + DEVICE_UNLOCK(clk); + return(0); } Modified: head/sys/dev/extres/clk/clkdev_if.m ============================================================================== --- head/sys/dev/extres/clk/clkdev_if.m Tue Mar 15 15:27:15 2016 (r296904) +++ head/sys/dev/extres/clk/clkdev_if.m Tue Mar 15 15:28:24 2016 (r296905) @@ -30,6 +30,23 @@ INTERFACE clkdev; +CODE { + #include + static void + clkdev_default_device_lock(device_t dev) + { + + panic("clkdev_device_lock() is not implemented"); + } + + static void + clkdev_default_device_unlock(device_t dev) + { + + panic("clkdev_device_unlock() is not implemented"); + } +} + # # Write single register # @@ -57,3 +74,17 @@ METHOD int modify_4 { uint32_t clear_mask; uint32_t set_mask; }; + +# +# Get exclusive access to underlying device +# +METHOD void device_lock { + device_t dev; +} DEFAULT clkdev_default_device_lock; + +# +# Release exclusive access to underlying device +# +METHOD void device_unlock { + device_t dev; +} DEFAULT clkdev_default_device_unlock; From owner-svn-src-head@freebsd.org Tue Mar 15 15:30:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA37FAD1BA1; Tue, 15 Mar 2016 15:30:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 898111DF7; Tue, 15 Mar 2016 15:30:18 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFUHeQ072730; Tue, 15 Mar 2016 15:30:17 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFUHoH072725; Tue, 15 Mar 2016 15:30:17 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151530.u2FFUHoH072725@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:30:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296906 - in head/sys: conf dev/extres/regulator X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:30:18 -0000 Author: mmel Date: Tue Mar 15 15:30:17 2016 New Revision: 296906 URL: https://svnweb.freebsd.org/changeset/base/296906 Log: Add regulator framework, a next part of new 'extended resources' family of support frameworks(i.e. clk/reset/phy/tsensors/fuses...). The framework is still far from perfect and probably doesn't have stable interface yet, but we want to start testing it on more real boards and different architectures. Added: head/sys/dev/extres/regulator/ head/sys/dev/extres/regulator/regdev_if.m (contents, props changed) head/sys/dev/extres/regulator/regnode_if.m (contents, props changed) head/sys/dev/extres/regulator/regulator.c (contents, props changed) head/sys/dev/extres/regulator/regulator.h (contents, props changed) head/sys/dev/extres/regulator/regulator_bus.c (contents, props changed) head/sys/dev/extres/regulator/regulator_fixed.c (contents, props changed) head/sys/dev/extres/regulator/regulator_fixed.h (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 15 15:28:24 2016 (r296905) +++ head/sys/conf/files Tue Mar 15 15:30:17 2016 (r296906) @@ -1420,6 +1420,11 @@ dev/extres/clk/clk_gate.c optional ext_r dev/extres/clk/clk_mux.c optional ext_resources clk dev/extres/hwreset/hwreset.c optional ext_resources hwreset dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset +dev/extres/regulator/regdev_if.m optional ext_resources regulator +dev/extres/regulator/regnode_if.m optional ext_resources regulator +dev/extres/regulator/regulator.c optional ext_resources regulator +dev/extres/regulator/regulator_bus.c optional ext_resources regulator fdt +dev/extres/regulator/regulator_fixed.c optional ext_resources regulator dev/fatm/if_fatm.c optional fatm pci dev/fb/fbd.c optional fbd | vt dev/fb/fb_if.m standard @@ -1561,10 +1566,10 @@ ipw_monitor.fw optional ipwmonitorfw | compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "ipw_monitor.fw" -dev/iscsi/icl.c optional iscsi | ctl -dev/iscsi/icl_conn_if.m optional iscsi | ctl +dev/iscsi/icl.c optional iscsi | ctl +dev/iscsi/icl_conn_if.m optional iscsi | ctl dev/iscsi/icl_proxy.c optional iscsi | ctl -dev/iscsi/icl_soft.c optional iscsi | ctl +dev/iscsi/icl_soft.c optional iscsi | ctl dev/iscsi/iscsi.c optional iscsi scbus dev/iscsi_initiator/iscsi.c optional iscsi_initiator scbus dev/iscsi_initiator/iscsi_subr.c optional iscsi_initiator scbus Added: head/sys/dev/extres/regulator/regdev_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/regulator/regdev_if.m Tue Mar 15 15:30:17 2016 (r296906) @@ -0,0 +1,56 @@ +#- +# Copyright 2016 Michal Meloun +# 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$ +# + +#ifdef FDT +#include +#include +#endif + +#include + +INTERFACE regdev; + +#ifdef FDT + +HEADER { +int regdev_default_ofw_map(device_t , phandle_t, int, pcell_t *, intptr_t *); +} + +# +# map fdt property cells to regulator number +# Returns 0 on success or a standard errno value. +# +METHOD int map { + device_t provider_dev; + phandle_t xref; + int ncells; + pcell_t *cells; + intptr_t *id; +} DEFAULT regdev_default_ofw_map; + +#endif Added: head/sys/dev/extres/regulator/regnode_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/regulator/regnode_if.m Tue Mar 15 15:30:17 2016 (r296906) @@ -0,0 +1,82 @@ +#- +# Copyright (c) 2016 Michal Meloun +# 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$ +# + +INTERFACE regnode; +HEADER { + struct regnode; +} + +# +# Initialize regulator +# Returns 0 on success or a standard errno value. +# +METHOD int init { + struct regnode *regnode; +}; + +# +# Enable/disable regulator +# Returns 0 on success or a standard errno value. +# - enable - input. +# - delay - output, delay needed to stabilize voltage (in us) +# +METHOD int enable { + struct regnode *regnode; + bool enable; + int *udelay; +}; + +# +# Get regulator status +# Returns 0 on success or a standard errno value. +# +METHOD int status { + struct regnode *regnode; + int *status; /* REGULATOR_STATUS_* */ +}; + +# +# Set regulator voltage +# Returns 0 on success or a standard errno value. +# - min_uvolt, max_uvolt - input, requested voltage range (in uV) +# - delay - output, delay needed to stabilize voltage (in us) +METHOD int set_voltage { + struct regnode *regnode; + int min_uvolt; + int max_uvolt; + int *udelay; +}; + +# +# Get regulator voltage +# Returns 0 on success or a standard errno value. +# +METHOD int get_voltage { + struct regnode *regnode; + int *uvolt; +}; Added: head/sys/dev/extres/regulator/regulator.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/regulator/regulator.c Tue Mar 15 15:30:17 2016 (r296906) @@ -0,0 +1,984 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_platform.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#include +#endif +#include + +#include "regdev_if.h" + +MALLOC_DEFINE(M_REGULATOR, "regulator", "Regulator framework"); + +/* Forward declarations. */ +struct regulator; +struct regnode; + +typedef TAILQ_HEAD(regnode_list, regnode) regnode_list_t; +typedef TAILQ_HEAD(regulator_list, regulator) regulator_list_t; + +/* Default regulator methods. */ +static int regnode_method_enable(struct regnode *regnode, bool enable, + int *udelay); +static int regnode_method_status(struct regnode *regnode, int *status); +static int regnode_method_set_voltage(struct regnode *regnode, int min_uvolt, + int max_uvolt, int *udelay); +static int regnode_method_get_voltage(struct regnode *regnode, int *uvolt); + +/* + * Regulator controller methods. + */ +static regnode_method_t regnode_methods[] = { + REGNODEMETHOD(regnode_enable, regnode_method_enable), + REGNODEMETHOD(regnode_status, regnode_method_status), + REGNODEMETHOD(regnode_set_voltage, regnode_method_set_voltage), + REGNODEMETHOD(regnode_get_voltage, regnode_method_get_voltage), + + REGNODEMETHOD_END +}; +DEFINE_CLASS_0(regnode, regnode_class, regnode_methods, 0); + +/* + * Regulator node - basic element for modelling SOC and bard power supply + * chains. Its contains producer data. + */ +struct regnode { + KOBJ_FIELDS; + + TAILQ_ENTRY(regnode) reglist_link; /* Global list entry */ + regulator_list_t consumers_list; /* Consumers list */ + + /* Cache for already resolved names */ + struct regnode *parent; /* Resolved parent */ + + /* Details of this device. */ + const char *name; /* Globally unique name */ + const char *parent_name; /* Parent name */ + + device_t pdev; /* Producer device_t */ + void *softc; /* Producer softc */ + intptr_t id; /* Per producer unique id */ +#ifdef FDT + phandle_t ofw_node; /* OFW node of regulator */ +#endif + int flags; /* REGULATOR_FLAGS_ */ + struct sx lock; /* Lock for this regulator */ + int ref_cnt; /* Reference counter */ + int enable_cnt; /* Enabled counter */ + + struct regnode_std_param std_param; /* Standard parameters */ +}; + +/* + * Per consumer data, information about how a consumer is using a regulator + * node. + * A pointer to this structure is used as a handle in the consumer interface. + */ +struct regulator { + device_t cdev; /* Consumer device */ + struct regnode *regnode; + TAILQ_ENTRY(regulator) link; /* Consumers list entry */ + + int enable_cnt; + int min_uvolt; /* Requested uvolt range */ + int max_uvolt; +}; + +/* + * Regulator names must be system wide unique. + */ +static regnode_list_t regnode_list = TAILQ_HEAD_INITIALIZER(regnode_list); + +static struct sx regnode_topo_lock; +SX_SYSINIT(regulator_topology, ®node_topo_lock, "Regulator topology lock"); + +#define REG_TOPO_SLOCK() sx_slock(®node_topo_lock) +#define REG_TOPO_XLOCK() sx_xlock(®node_topo_lock) +#define REG_TOPO_UNLOCK() sx_unlock(®node_topo_lock) +#define REG_TOPO_ASSERT() sx_assert(®node_topo_lock, SA_LOCKED) +#define REG_TOPO_XASSERT() sx_assert(®node_topo_lock, SA_XLOCKED) + +#define REGNODE_SLOCK(_sc) sx_slock(&((_sc)->lock)) +#define REGNODE_XLOCK(_sc) sx_xlock(&((_sc)->lock)) +#define REGNODE_UNLOCK(_sc) sx_unlock(&((_sc)->lock)) + +/* ---------------------------------------------------------------------------- + * + * Default regulator methods for base class. + * + */ +static int +regnode_method_enable(struct regnode *regnode, bool enable, int *udelay) +{ + + if (!enable) + return (ENXIO); + + *udelay = 0; + return (0); +} + +static int +regnode_method_status(struct regnode *regnode, int *status) +{ + *status = REGULATOR_STATUS_ENABLED; + return (0); +} + +static int +regnode_method_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt, + int *udelay) +{ + + if ((min_uvolt > regnode->std_param.max_uvolt) || + (max_uvolt < regnode->std_param.min_uvolt)) + return (ERANGE); + *udelay = 0; + return (0); +} + +static int +regnode_method_get_voltage(struct regnode *regnode, int *uvolt) +{ + + return (regnode->std_param.min_uvolt + + (regnode->std_param.max_uvolt - regnode->std_param.min_uvolt) / 2); +} + +/* ---------------------------------------------------------------------------- + * + * Internal functions. + * + */ + +static struct regnode * +regnode_find_by_name(const char *name) +{ + struct regnode *entry; + + REG_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, ®node_list, reglist_link) { + if (strcmp(entry->name, name) == 0) + return (entry); + } + return (NULL); +} + +static struct regnode * +regnode_find_by_id(device_t dev, intptr_t id) +{ + struct regnode *entry; + + REG_TOPO_ASSERT(); + + TAILQ_FOREACH(entry, ®node_list, reglist_link) { + if ((entry->pdev == dev) && (entry->id == id)) + return (entry); + } + + return (NULL); +} + +/* + * Create and initialize regulator object, but do not register it. + */ +struct regnode * +regnode_create(device_t pdev, regnode_class_t regnode_class, + struct regnode_init_def *def) +{ + struct regnode *regnode; + + KASSERT(def->name != NULL, ("regulator name is NULL")); + KASSERT(def->name[0] != '\0', ("regulator name is empty")); + + REG_TOPO_SLOCK(); + if (regnode_find_by_name(def->name) != NULL) + panic("Duplicated regulator registration: %s\n", def->name); + REG_TOPO_UNLOCK(); + + /* Create object and initialize it. */ + regnode = malloc(sizeof(struct regnode), M_REGULATOR, + M_WAITOK | M_ZERO); + kobj_init((kobj_t)regnode, (kobj_class_t)regnode_class); + sx_init(®node->lock, "Regulator node lock"); + + /* Allocate softc if required. */ + if (regnode_class->size > 0) { + regnode->softc = malloc(regnode_class->size, M_REGULATOR, + M_WAITOK | M_ZERO); + } + + + /* Copy all strings unless they're flagged as static. */ + if (def->flags & REGULATOR_FLAGS_STATIC) { + regnode->name = def->name; + regnode->parent_name = def->parent_name; + } else { + regnode->name = strdup(def->name, M_REGULATOR); + if (def->parent_name != NULL) + regnode->parent_name = strdup(def->parent_name, + M_REGULATOR); + } + + /* Rest of init. */ + TAILQ_INIT(®node->consumers_list); + regnode->id = def->id; + regnode->pdev = pdev; + regnode->flags = def->flags; + regnode->parent = NULL; + regnode->std_param = def->std_param; +#ifdef FDT + regnode->ofw_node = def->ofw_node; +#endif + + return (regnode); +} + +/* Register regulator object. */ +struct regnode * +regnode_register(struct regnode *regnode) +{ + int rv; + +#ifdef FDT + if (regnode->ofw_node <= 0) + regnode->ofw_node = ofw_bus_get_node(regnode->pdev); + if (regnode->ofw_node <= 0) + return (NULL); +#endif + + rv = REGNODE_INIT(regnode); + if (rv != 0) { + printf("REGNODE_INIT failed: %d\n", rv); + return (NULL); + } + + REG_TOPO_XLOCK(); + TAILQ_INSERT_TAIL(®node_list, regnode, reglist_link); + REG_TOPO_UNLOCK(); +#ifdef FDT + OF_device_register_xref(OF_xref_from_node(regnode->ofw_node), + regnode->pdev); +#endif + return (regnode); +} + +static int +regnode_resolve_parent(struct regnode *regnode) +{ + + /* All ready resolved or no parent? */ + if ((regnode->parent != NULL) || + (regnode->parent_name == NULL)) + return (0); + + regnode->parent = regnode_find_by_name(regnode->parent_name); + if (regnode->parent == NULL) + return (ENODEV); + return (0); +} + +static void +regnode_delay(int usec) +{ + int ticks; + + if (usec == 0) + return; + ticks = (usec * hz + 999999) / 1000000; + + if (cold || ticks < 2) + DELAY(usec); + else + pause("REGULATOR", ticks); +} + +/* -------------------------------------------------------------------------- + * + * Regulator providers interface + * + */ + +const char * +regnode_get_name(struct regnode *regnode) +{ + + return (regnode->name); +} + +const char * +regnode_get_parent_name(struct regnode *regnode) +{ + + return (regnode->parent_name); +} + +int +regnode_get_flags(struct regnode *regnode) +{ + + return (regnode->flags); +} + +void * +regnode_get_softc(struct regnode *regnode) +{ + + return (regnode->softc); +} + +device_t +regnode_get_device(struct regnode *regnode) +{ + + return (regnode->pdev); +} + +struct regnode_std_param *regnode_get_stdparam(struct regnode *regnode) +{ + + return (®node->std_param); +} + +void regnode_topo_unlock(void) +{ + + REG_TOPO_UNLOCK(); +} + +void regnode_topo_xlock(void) +{ + + REG_TOPO_XLOCK(); +} + +void regnode_topo_slock(void) +{ + + REG_TOPO_SLOCK(); +} + + +/* -------------------------------------------------------------------------- + * + * Real consumers executive + * + */ +struct regnode * +regnode_get_parent(struct regnode *regnode) +{ + int rv; + + REG_TOPO_ASSERT(); + + rv = regnode_resolve_parent(regnode); + if (rv != 0) + return (NULL); + + return (regnode->parent); +} + +/* + * Enable regulator. + */ +int +regnode_enable(struct regnode *regnode) +{ + int udelay; + int rv; + + REG_TOPO_ASSERT(); + + /* Enable regulator for each node in chain, starting from source. */ + rv = regnode_resolve_parent(regnode); + if (rv != 0) + return (rv); + if (regnode->parent != NULL) { + rv = regnode_enable(regnode->parent); + if (rv != 0) + return (rv); + } + + /* Handle this node. */ + REGNODE_XLOCK(regnode); + if (regnode->enable_cnt == 0) { + rv = REGNODE_ENABLE(regnode, true, &udelay); + if (rv != 0) { + REGNODE_UNLOCK(regnode); + return (rv); + } + regnode_delay(udelay); + } + regnode->enable_cnt++; + REGNODE_UNLOCK(regnode); + return (0); +} + +/* + * Disable regulator. + */ +int +regnode_disable(struct regnode *regnode) +{ + int udelay; + int rv; + + REG_TOPO_ASSERT(); + rv = 0; + + REGNODE_XLOCK(regnode); + /* Disable regulator for each node in chain, starting from consumer. */ + if ((regnode->enable_cnt == 1) && + ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) { + rv = REGNODE_ENABLE(regnode, false, &udelay); + if (rv != 0) { + REGNODE_UNLOCK(regnode); + return (rv); + } + regnode_delay(udelay); + } + regnode->enable_cnt--; + REGNODE_UNLOCK(regnode); + + rv = regnode_resolve_parent(regnode); + if (rv != 0) + return (rv); + if (regnode->parent != NULL) + rv = regnode_disable(regnode->parent); + return (rv); +} + +/* + * Stop regulator. + */ +int +regnode_stop(struct regnode *regnode, int depth) +{ + int udelay; + int rv; + + REG_TOPO_ASSERT(); + rv = 0; + + REGNODE_XLOCK(regnode); + /* The first node must not be enabled. */ + if ((regnode->enable_cnt != 0) && (depth == 0)) { + REGNODE_UNLOCK(regnode); + return (EBUSY); + } + /* Disable regulator for each node in chain, starting from consumer */ + if ((regnode->enable_cnt == 0) && + ((regnode->flags & REGULATOR_FLAGS_NOT_DISABLE) == 0)) { + rv = REGNODE_ENABLE(regnode, false, &udelay); + if (rv != 0) { + REGNODE_UNLOCK(regnode); + return (rv); + } + regnode_delay(udelay); + } + REGNODE_UNLOCK(regnode); + + rv = regnode_resolve_parent(regnode); + if (rv != 0) + return (rv); + if (regnode->parent != NULL) + rv = regnode_stop(regnode->parent, depth + 1); + return (rv); +} + +/* + * Get regulator status. (REGULATOR_STATUS_*) + */ +int +regnode_status(struct regnode *regnode, int *status) +{ + int rv; + + REG_TOPO_ASSERT(); + + REGNODE_XLOCK(regnode); + rv = REGNODE_STATUS(regnode, status); + REGNODE_UNLOCK(regnode); + return (rv); +} + +/* + * Get actual regulator voltage. + */ +int +regnode_get_voltage(struct regnode *regnode, int *uvolt) +{ + int rv; + + REG_TOPO_ASSERT(); + + REGNODE_XLOCK(regnode); + rv = REGNODE_GET_VOLTAGE(regnode, uvolt); + REGNODE_UNLOCK(regnode); + + /* Pass call into parent, if regulator is in bypass mode. */ + if (rv == ENOENT) { + rv = regnode_resolve_parent(regnode); + if (rv != 0) + return (rv); + if (regnode->parent != NULL) + rv = regnode_get_voltage(regnode->parent, uvolt); + + } + return (rv); +} + +/* + * Set regulator voltage. + */ +int +regnode_set_voltage(struct regnode *regnode, int min_uvolt, int max_uvolt) +{ + int udelay; + int rv; + + REG_TOPO_ASSERT(); + + REGNODE_XLOCK(regnode); + + rv = REGNODE_SET_VOLTAGE(regnode, min_uvolt, max_uvolt, &udelay); + if (rv == 0) + regnode_delay(udelay); + REGNODE_UNLOCK(regnode); + return (rv); +} + +/* + * Consumer variant of regnode_set_voltage(). + */ +static int +regnode_set_voltage_checked(struct regnode *regnode, struct regulator *reg, + int min_uvolt, int max_uvolt) +{ + int udelay; + int all_max_uvolt; + int all_min_uvolt; + struct regulator *tmp; + int rv; + + REG_TOPO_ASSERT(); + + REGNODE_XLOCK(regnode); + /* Return error if requested range is outside of regulator range. */ + if ((min_uvolt > regnode->std_param.max_uvolt) || + (max_uvolt < regnode->std_param.min_uvolt)) { + REGNODE_UNLOCK(regnode); + return (ERANGE); + } + + /* Get actual voltage range for all consumers. */ + all_min_uvolt = regnode->std_param.min_uvolt; + all_max_uvolt = regnode->std_param.max_uvolt; + TAILQ_FOREACH(tmp, ®node->consumers_list, link) { + /* Don't take requestor in account. */ + if (tmp == reg) + continue; + if (all_min_uvolt < tmp->min_uvolt) + all_min_uvolt = tmp->min_uvolt; + if (all_max_uvolt > tmp->max_uvolt) + all_max_uvolt = tmp->max_uvolt; + } + + /* Test if request fits to actual contract. */ + if ((min_uvolt > all_max_uvolt) || + (max_uvolt < all_min_uvolt)) { + REGNODE_UNLOCK(regnode); + return (ERANGE); + } + + /* Adjust new range.*/ + if (min_uvolt < all_min_uvolt) + min_uvolt = all_min_uvolt; + if (max_uvolt > all_max_uvolt) + max_uvolt = all_max_uvolt; + + rv = REGNODE_SET_VOLTAGE(regnode, min_uvolt, max_uvolt, &udelay); + regnode_delay(udelay); + REGNODE_UNLOCK(regnode); + return (rv); +} + +#ifdef FDT +phandle_t +regnode_get_ofw_node(struct regnode *regnode) +{ + + return (regnode->ofw_node); +} +#endif + +/* -------------------------------------------------------------------------- + * + * Regulator consumers interface. + * + */ +/* Helper function for regulator_get*() */ +static regulator_t +regulator_create(struct regnode *regnode, device_t cdev) +{ + struct regulator *reg; + + REG_TOPO_ASSERT(); + + reg = malloc(sizeof(struct regulator), M_REGULATOR, + M_WAITOK | M_ZERO); + reg->cdev = cdev; + reg->regnode = regnode; + reg->enable_cnt = 0; + + REGNODE_XLOCK(regnode); + regnode->ref_cnt++; + TAILQ_INSERT_TAIL(®node->consumers_list, reg, link); + reg ->min_uvolt = regnode->std_param.min_uvolt; + reg ->max_uvolt = regnode->std_param.max_uvolt; + REGNODE_UNLOCK(regnode); + + return (reg); +} + +int +regulator_enable(regulator_t reg) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + REG_TOPO_SLOCK(); + rv = regnode_enable(regnode); + if (rv == 0) + reg->enable_cnt++; + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_disable(regulator_t reg) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + KASSERT(reg->enable_cnt > 0, + ("Attempt to disable already disabled regulator: %s\n", + regnode->name)); + REG_TOPO_SLOCK(); + rv = regnode_disable(regnode); + if (rv == 0) + reg->enable_cnt--; + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_stop(regulator_t reg) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + KASSERT(reg->enable_cnt == 0, + ("Attempt to stop already enabled regulator: %s\n", regnode->name)); + + REG_TOPO_SLOCK(); + rv = regnode_stop(regnode, 0); + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_status(regulator_t reg, int *status) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + + REG_TOPO_SLOCK(); + rv = regnode_status(regnode, status); + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_get_voltage(regulator_t reg, int *uvolt) +{ + int rv; + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + + REG_TOPO_SLOCK(); + rv = regnode_get_voltage(regnode, uvolt); + REG_TOPO_UNLOCK(); + return (rv); +} + +int +regulator_set_voltage(regulator_t reg, int min_uvolt, int max_uvolt) +{ + struct regnode *regnode; + int rv; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + + REG_TOPO_SLOCK(); + + rv = regnode_set_voltage_checked(regnode, reg, min_uvolt, max_uvolt); + if (rv == 0) { + reg->min_uvolt = min_uvolt; + reg->max_uvolt = max_uvolt; + } + REG_TOPO_UNLOCK(); + return (rv); +} + +const char * +regulator_get_name(regulator_t reg) +{ + struct regnode *regnode; + + regnode = reg->regnode; + KASSERT(regnode->ref_cnt > 0, + ("Attempt to access unreferenced regulator: %s\n", regnode->name)); + return (regnode->name); +} + +int +regulator_get_by_name(device_t cdev, const char *name, regulator_t *reg) +{ + struct regnode *regnode; + + REG_TOPO_SLOCK(); + regnode = regnode_find_by_name(name); + if (regnode == NULL) { + REG_TOPO_UNLOCK(); + return (ENODEV); + } + *reg = regulator_create(regnode, cdev); + REG_TOPO_UNLOCK(); + return (0); +} + +int +regulator_get_by_id(device_t cdev, device_t pdev, intptr_t id, regulator_t *reg) +{ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Tue Mar 15 15:31:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3D645AD1DE6; Tue, 15 Mar 2016 15:31:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1981712DC; Tue, 15 Mar 2016 15:31:19 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2FFVIcF074767; Tue, 15 Mar 2016 15:31:18 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFVHlt074763; Tue, 15 Mar 2016 15:31:17 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603151531.u2FFVHlt074763@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Tue, 15 Mar 2016 15:31:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296907 - in head/sys: conf dev/extres/phy X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:31:19 -0000 Author: mmel Date: Tue Mar 15 15:31:17 2016 New Revision: 296907 URL: https://svnweb.freebsd.org/changeset/base/296907 Log: Add phy framework, a next part of new 'extended resources' family of support frameworks (i.e. clk/regulators/tsensors/fuses...). It provides simple unified consumers interface for manipulations with phy (USB/SATA/PCIe) resources. Added: head/sys/dev/extres/phy/ head/sys/dev/extres/phy/phy.c (contents, props changed) head/sys/dev/extres/phy/phy.h (contents, props changed) head/sys/dev/extres/phy/phy_if.m (contents, props changed) Modified: head/sys/conf/files Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Mar 15 15:30:17 2016 (r296906) +++ head/sys/conf/files Tue Mar 15 15:31:17 2016 (r296907) @@ -1418,6 +1418,8 @@ dev/extres/clk/clk_div.c optional ext_re dev/extres/clk/clk_fixed.c optional ext_resources clk dev/extres/clk/clk_gate.c optional ext_resources clk dev/extres/clk/clk_mux.c optional ext_resources clk +dev/extres/phy/phy.c optional ext_resources phy +dev/extres/phy/phy_if.m optional ext_resources phy dev/extres/hwreset/hwreset.c optional ext_resources hwreset dev/extres/hwreset/hwreset_if.m optional ext_resources hwreset dev/extres/regulator/regdev_if.m optional ext_resources regulator Added: head/sys/dev/extres/phy/phy.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy.c Tue Mar 15 15:31:17 2016 (r296907) @@ -0,0 +1,235 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ +#include "opt_platform.h" +#include +#include +#include +#include +#include + +#ifdef FDT +#include +#include +#endif + +#include + +#include "phy_if.h" + +struct phy { + device_t consumer_dev; /* consumer device*/ + device_t provider_dev; /* provider device*/ + uintptr_t phy_id; /* phy id */ +}; + +MALLOC_DEFINE(M_PHY, "phy", "Phy framework"); + +int +phy_init(device_t consumer, phy_t phy) +{ + + return (PHY_INIT(phy->provider_dev, phy->phy_id, true)); +} + +int +phy_deinit(device_t consumer, phy_t phy) +{ + + return (PHY_INIT(phy->provider_dev, phy->phy_id, false)); +} + + +int +phy_enable(device_t consumer, phy_t phy) +{ + + return (PHY_ENABLE(phy->provider_dev, phy->phy_id, true)); +} + +int +phy_disable(device_t consumer, phy_t phy) +{ + + return (PHY_ENABLE(phy->provider_dev, phy->phy_id, false)); +} + +int +phy_status(device_t consumer, phy_t phy, int *value) +{ + + return (PHY_STATUS(phy->provider_dev, phy->phy_id, value)); +} + +int +phy_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, + phy_t *phy_out) +{ + phy_t phy; + + /* Create handle */ + phy = malloc(sizeof(struct phy), M_PHY, + M_WAITOK | M_ZERO); + phy->consumer_dev = consumer_dev; + phy->provider_dev = provider_dev; + phy->phy_id = id; + *phy_out = phy; + return (0); +} + +void +phy_release(phy_t phy) +{ + free(phy, M_PHY); +} + + +#ifdef FDT +int phy_default_map(device_t provider, phandle_t xref, int ncells, + pcell_t *cells, intptr_t *id) +{ + + if (ncells == 0) + *id = 1; + else if (ncells == 1) + *id = cells[0]; + else + return (ERANGE); + + return (0); +} + +int +phy_get_by_ofw_idx(device_t consumer_dev, int idx, phy_t *phy) +{ + phandle_t cnode, xnode; + pcell_t *cells; + device_t phydev; + int ncells, rv; + intptr_t id; + + cnode = ofw_bus_get_node(consumer_dev); + if (cnode <= 0) { + device_printf(consumer_dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + rv = ofw_bus_parse_xref_list_alloc(cnode, "phys", "#phy-cells", idx, + &xnode, &ncells, &cells); + if (rv != 0) + return (rv); + + /* Tranlate provider to device. */ + phydev = OF_device_from_xref(xnode); + if (phydev == NULL) { + free(cells, M_OFWPROP); + return (ENODEV); + } + /* Map phy to number. */ + rv = PHY_MAP(phydev, xnode, ncells, cells, &id); + free(cells, M_OFWPROP); + if (rv != 0) + return (rv); + + return (phy_get_by_id(consumer_dev, phydev, id, phy)); +} + +int +phy_get_by_ofw_name(device_t consumer_dev, char *name, phy_t *phy) +{ + int rv, idx; + phandle_t cnode; + + cnode = ofw_bus_get_node(consumer_dev); + if (cnode <= 0) { + device_printf(consumer_dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + rv = ofw_bus_find_string_index(cnode, "phy-names", name, &idx); + if (rv != 0) + return (rv); + return (phy_get_by_ofw_idx(consumer_dev, idx, phy)); +} + +int +phy_get_by_ofw_property(device_t consumer_dev, char *name, phy_t *phy) +{ + phandle_t cnode; + pcell_t *cells; + device_t phydev; + int ncells, rv; + intptr_t id; + + cnode = ofw_bus_get_node(consumer_dev); + if (cnode <= 0) { + device_printf(consumer_dev, + "%s called on not ofw based device\n", __func__); + return (ENXIO); + } + ncells = OF_getencprop_alloc(cnode, name, sizeof(pcell_t), + (void **)&cells); + if (ncells < 1) + return (ENXIO); + + /* Tranlate provider to device. */ + phydev = OF_device_from_xref(cells[0]); + if (phydev == NULL) { + free(cells, M_OFWPROP); + return (ENODEV); + } + /* Map phy to number. */ + rv = PHY_MAP(phydev, cells[0], ncells - 1 , cells + 1, &id); + free(cells, M_OFWPROP); + if (rv != 0) + return (rv); + + return (phy_get_by_id(consumer_dev, phydev, id, phy)); +} + +void +phy_register_provider(device_t provider_dev) +{ + phandle_t xref, node; + + node = ofw_bus_get_node(provider_dev); + if (node <= 0) + panic("%s called on not ofw based device.\n", __func__); + + xref = OF_xref_from_node(node); + OF_device_register_xref(xref, provider_dev); +} + +void +phy_unregister_provider(device_t provider_dev) +{ + phandle_t xref; + + xref = OF_xref_from_device(provider_dev); + OF_device_register_xref(xref, NULL); +} +#endif Added: head/sys/dev/extres/phy/phy.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy.h Tue Mar 15 15:31:17 2016 (r296907) @@ -0,0 +1,63 @@ +/*- + * Copyright 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef DEV_EXTRES_PHY_H +#define DEV_EXTRES_PHY_H + +#include "opt_platform.h" +#include +#ifdef FDT +#include +#endif + +typedef struct phy *phy_t; + +/* + * Provider interface + */ +#ifdef FDT +void phy_register_provider(device_t provider); +void phy_unregister_provider(device_t provider); +#endif + +/* + * Consumer interface + */ +int phy_get_by_id(device_t consumer_dev, device_t provider_dev, intptr_t id, + phy_t *phy); +void phy_release(phy_t phy); +int phy_get_by_ofw_name(device_t consumer, char *name, phy_t *phy); +int phy_get_by_ofw_idx(device_t consumer, int idx, phy_t *phy); +int phy_get_by_ofw_property(device_t consumer, char *name, phy_t *phy); + +int phy_init(device_t consumer, phy_t phy); +int phy_deinit(device_t consumer, phy_t phy); +int phy_enable(device_t consumer, phy_t phy); +int phy_disable(device_t consumer, phy_t phy); +int phy_status(device_t consumer, phy_t phy, int *value); + +#endif /* DEV_EXTRES_PHY_H */ Added: head/sys/dev/extres/phy/phy_if.m ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/extres/phy/phy_if.m Tue Mar 15 15:31:17 2016 (r296907) @@ -0,0 +1,84 @@ +#- +# Copyright 2016 Michal Meloun +# 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$ +# + +#ifdef FDT +#include +#include +#endif + +INTERFACE phy; + +#ifdef FDT +HEADER { +int phy_default_map(device_t , phandle_t, int, pcell_t *, intptr_t *); +} + +# +# map fdt property cells to phy number +# Returns 0 on success or a standard errno value. +# +METHOD int map { + device_t provider_dev; + phandle_t xref; + int ncells; + pcell_t *cells; + intptr_t *id; +} DEFAULT phy_default_map; +#endif + +# +# Init/deinit phy +# Returns 0 on success or a standard errno value. +# +METHOD int init { + device_t provider_dev; + intptr_t id; + bool inti; +}; + +# +# Enable/disable phy +# Returns 0 on success or a standard errno value. +# +METHOD int enable { + device_t provider_dev; + intptr_t id; + bool enable; +}; + +# +# Get phy status +# Returns 0 on success or a standard errno value. +# +METHOD int status { + device_t provider_dev; + intptr_t id; + int *status; /* PHY_STATUS_* */ +}; + + From owner-svn-src-head@freebsd.org Tue Mar 15 15:42:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A838BACA80B; Tue, 15 Mar 2016 15:42: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 5D7541D87; Tue, 15 Mar 2016 15:42: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 u2FFgrxn078423; Tue, 15 Mar 2016 15:42:53 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFgr0f078421; Tue, 15 Mar 2016 15:42:53 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201603151542.u2FFgr0f078421@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Tue, 15 Mar 2016 15:42:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296908 - in head/sys: amd64/amd64 i386/i386 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:42:54 -0000 Author: kib Date: Tue Mar 15 15:42:53 2016 New Revision: 296908 URL: https://svnweb.freebsd.org/changeset/base/296908 Log: The PKRU state size is 4 bytes, its support makes the XSAVE area size non-multiple of 64 bytes. Thereafter, the user state save area is misaligned, which triggers assertion in the debugging kernels, or segmentation violation on accesses for non-debugging configs. Force the desired alignment of the user save area as the fix (workaround is to disable bit 9 in the hw.xsave_mask loader tunable). This correction is required for booting on the upcoming Intel' Purley platform. Reported and tested by: "Pieper, Jeffrey E" , jimharris Sponsored by: The FreeBSD Foundation MFC after: 3 days Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/i386/i386/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Tue Mar 15 15:31:17 2016 (r296907) +++ head/sys/amd64/amd64/vm_machdep.c Tue Mar 15 15:42:53 2016 (r296908) @@ -102,8 +102,8 @@ get_pcb_user_save_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size; - KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN); + KASSERT((p % XSAVE_AREA_ALIGN) == 0, ("Unaligned pcb_user_save area")); return ((struct savefpu *)p); } @@ -122,7 +122,8 @@ get_pcb_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size - sizeof(struct pcb); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN) - + sizeof(struct pcb); return ((struct pcb *)p); } Modified: head/sys/i386/i386/vm_machdep.c ============================================================================== --- head/sys/i386/i386/vm_machdep.c Tue Mar 15 15:31:17 2016 (r296907) +++ head/sys/i386/i386/vm_machdep.c Tue Mar 15 15:42:53 2016 (r296908) @@ -127,8 +127,8 @@ get_pcb_user_save_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size; - KASSERT((p % 64) == 0, ("Unaligned pcb_user_save area")); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN); + KASSERT((p % XSAVE_AREA_ALIGN) == 0, ("Unaligned pcb_user_save area")); return ((union savefpu *)p); } @@ -147,7 +147,8 @@ get_pcb_td(struct thread *td) vm_offset_t p; p = td->td_kstack + td->td_kstack_pages * PAGE_SIZE - - cpu_max_ext_state_size - sizeof(struct pcb); + roundup2(cpu_max_ext_state_size, XSAVE_AREA_ALIGN) - + sizeof(struct pcb); return ((struct pcb *)p); } From owner-svn-src-head@freebsd.org Tue Mar 15 15:47:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A2FCFACAA0F; Tue, 15 Mar 2016 15:47:27 +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 59A211235; Tue, 15 Mar 2016 15:47:27 +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 u2FFlQ4R078645; Tue, 15 Mar 2016 15:47:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFlQKN078643; Tue, 15 Mar 2016 15:47:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603151547.u2FFlQKN078643@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Mar 2016 15:47:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:47:27 -0000 Author: hselasky Date: Tue Mar 15 15:47:26 2016 New Revision: 296909 URL: https://svnweb.freebsd.org/changeset/base/296909 Log: Fix witness panic in the ipoib_ioctl() function when unloading the ipoib module. The bpfdetach() function is trying to turn off promiscious mode on the network interface it is attached to while holding a mutex. The fix consists of ignoring any further calls to the ipoib_ioctl() function when the network interface is going to be detached. The ipoib_ioctl() function might sleep. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Tue Mar 15 15:42:53 2016 (r296908) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib.h Tue Mar 15 15:47:26 2016 (r296909) @@ -322,6 +322,8 @@ struct ipoib_dev_priv { unsigned long flags; + int gone; + struct mutex vlan_mutex; struct rb_root path_tree; Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c ============================================================================== --- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Mar 15 15:42:53 2016 (r296908) +++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c Tue Mar 15 15:47:26 2016 (r296909) @@ -258,6 +258,10 @@ ipoib_ioctl(struct ifnet *ifp, u_long co struct ifreq *ifr = (struct ifreq *) data; int error = 0; + /* check if detaching */ + if (priv == NULL || priv->gone != 0) + return (ENXIO); + switch (command) { case SIOCSIFFLAGS: if (ifp->if_flags & IFF_UP) { @@ -794,6 +798,7 @@ ipoib_detach(struct ipoib_dev_priv *priv dev = priv->dev; if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { + priv->gone = 1; bpfdetach(dev); if_detach(dev); if_free(dev); From owner-svn-src-head@freebsd.org Tue Mar 15 15:53:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 74DE0ACACBA; Tue, 15 Mar 2016 15:53:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4670D18EC; Tue, 15 Mar 2016 15:53:38 +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 u2FFrbux081476; Tue, 15 Mar 2016 15:53:37 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FFrbZG081474; Tue, 15 Mar 2016 15:53:37 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603151553.u2FFrbZG081474@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Tue, 15 Mar 2016 15:53:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296910 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 15:53:38 -0000 Author: hselasky Date: Tue Mar 15 15:53:37 2016 New Revision: 296910 URL: https://svnweb.freebsd.org/changeset/base/296910 Log: Use hardware computed Toeplitz hash for incoming flowids Use the Toeplitz hash value as source for the flowid. This makes the hash value more suitable for so-called hash bucket algorithms which are used in the FreeBSD's TCP/IP stack when RSS is enabled. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c head/sys/ofed/drivers/net/mlx4/en_tx.c Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Mar 15 15:47:26 2016 (r296909) +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Mar 15 15:53:37 2016 (r296910) @@ -616,7 +616,8 @@ int mlx4_en_process_rx_cq(struct net_dev goto next; } - mb->m_pkthdr.flowid = cq->ring; + /* forward Toeplitz compatible hash value */ + mb->m_pkthdr.flowid = be32_to_cpu(cqe->immed_rss_invalid); M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); mb->m_pkthdr.rcvif = dev; if (be32_to_cpu(cqe->vlan_my_qpn) & Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Mar 15 15:47:26 2016 (r296909) +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Mar 15 15:53:37 2016 (r296910) @@ -1060,7 +1060,7 @@ mlx4_en_transmit(struct ifnet *dev, stru /* Compute which queue to use */ if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { - i = m->m_pkthdr.flowid % priv->tx_ring_num; + i = (m->m_pkthdr.flowid % 128) % priv->tx_ring_num; } else { i = mlx4_en_select_queue(dev, m); From owner-svn-src-head@freebsd.org Tue Mar 15 16:48:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5574BAD2348; Tue, 15 Mar 2016 16:48:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-io0-x229.google.com (mail-io0-x229.google.com [IPv6:2607:f8b0:4001:c06::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 1F174173E; Tue, 15 Mar 2016 16:48:23 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-io0-x229.google.com with SMTP id g203so31196311iof.2; Tue, 15 Mar 2016 09:48:23 -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=Xk7KXUQ5eJoAgLbEMKHmadnelLQHVkHqmIf+55UkJIA=; b=cwoSE8KgaU5ET5RDsNsVZ26IwyMMEz41EWPOO5FPQ3CwNBmQspdtqxcTM8MlwOdr9c Jhq6Y8qRh1VMpG8tSA/HhuD+gwmptSX2MUf3gKaqwHFM7YzkzdQnKFe+iawxOZYOXhMu EZ+52lmM04uDcjqo2XCPohxjcdS+mQb3EH9ccjTyJtpdKaibYwwam5cytASiYrpvL238 t8h0XN/FaI9L4+poaju5Z3Ivvtiv3PQhSgcRrkVRpg8sgHM1WSrBduRLfZcVkdhuMIiE 6uwR29Z619tR6uLsquOdxMu8uyt6gnCXsCo5E1793k8nhH5f3i0lX3SrmDcDoRGIzoi0 vd0w== 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=Xk7KXUQ5eJoAgLbEMKHmadnelLQHVkHqmIf+55UkJIA=; b=Fr/195vSVIWpVJKTqwoLrKv4/i7ojVZIU3dtkzIf/Ps2h/+lp/xvnzjwmfDgUhRM65 +tiadb1svawBTChYsic2tUPYyMP2r1jIMtfvjFfA4zWaYaQduXBN1VE3Y5yr3pZL6zci HRv+1fHNJnSMyy6gx1TPPpHq4s0mwGRQjAPFj4bD1H0v3BI8Xovcg0swX8MwNWcwJ4ZX eA4S+OpyWmv44k7YWDzvwTQbiH0b9wqghKZAzsXC0NpVuGlGCVgwvEDE276FYZWbLFOg mkW+k+TkpdOf2fAIIj+qoXmNCSNBFBNrGIkVEhSK33qRndnEswBDVzGN7UBib+jR74VV VWyw== X-Gm-Message-State: AD7BkJJLSUPc4h7HSywE2aehTPfq1OdX5o9bBpJb3TIuUy6gDNEiMpZVcgWEvWLfyuZqhRm1yPLfqJuec1CDog== MIME-Version: 1.0 X-Received: by 10.107.162.144 with SMTP id l138mr29420463ioe.123.1458060502435; Tue, 15 Mar 2016 09:48:22 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Tue, 15 Mar 2016 09:48:22 -0700 (PDT) In-Reply-To: <201603151553.u2FFrbZG081474@repo.freebsd.org> References: <201603151553.u2FFrbZG081474@repo.freebsd.org> Date: Tue, 15 Mar 2016 09:48:22 -0700 Message-ID: Subject: Re: svn commit: r296910 - head/sys/ofed/drivers/net/mlx4 From: Adrian Chadd To: Hans Petter Selasky Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 16:48:23 -0000 hiya, make sure you set M_HASHTYPE_ appropriately? -adrian On 15 March 2016 at 08:53, Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Mar 15 15:53:37 2016 > New Revision: 296910 > URL: https://svnweb.freebsd.org/changeset/base/296910 > > Log: > Use hardware computed Toeplitz hash for incoming flowids > > Use the Toeplitz hash value as source for the flowid. This makes the > hash value more suitable for so-called hash bucket algorithms which > are used in the FreeBSD's TCP/IP stack when RSS is enabled. > > Sponsored by: Mellanox Technologies > MFC after: 1 week > > Modified: > head/sys/ofed/drivers/net/mlx4/en_rx.c > head/sys/ofed/drivers/net/mlx4/en_tx.c > > Modified: head/sys/ofed/drivers/net/mlx4/en_rx.c > ============================================================================== > --- head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Mar 15 15:47:26 2016 (r296909) > +++ head/sys/ofed/drivers/net/mlx4/en_rx.c Tue Mar 15 15:53:37 2016 (r296910) > @@ -616,7 +616,8 @@ int mlx4_en_process_rx_cq(struct net_dev > goto next; > } > > - mb->m_pkthdr.flowid = cq->ring; > + /* forward Toeplitz compatible hash value */ > + mb->m_pkthdr.flowid = be32_to_cpu(cqe->immed_rss_invalid); > M_HASHTYPE_SET(mb, M_HASHTYPE_OPAQUE); > mb->m_pkthdr.rcvif = dev; > if (be32_to_cpu(cqe->vlan_my_qpn) & > > Modified: head/sys/ofed/drivers/net/mlx4/en_tx.c > ============================================================================== > --- head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Mar 15 15:47:26 2016 (r296909) > +++ head/sys/ofed/drivers/net/mlx4/en_tx.c Tue Mar 15 15:53:37 2016 (r296910) > @@ -1060,7 +1060,7 @@ mlx4_en_transmit(struct ifnet *dev, stru > > /* Compute which queue to use */ > if (M_HASHTYPE_GET(m) != M_HASHTYPE_NONE) { > - i = m->m_pkthdr.flowid % priv->tx_ring_num; > + i = (m->m_pkthdr.flowid % 128) % priv->tx_ring_num; > } > else { > i = mlx4_en_select_queue(dev, m); > From owner-svn-src-head@freebsd.org Tue Mar 15 17:32:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51063AD0B47; Tue, 15 Mar 2016 17:32: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 23C1A111E; Tue, 15 Mar 2016 17:32: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 u2FHWUwd015167; Tue, 15 Mar 2016 17:32:30 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FHWUSX015166; Tue, 15 Mar 2016 17:32:30 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603151732.u2FHWUSX015166@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Mar 2016 17:32:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296914 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 17:32:31 -0000 Author: emaste Date: Tue Mar 15 17:32:29 2016 New Revision: 296914 URL: https://svnweb.freebsd.org/changeset/base/296914 Log: Fix copy-n-pasteo in r296899 ukbdmap.h header generation for pc98 The ukbd default is specified by UKBD_DFLT_KEYMAP not ATKBD_DFLT_KEYMAP. PR: 193865 Submitted by: Harald Schmalzbauer Modified: head/sys/conf/files.pc98 Modified: head/sys/conf/files.pc98 ============================================================================== --- head/sys/conf/files.pc98 Tue Mar 15 17:09:27 2016 (r296913) +++ head/sys/conf/files.pc98 Tue Mar 15 17:32:29 2016 (r296914) @@ -46,7 +46,7 @@ svr4_assym.h optional compat_svr4 \ clean "svr4_assym.h" # ukbdmap.h optional ukbd_dflt_keymap \ - compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${ATKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ + compile-with "unset KEYMAP_PATH; for kmpath in ${S:S/sys$/share/}/vt/keymaps ${S:S/sys$/share/}/syscons/keymaps; do kmapfile=$${kmpath}/${UKBD_DFLT_KEYMAP:C/\.kbd$$//}.kbd; if [ -r $${kmapfile} ]; then KEYMAP_PATH=$${kmpath}; fi; done; if [ X$${KEYMAP_PATH} != X ]; then env KEYMAP_PATH=$${KEYMAP_PATH} /usr/sbin/kbdcontrol -L ${UKBD_DFLT_KEYMAP} | sed -e 's/^static keymap_t.* = /static keymap_t key_map = /' -e 's/^static accentmap_t.* = /static accentmap_t accent_map = /' > ukbdmap.h; else echo Error: ukbd_dflt_keymap not found; exit 1; fi" \ no-obj no-implicit-rule before-depend \ clean "ukbdmap.h" # From owner-svn-src-head@freebsd.org Tue Mar 15 17:53:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6F85DAD1721; Tue, 15 Mar 2016 17:53: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 51A6113D7; Tue, 15 Mar 2016 17:53: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 5E7AEB98F; Tue, 15 Mar 2016 13:53:56 -0400 (EDT) From: John Baldwin To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib Date: Tue, 15 Mar 2016 10:43:53 -0700 Message-ID: <2420759.o4YiE5Za4X@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603151547.u2FFlQKN078643@repo.freebsd.org> References: <201603151547.u2FFlQKN078643@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 15 Mar 2016 13:53:56 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 17:53:57 -0000 On Tuesday, March 15, 2016 03:47:26 PM Hans Petter Selasky wrote: > Author: hselasky > Date: Tue Mar 15 15:47:26 2016 > New Revision: 296909 > URL: https://svnweb.freebsd.org/changeset/base/296909 > > Log: > Fix witness panic in the ipoib_ioctl() function when unloading the > ipoib module. > > The bpfdetach() function is trying to turn off promiscious mode on the > network interface it is attached to while holding a mutex. The fix > consists of ignoring any further calls to the ipoib_ioctl() function > when the network interface is going to be detached. The ipoib_ioctl() > function might sleep. > > Sponsored by: Mellanox Technologies > MFC after: 1 week In all of the other NIC drivers I have worked on the fix has been to call if_detach (or ether_ifdetach) as the first step in your detach method before you try to stop the interface. The idea is to remove external connections from your driver first, and the only after those have drained do you actually shut down the hardware. Given you are calling if_detach() just before if_free() below, ipoib just seems to be broken here. For example, detach in a typical NIC driver does this: struct foo_softc *sc; sc = device_get_softc(dev); ether_ifdetach(sc->sc_ifp); FOO_LOCK(sc); foo_stop(sc); FOO_UNLOCK(sc); callout_drain(&sc->timer); bus_teardown_intr(...); bus_release_resource(...); if_free(sc->sc_ifp); Similarly, devices with a character device in /dev should be calling destroy_dev() first before shutting down hardware, etc. -- John Baldwin From owner-svn-src-head@freebsd.org Tue Mar 15 17:53:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E709AD1719; Tue, 15 Mar 2016 17:53:56 +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 5E4C813D4; Tue, 15 Mar 2016 17:53:56 +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 1C6AAB988; Tue, 15 Mar 2016 13:53:55 -0400 (EDT) From: John Baldwin To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296889 - in head: etc/mtree share/man/man7 tools/build/mk usr.sbin usr.sbin/uathload Date: Tue, 15 Mar 2016 10:46:28 -0700 Message-ID: <6741816.3kG4fYo1Js@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603150442.u2F4gbeK072837@repo.freebsd.org> References: <201603150442.u2F4gbeK072837@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 15 Mar 2016 13:53:55 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 17:53:56 -0000 On Tuesday, March 15, 2016 04:42:37 AM Warner Losh wrote: > Author: imp > Date: Tue Mar 15 04:42:37 2016 > New Revision: 296889 > URL: https://svnweb.freebsd.org/changeset/base/296889 > > Log: > Just install ar5523.bin into /usr/share/firmware and stop compiling it > in. > > Differential Review: https://reviews.freebsd.org/D5639 Maybe add a _PATH_FIRMWARE to /usr/include/paths.h? -- John Baldwin From owner-svn-src-head@freebsd.org Tue Mar 15 18:07:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D268BAD1DA7; Tue, 15 Mar 2016 18:07:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9CF701F94; Tue, 15 Mar 2016 18:07:45 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 5986B1FE024; Tue, 15 Mar 2016 19:07:43 +0100 (CET) Subject: Re: svn commit: r296910 - head/sys/ofed/drivers/net/mlx4 To: Adrian Chadd References: <201603151553.u2FFrbZG081474@repo.freebsd.org> Cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" From: Hans Petter Selasky Message-ID: <56E85015.8050900@selasky.org> Date: Tue, 15 Mar 2016 19:10:29 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 18:07:45 -0000 On 03/15/16 17:48, Adrian Chadd wrote: > hiya, > > make sure you set M_HASHTYPE_ appropriately? > I think the hashtype is not available with this chipset. I'll check it out. --HPS From owner-svn-src-head@freebsd.org Tue Mar 15 18:20:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96ED8AD217D; Tue, 15 Mar 2016 18:20:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 600A31485; Tue, 15 Mar 2016 18:20:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id A50211FE025; Tue, 15 Mar 2016 19:10:48 +0100 (CET) Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib To: John Baldwin References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <2420759.o4YiE5Za4X@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56E850CF.1000804@selasky.org> Date: Tue, 15 Mar 2016 19:13:35 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <2420759.o4YiE5Za4X@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 18:20:18 -0000 On 03/15/16 18:43, John Baldwin wrote: > On Tuesday, March 15, 2016 03:47:26 PM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Mar 15 15:47:26 2016 >> New Revision: 296909 >> URL: https://svnweb.freebsd.org/changeset/base/296909 >> >> Log: >> Fix witness panic in the ipoib_ioctl() function when unloading the >> ipoib module. >> >> The bpfdetach() function is trying to turn off promiscious mode on the >> network interface it is attached to while holding a mutex. The fix >> consists of ignoring any further calls to the ipoib_ioctl() function >> when the network interface is going to be detached. The ipoib_ioctl() >> function might sleep. >> >> Sponsored by: Mellanox Technologies >> MFC after: 1 week > > In all of the other NIC drivers I have worked on the fix has been to call > if_detach (or ether_ifdetach) as the first step in your detach method before > you try to stop the interface. The idea is to remove external connections > from your driver first, and the only after those have drained do you actually > shut down the hardware. Given you are calling if_detach() just before > if_free() below, ipoib just seems to be broken here. > > For example, detach in a typical NIC driver does this: > > struct foo_softc *sc; > > sc = device_get_softc(dev); > ether_ifdetach(sc->sc_ifp); > FOO_LOCK(sc); > foo_stop(sc); > FOO_UNLOCK(sc); > callout_drain(&sc->timer); > bus_teardown_intr(...); > bus_release_resource(...); > if_free(sc->sc_ifp); > > Similarly, devices with a character device in /dev should be calling > destroy_dev() first before shutting down hardware, etc. > I'll have a look at it. Thank you for your input. --HPS From owner-svn-src-head@freebsd.org Tue Mar 15 19:05:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1916EAD1029; Tue, 15 Mar 2016 19:05:57 +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 DEBFE1DD0; Tue, 15 Mar 2016 19:05:56 +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 u2FJ5nnD069882 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Mar 2016 12:05:49 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2FJ5nUs069881; Tue, 15 Mar 2016 12:05:49 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 15 Mar 2016 12:05:49 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160315190549.GT1328@FreeBSD.org> References: <201603150005.u2F050ps086390@repo.freebsd.org> <56E7BEB3.7020301@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56E7BEB3.7020301@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 19:05:57 -0000 Hans, On Tue, Mar 15, 2016 at 08:50:11AM +0100, Hans Petter Selasky wrote: H> > Modified: head/sys/sys/sysctl.h H> > ============================================================================== H> > --- head/sys/sys/sysctl.h Mon Mar 14 23:49:16 2016 (r296879) H> > +++ head/sys/sys/sysctl.h Tue Mar 15 00:05:00 2016 (r296880) H> > @@ -204,6 +204,7 @@ int sysctl_handle_long(SYSCTL_HANDLER_AR H> > int sysctl_handle_string(SYSCTL_HANDLER_ARGS); H> > int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); H> > int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); H> > +int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS); H> > H> > int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); H> > int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); H> > @@ -648,6 +649,26 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e H> > __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ H> > }) H> > H> > +/* Oid for an array of counter(9)s. The pointer and length must be non zero. */ H> > +#define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \ H> > + SYSCTL_OID(parent, nbr, name, \ H> > + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ H> > + (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ H> > + CTASSERT(((access) & CTLTYPE) == 0 || \ H> > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) H> > + H> H> Gleb: I suggest you follow the example of the other static SYSCTLs, and H> extend the CTASSERT to also cover the size of the array: I agree. H> CTASSERT(((access) & CTLTYPE) == 0 || \ H> (((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE && \ H> (sizeof(*(ptr)) == 8 * (len)))) Hardcoding 8 is definitely wrong here. If you come up with correct assert, feel free to commit it. I failed to imagine one quickly. H> > +#define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \ H> > + ptr, len, descr) \ H> > +({ \ H> > + counter_u64_t *__ptr = (ptr); \ H> > + CTASSERT(((access) & CTLTYPE) == 0 || \ H> > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ H> H> Same here possibly. Maybe extend the CTASSERT() to also cover the size H> of the array? Would limit the "len" to a constant argument though. Of course limiting len to constant for a dynamic oid is something we don't want. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Mar 15 19:12:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AA1EFAD12E0; Tue, 15 Mar 2016 19:12:45 +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 5F3A128F8; Tue, 15 Mar 2016 19:12:29 +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 u2FJCTi0069931 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 15 Mar 2016 12:12:29 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2FJCTjA069930; Tue, 15 Mar 2016 12:12:29 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 15 Mar 2016 12:12:29 -0700 From: Gleb Smirnoff To: Ravi Pokala Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys Message-ID: <20160315191229.GU1328@FreeBSD.org> References: <201603150005.u2F050ps086390@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 19:12:45 -0000 Ravi, On Mon, Mar 14, 2016 at 05:33:06PM -0700, Ravi Pokala wrote: R> To make sure I'm reading this correctly: R> R> (1) The sysctl operates on an opaque array of (uint64_t)s. The elements of the array are not individually accessible. On array of counter_u64_t. The elements are individually accessible of course, but not by this sysctl API. R> (2) Reading the sysctl populates each element of the userspace array by calling counter_u64_fetch() on the corresponding element of the kernelspace array. Right. R> (3) Writing the sysctl clears the kernelspace array by calling counter_u64_zero() on each element. Right. R> For example, if you have a bunch of device statistics, this interface will let you get or clear them all in one shot, but they won't have distinct names. You would have to define an enum to set up names for the array indices. Something what you want is already provided by VNET_PCPUSTAT* macros. The idea is that you declare a struct, whose members all are uint64_t. This struct becomes an API between userland and kernel. The VNET_PCPUSTAT* macros then are used to allocate nameless arrays of counter(9)s, with number of elements equal to number of members in the API struct. Each counter array element accumulates statistics for its corresponding struct member. The only problem, is that VIMAGE is mixed into this set of macros. What needs to be done is separate logic of making correspondence of array of counters to struct members and VIMAGE, yielding in a more generic and network unaware KPI. This KPI should be moved from vnet.h into counter.h, and in vnet.h there should remain macros that summon VIMAGE awareness upon the new macros in counter.h. See struct tcpstat as example usage of VNET_PCPUSTAT* macros. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Mar 15 19:26:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB368AD182D; Tue, 15 Mar 2016 19:26:33 +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 C5DAD2F75; Tue, 15 Mar 2016 19:26:33 +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 u2FJQWEb049100; Tue, 15 Mar 2016 19:26:32 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FJQW9M049095; Tue, 15 Mar 2016 19:26:32 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603151926.u2FJQW9M049095@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Mar 2016 19:26:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296915 - in head/lib/libc: db/mpool gen iconv posix1e secure X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 19:26:34 -0000 Author: emaste Date: Tue Mar 15 19:26:32 2016 New Revision: 296915 URL: https://svnweb.freebsd.org/changeset/base/296915 Log: libc: don't build compat functions if building WITHOUT_SYMVER WITHOUT_SYMVER necessarily implies building a system without symver backwards compatability. Sponsored by: The FreeBSD Foundation Modified: head/lib/libc/db/mpool/Makefile.inc head/lib/libc/gen/Makefile.inc head/lib/libc/iconv/Makefile.inc head/lib/libc/posix1e/Makefile.inc head/lib/libc/secure/Makefile.inc Modified: head/lib/libc/db/mpool/Makefile.inc ============================================================================== --- head/lib/libc/db/mpool/Makefile.inc Tue Mar 15 17:32:29 2016 (r296914) +++ head/lib/libc/db/mpool/Makefile.inc Tue Mar 15 19:26:32 2016 (r296915) @@ -3,4 +3,7 @@ .PATH: ${LIBC_SRCTOP}/db/mpool -SRCS+= mpool.c mpool-compat.c +SRCS+= mpool.c +.if ${MK_SYMVER} == yes +SRCS+= mpool-compat.c +.endif Modified: head/lib/libc/gen/Makefile.inc ============================================================================== --- head/lib/libc/gen/Makefile.inc Tue Mar 15 17:32:29 2016 (r296914) +++ head/lib/libc/gen/Makefile.inc Tue Mar 15 19:26:32 2016 (r296915) @@ -49,7 +49,6 @@ SRCS+= __getosreldate.c \ fstab.c \ ftok.c \ fts.c \ - fts-compat.c \ ftw.c \ getbootfile.c \ getbsize.c \ @@ -137,7 +136,6 @@ SRCS+= __getosreldate.c \ ualarm.c \ ulimit.c \ uname.c \ - unvis-compat.c \ usleep.c \ utime.c \ utxdb.c \ @@ -147,6 +145,10 @@ SRCS+= __getosreldate.c \ waitpid.c \ waitid.c \ wordexp.c +.if ${MK_SYMVER} == yes +SRCS+= fts-compat.c \ + unvis-compat.c +.endif .PATH: ${LIBC_SRCTOP}/../../contrib/libc-pwcache SRCS+= pwcache.c pwcache.h Modified: head/lib/libc/iconv/Makefile.inc ============================================================================== --- head/lib/libc/iconv/Makefile.inc Tue Mar 15 17:32:29 2016 (r296914) +++ head/lib/libc/iconv/Makefile.inc Tue Mar 15 19:26:32 2016 (r296915) @@ -14,7 +14,11 @@ SRCS+= citrus_bcs.c citrus_bcs_strtol.c citrus_esdb.c citrus_hash.c citrus_iconv.c citrus_lookup.c \ citrus_lookup_factory.c citrus_mapper.c citrus_memstream.c \ citrus_mmap.c citrus_module.c citrus_none.c citrus_pivot_factory.c \ - citrus_prop.c citrus_stdenc.c bsd_iconv.c iconv_compat.c + citrus_prop.c citrus_stdenc.c bsd_iconv.c +.if ${MK_SYMVER} == yes +SRCS+= iconv_compat.c +.endif + SYM_MAPS+= ${LIBC_SRCTOP}/iconv/Symbol.map .if ${MK_ICONV} == yes Modified: head/lib/libc/posix1e/Makefile.inc ============================================================================== --- head/lib/libc/posix1e/Makefile.inc Tue Mar 15 17:32:29 2016 (r296914) +++ head/lib/libc/posix1e/Makefile.inc Tue Mar 15 19:26:32 2016 (r296915) @@ -11,7 +11,6 @@ subr_acl_nfs4.c: ${LIBC_SRCTOP}/../../sy SRCS+= acl_branding.c \ acl_calc_mask.c \ acl_copy.c \ - acl_compat.c \ acl_delete.c \ acl_delete_entry.c \ acl_entry.c \ @@ -36,6 +35,9 @@ SRCS+= acl_branding.c \ mac_get.c \ mac_set.c \ subr_acl_nfs4.c +.if ${MK_SYMVER} == yes +SRCS+= acl_compat.c +.endif SYM_MAPS+=${LIBC_SRCTOP}/posix1e/Symbol.map Modified: head/lib/libc/secure/Makefile.inc ============================================================================== --- head/lib/libc/secure/Makefile.inc Tue Mar 15 17:32:29 2016 (r296914) +++ head/lib/libc/secure/Makefile.inc Tue Mar 15 19:26:32 2016 (r296915) @@ -5,8 +5,9 @@ .PATH: ${LIBC_SRCTOP}/secure # Sources common to both syscall interfaces: -SRCS+= \ - stack_protector.c \ - stack_protector_compat.c +SRCS+= stack_protector.c +.if ${MK_SYMVER} == yes +SRCS+= stack_protector_compat.c +.endif SYM_MAPS+= ${LIBC_SRCTOP}/secure/Symbol.map From owner-svn-src-head@freebsd.org Tue Mar 15 19:58:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0BDDAD224F; Tue, 15 Mar 2016 19:58:35 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from mr11p00im-asmtp002.me.com (mr11p00im-asmtp002.me.com [17.110.69.253]) (using TLSv1.2 with cipher DHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CD0881A4C; Tue, 15 Mar 2016 19:58:35 +0000 (UTC) (envelope-from rpokala@mac.com) Received: from [172.17.133.77] (dip-cali.panasas.com [64.80.217.3]) by mr11p00im-asmtp002.me.com (Oracle Communications Messaging Server 7.0.5.36.0 64bit (built Sep 8 2015)) with ESMTPSA id <0O43008MXJHG9G30@mr11p00im-asmtp002.me.com>; Tue, 15 Mar 2016 19:58:29 +0000 (GMT) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-03-15_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1510270003 definitions=main-1603150275 User-Agent: Microsoft-MacOutlook/0.0.0.160212 Date: Tue, 15 Mar 2016 12:58:27 -0700 Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys From: Ravi Pokala Sender: "Pokala, Ravi" To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-id: <12F068CE-1975-4A6B-A2F7-756367B29972@panasas.com> Thread-topic: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys References: <201603150005.u2F050ps086390@repo.freebsd.org> <20160315191229.GU1328@FreeBSD.org> In-reply-to: <20160315191229.GU1328@FreeBSD.org> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 19:58:36 -0000 Hi Gleb, -----Original Message----- From: Gleb Smirnoff Date: 2016-03-15, Tuesday at 12:12 To: Ravi Pokala Cc: , , Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys > Ravi, > >On Mon, Mar 14, 2016 at 05:33:06PM -0700, Ravi Pokala wrote: >R> To make sure I'm reading this correctly: >R> >R> (1) The sysctl operates on an opaque array of (uint64_t)s. The elements of the array are not individually accessible. > >On array of counter_u64_t. The elements are individually accessible of course, >but not by this sysctl API. Got it. >R> For example, if you have a bunch of device statistics, this interface will let you get or clear them all in one shot, but they won't have distinct names. You would have to define an enum to set up names for the array indices. > >Something what you want is already provided by VNET_PCPUSTAT* macros. >The idea is that you declare a struct, whose members all are uint64_t. >This struct becomes an API between userland and kernel. > >The VNET_PCPUSTAT* macros then are used to allocate nameless arrays of >counter(9)s, with number of elements equal to number of members in the API >struct. Each counter array element accumulates statistics for its corresponding >struct member. > >The only problem, is that VIMAGE is mixed into this set of macros. Yeah. I think I looked at that stuff before, and got confused. Between this new change, and other uses of counter(9) which have been introduced since I last looked, I understand this quite a bit better now. >What needs >to be done is separate logic of making correspondence of array of counters to >struct members and VIMAGE, yielding in a more generic and network unaware KPI. >This KPI should be moved from vnet.h into counter.h, and in vnet.h there should >remain macros that summon VIMAGE awareness upon the new macros in counter.h. > >See struct tcpstat as example usage of VNET_PCPUSTAT* macros. The one that clarified it the most for me was SFSTAT_ADD() - the use of offsetof() to map between the name of the stat field in (struct sfstat) and the array index. Thanks! -Ravi (rpokala@) >-- >Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Tue Mar 15 20:42:37 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4ECDDAD2EB0; Tue, 15 Mar 2016 20:42:37 +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 1E62217E0; Tue, 15 Mar 2016 20:42:37 +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 u2FKganG073413; Tue, 15 Mar 2016 20:42:36 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FKgafc073412; Tue, 15 Mar 2016 20:42:36 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603152042.u2FKgafc073412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Tue, 15 Mar 2016 20:42:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296918 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 20:42:37 -0000 Author: trasz Date: Tue Mar 15 20:42:36 2016 New Revision: 296918 URL: https://svnweb.freebsd.org/changeset/base/296918 Log: Pacify Coverity. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 19:45:24 2016 (r296917) +++ head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 20:42:36 2016 (r296918) @@ -370,8 +370,10 @@ static size_t autofs_dirent_reclen(const char *name) { size_t reclen; + int error; - autofs_readdir_one(NULL, name, -1, &reclen); + error = autofs_readdir_one(NULL, name, -1, &reclen); + KASSERT(error == 0, ("autofs_readdir_one() failed")); return (reclen); } From owner-svn-src-head@freebsd.org Tue Mar 15 21:09:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C2A5AD0798; Tue, 15 Mar 2016 21:09:38 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f180.google.com (mail-yw0-f180.google.com [209.85.161.180]) (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 DA95728CE; Tue, 15 Mar 2016 21:09:37 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f180.google.com with SMTP id g127so37668678ywf.2; Tue, 15 Mar 2016 14:09: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=kIPMM13AJOAtZxkRxdrE4zH+Jeps0vgyVzCE6QmF0VA=; b=ma6JrinvlkyBe5fnMHp5z1xYYNK26xwSfhnkW7mrgbxz89JlujBGl5w3yMFUS4lRwG a9S+y3pAxJyk+ukgO3825W0ZAlYhW/+XvF80x0RWvndgKyioNWyw8UCj29PUy8bNrp1l Ws5hawlT1/j/duL52gusN5RkZJ0ZJy0/b6COJ3xLCiq2EG6IG2eF2VFmILhjvqzmqsW2 uy0ZDGzDe535pn1Irw4YbTddQxygKhOXPI4FYxyqfVW274z78nYav8V2/C+VsGczK9Gs Bnal16Xgz6NOb9WUJI4ulB/l4E+8vkURzihp3TLDY7mSOaxLiEWlLvFHvtJ8CqMVk0Ml UIdA== X-Gm-Message-State: AD7BkJIvJ9QNGMOPNbwO4A7SPkuikxex0U0Yec/dKw1j9Uf9vFVsVOYM/eu/91oGriwm1w== X-Received: by 10.129.97.7 with SMTP id v7mr9304ywb.237.1458074772347; Tue, 15 Mar 2016 13:46:12 -0700 (PDT) Received: from mail-yw0-f171.google.com (mail-yw0-f171.google.com. [209.85.161.171]) by smtp.gmail.com with ESMTPSA id f126sm18291581ywc.22.2016.03.15.13.46.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Mar 2016 13:46:12 -0700 (PDT) Received: by mail-yw0-f171.google.com with SMTP id m126so12948786ywd.0; Tue, 15 Mar 2016 13:46:11 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.13.217.77 with SMTP id b74mr23963ywe.73.1458074771769; Tue, 15 Mar 2016 13:46:11 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.115.134 with HTTP; Tue, 15 Mar 2016 13:46:11 -0700 (PDT) In-Reply-To: <201603152042.u2FKgafc073412@repo.freebsd.org> References: <201603152042.u2FKgafc073412@repo.freebsd.org> Date: Tue, 15 Mar 2016 13:46:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r296918 - head/sys/fs/autofs From: Conrad Meyer To: Edward Tomasz Napierala 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 21:09:38 -0000 Instead you will get, "warning: unused but set variable 'error'" on -NODEBUG builds. Maybe add: (void)error; Best, Conrad On Tue, Mar 15, 2016 at 1:42 PM, Edward Tomasz Napierala wrote: > Author: trasz > Date: Tue Mar 15 20:42:36 2016 > New Revision: 296918 > URL: https://svnweb.freebsd.org/changeset/base/296918 > > Log: > Pacify Coverity. > > MFC after: 1 month > Sponsored by: The FreeBSD Foundation > > Modified: > head/sys/fs/autofs/autofs_vnops.c > > Modified: head/sys/fs/autofs/autofs_vnops.c > ============================================================================== > --- head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 19:45:24 2016 (r296917) > +++ head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 20:42:36 2016 (r296918) > @@ -370,8 +370,10 @@ static size_t > autofs_dirent_reclen(const char *name) > { > size_t reclen; > + int error; > > - autofs_readdir_one(NULL, name, -1, &reclen); > + error = autofs_readdir_one(NULL, name, -1, &reclen); > + KASSERT(error == 0, ("autofs_readdir_one() failed")); > > return (reclen); > } > From owner-svn-src-head@freebsd.org Tue Mar 15 21:21:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3CA48AD0DF5; Tue, 15 Mar 2016 21:21: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 0F4581324; Tue, 15 Mar 2016 21:21: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 u2FLLSCW084676; Tue, 15 Mar 2016 21:21:28 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FLLS3B084675; Tue, 15 Mar 2016 21:21:28 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603152121.u2FLLS3B084675@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 15 Mar 2016 21:21:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296919 - head/sys/cddl/compat/opensolaris/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 21:21:29 -0000 Author: mav Date: Tue Mar 15 21:21:28 2016 New Revision: 296919 URL: https://svnweb.freebsd.org/changeset/base/296919 Log: Fix small memory leak on attempt to access deleted snapshot. MFC after: 3 days Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Mar 15 20:42:36 2016 (r296918) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_vfs.c Tue Mar 15 21:21:28 2016 (r296919) @@ -196,6 +196,7 @@ mount_snapshot(kthread_t *td, vnode_t ** VI_UNLOCK(vp); vrele(vp); vfs_unbusy(mp); + vfs_freeopts(mp->mnt_optnew); vfs_mount_destroy(mp); *vpp = NULL; return (error); From owner-svn-src-head@freebsd.org Tue Mar 15 21:32:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6D0BFAD122C; Tue, 15 Mar 2016 21:32:47 +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 3AA042295; Tue, 15 Mar 2016 21:32:47 +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 u2FLWkui088327; Tue, 15 Mar 2016 21:32:46 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FLWkNR088326; Tue, 15 Mar 2016 21:32:46 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603152132.u2FLWkNR088326@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Tue, 15 Mar 2016 21:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296920 - head/usr.bin/vtfontcvt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 21:32:47 -0000 Author: emaste Date: Tue Mar 15 21:32:46 2016 New Revision: 296920 URL: https://svnweb.freebsd.org/changeset/base/296920 Log: vtfontcvt: support .hex fonts with characters beyond the Unicode BMP This is already supported by the vt(4) vfnt format mapping from code points to glyphs. Update the .hex font parser to accept up to six hex digits. Modified: head/usr.bin/vtfontcvt/vtfontcvt.c Modified: head/usr.bin/vtfontcvt/vtfontcvt.c ============================================================================== --- head/usr.bin/vtfontcvt/vtfontcvt.c Tue Mar 15 21:21:28 2016 (r296919) +++ head/usr.bin/vtfontcvt/vtfontcvt.c Tue Mar 15 21:32:46 2016 (r296920) @@ -315,12 +315,13 @@ parse_hex(FILE *fp, unsigned int map_idx if (bytes != NULL) errx(1, "malformed input: Width tag after font data"); set_width(atoi(ln + 9)); - } else if (sscanf(ln, "%4x:", &curchar)) { + } else if (sscanf(ln, "%6x:", &curchar)) { if (bytes == NULL) { bytes = xmalloc(wbytes * height); bytes_r = xmalloc(wbytes * height); } - p = ln + 5; + /* ln is guaranteed to have a colon here. */ + p = strchr(ln, ':') + 1; chars_per_row = strlen(p) / height; dwidth = width; if (chars_per_row / 2 > (width + 7) / 8) From owner-svn-src-head@freebsd.org Tue Mar 15 21:56:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 743C7AD24FA; Tue, 15 Mar 2016 21:56:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from gw.catspoiler.org (unknown [IPv6:2602:304:b010:ef20::f2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "gw.catspoiler.org", Issuer "gw.catspoiler.org" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 36228B93; Tue, 15 Mar 2016 21:56:25 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.15.2/8.15.2) with ESMTP id u2FLuDPJ035986; Tue, 15 Mar 2016 14:56:17 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <201603152156.u2FLuDPJ035986@gw.catspoiler.org> Date: Tue, 15 Mar 2016 14:56:13 -0700 (PDT) From: Don Lewis Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys To: glebius@FreeBSD.org cc: hps@selasky.org, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org In-Reply-To: <20160315190549.GT1328@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 21:56:25 -0000 On 15 Mar, Gleb Smirnoff wrote: > Hans, > > On Tue, Mar 15, 2016 at 08:50:11AM +0100, Hans Petter Selasky wrote: > H> > Modified: head/sys/sys/sysctl.h > H> > ============================================================================== > H> > --- head/sys/sys/sysctl.h Mon Mar 14 23:49:16 2016 (r296879) > H> > +++ head/sys/sys/sysctl.h Tue Mar 15 00:05:00 2016 (r296880) > H> > @@ -204,6 +204,7 @@ int sysctl_handle_long(SYSCTL_HANDLER_AR > H> > int sysctl_handle_string(SYSCTL_HANDLER_ARGS); > H> > int sysctl_handle_opaque(SYSCTL_HANDLER_ARGS); > H> > int sysctl_handle_counter_u64(SYSCTL_HANDLER_ARGS); > H> > +int sysctl_handle_counter_u64_array(SYSCTL_HANDLER_ARGS); > H> > > H> > int sysctl_handle_uma_zone_max(SYSCTL_HANDLER_ARGS); > H> > int sysctl_handle_uma_zone_cur(SYSCTL_HANDLER_ARGS); > H> > @@ -648,6 +649,26 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e > H> > __ptr, 0, sysctl_handle_counter_u64, "QU", __DESCR(descr)); \ > H> > }) > H> > > H> > +/* Oid for an array of counter(9)s. The pointer and length must be non zero. */ > H> > +#define SYSCTL_COUNTER_U64_ARRAY(parent, nbr, name, access, ptr, len, descr) \ > H> > + SYSCTL_OID(parent, nbr, name, \ > H> > + CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ > H> > + (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ > H> > + CTASSERT(((access) & CTLTYPE) == 0 || \ > H> > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > H> > + > H> > H> Gleb: I suggest you follow the example of the other static SYSCTLs, and > H> extend the CTASSERT to also cover the size of the array: > > I agree. > > H> CTASSERT(((access) & CTLTYPE) == 0 || \ > H> (((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE && \ > H> (sizeof(*(ptr)) == 8 * (len)))) > > Hardcoding 8 is definitely wrong here. If you come up with correct assert, > feel free to commit it. I failed to imagine one quickly. > > H> > +#define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \ > H> > + ptr, len, descr) \ > H> > +({ \ > H> > + counter_u64_t *__ptr = (ptr); \ > H> > + CTASSERT(((access) & CTLTYPE) == 0 || \ > H> > + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE); \ > H> > H> Same here possibly. Maybe extend the CTASSERT() to also cover the size > H> of the array? Would limit the "len" to a constant argument though. > > Of course limiting len to constant for a dynamic oid is something we > don't want. How can you do a CTASSERT() on something that isn't known at compile time? From owner-svn-src-head@freebsd.org Tue Mar 15 22:27:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3C3A6AD2C74; Tue, 15 Mar 2016 22:27:31 +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 0FB42D67; Tue, 15 Mar 2016 22:27:30 +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 u2FMRUkA003897; Tue, 15 Mar 2016 22:27:30 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2FMRUAc003895; Tue, 15 Mar 2016 22:27:30 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603152227.u2FMRUAc003895@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Tue, 15 Mar 2016 22:27:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296921 - head/share/mk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Mar 2016 22:27:31 -0000 Author: bdrewery Date: Tue Mar 15 22:27:29 2016 New Revision: 296921 URL: https://svnweb.freebsd.org/changeset/base/296921 Log: Partially revert r266227 and stop stripping paths in ldscripts. Specifically this fixes /usr/lib/libc.so stripping the paths to the libraries. The reason for this in r266227 was both likely because ld(1) did not fully respect --sysroot until r291226 and because of the lib32 build. The lib32 build does not use --sysroot into the /usr/lib32 path, rather it only uses -L and -B into the /usr/lib32 path and --sysroot into the normal (64bit) /usr/lib. The _LDSCRIPTROOT was added with the ldscript support in bsd.lib.mk so that it builds a 32-bit-sysrooted pathed ldscript in the object directory and then installs a normal unprefixed version in installworld. This commit also fixes the rebuild during install which was broken in r266227. This commit would break DIRDEPS_BUILD build of lib32 but it does not currently have a way to build it anyhow. For example, before this change we had in /usr/lib/libc.so: GROUP ( libc.so.7 libc_nonshared.a libssp_nonshared.a ) Now it is restored to pre-r266227: GROUP ( /lib/libc.so.7 /usr/lib/libc_nonshared.a /usr/lib/libssp_nonshared.a ) The motivation for this is in testing of lld. From emaste: lld does not have built-in search paths (e.g. /lib, /usr/lib) and relies on -L arguments passed by the caller. As the linker is nearly always invoked from the clang driver this is fine other than the fact that /usr/lib/libc.so is an ldscript that refers to libc.so.7 which is in /lib, not /usr/lib. PR: 207980 Reported by: emaste Submitted by: emaste (based on) Differential Revision: https://reviews.freebsd.org/D5637 Modified: head/share/mk/bsd.lib.mk head/share/mk/bsd.sys.mk Modified: head/share/mk/bsd.lib.mk ============================================================================== --- head/share/mk/bsd.lib.mk Tue Mar 15 21:32:46 2016 (r296920) +++ head/share/mk/bsd.lib.mk Tue Mar 15 22:27:29 2016 (r296921) @@ -235,7 +235,6 @@ ${SHLIB_NAME_FULL}: beforelinking ${SHLIB_LINK:R}.ld: ${.CURDIR}/${SHLIB_LDSCRIPT} sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${_SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${_LIBDIR},g' \ - -e 's,/[^ ]*/,,g' \ ${.ALLSRC} > ${.TARGET} ${SHLIB_NAME_FULL}: ${SHLIB_LINK:R}.ld @@ -339,6 +338,9 @@ _SHLINSTALLFLAGS:= ${_SHLINSTALLFLAGS${i .if !defined(INTERNALLIB) realinstall: _libinstall .ORDER: beforeinstall _libinstall +.if target(${SHLIB_LINK:R}.ld) +_libinstall: ${SHLIB_LINK:R}.ld +.endif _libinstall: .if defined(LIB) && !empty(LIB) && ${MK_INSTALLLIB} != "no" ${INSTALL} -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ @@ -365,6 +367,7 @@ _libinstall: ${INSTALL} -S -C -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} \ ${_INSTALLFLAGS} ${SHLIB_LINK:R}.ld \ ${DESTDIR}${_LIBDIR}/${SHLIB_LINK} + rm -f ${SHLIB_LINK:R}.ld .for _SHLIB_LINK_LINK in ${SHLIB_LDSCRIPT_LINKS} ${INSTALL_SYMLINK} ${SHLIB_LINK} ${DESTDIR}${_LIBDIR}/${_SHLIB_LINK_LINK} .endfor Modified: head/share/mk/bsd.sys.mk ============================================================================== --- head/share/mk/bsd.sys.mk Tue Mar 15 21:32:46 2016 (r296920) +++ head/share/mk/bsd.sys.mk Tue Mar 15 22:27:29 2016 (r296921) @@ -231,7 +231,7 @@ stage_files.shlib: ${_LIBS:M*.so.*} .endif .if defined(SHLIB_LINK) && commands(${SHLIB_LINK:R}.ld) -_LDSCRIPTROOT?= ${STAGE_OBJTOP} +#_LDSCRIPTROOT?= ${STAGE_OBJTOP} STAGE_AS_SETS+= ldscript STAGE_AS.ldscript+= ${SHLIB_LINK:R}.ld stage_as.ldscript: ${SHLIB_LINK:R}.ld From owner-svn-src-head@freebsd.org Wed Mar 16 01:41:56 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FE6AD2AF3; Wed, 16 Mar 2016 01:41:56 +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 803EE21E; Wed, 16 Mar 2016 01:41:56 +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 u2G1ft8D063718; Wed, 16 Mar 2016 01:41:55 GMT (envelope-from smh@FreeBSD.org) Received: (from smh@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G1ftQv063717; Wed, 16 Mar 2016 01:41:55 GMT (envelope-from smh@FreeBSD.org) Message-Id: <201603160141.u2G1ftQv063717@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: smh set sender to smh@FreeBSD.org using -f From: Steven Hartland Date: Wed, 16 Mar 2016 01:41:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296922 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 01:41:56 -0000 Author: smh Date: Wed Mar 16 01:41:55 2016 New Revision: 296922 URL: https://svnweb.freebsd.org/changeset/base/296922 Log: Prevent invalid ixgbe advertise setting warning Prevent ixgbe outputting "Invalid advertised speed" warning on boot with no customisations by moving test from sysctl handler to set handler. PR: 208022 MFC after: 3 days Sponsored by: Multiplay Modified: head/sys/dev/ixgbe/if_ix.c Modified: head/sys/dev/ixgbe/if_ix.c ============================================================================== --- head/sys/dev/ixgbe/if_ix.c Tue Mar 15 22:27:29 2016 (r296921) +++ head/sys/dev/ixgbe/if_ix.c Wed Mar 16 01:41:55 2016 (r296922) @@ -4749,10 +4749,6 @@ ixgbe_sysctl_advertise(SYSCTL_HANDLER_AR if ((error) || (req->newptr == NULL)) return (error); - /* Checks to validate new value */ - if (adapter->advertise == advertise) /* no change */ - return (0); - return ixgbe_set_advertise(adapter, advertise); } @@ -4763,6 +4759,10 @@ ixgbe_set_advertise(struct adapter *adap struct ixgbe_hw *hw; ixgbe_link_speed speed; + /* Checks to validate new value */ + if (adapter->advertise == advertise) /* no change */ + return (0); + hw = &adapter->hw; dev = adapter->dev; From owner-svn-src-head@freebsd.org Wed Mar 16 02:07:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7927CAD147B; Wed, 16 Mar 2016 02:07:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37AA334F; Wed, 16 Mar 2016 02:07:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2G275ow070146; Wed, 16 Mar 2016 02:07:05 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G275bN070143; Wed, 16 Mar 2016 02:07:05 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603160207.u2G275bN070143@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 16 Mar 2016 02:07:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296925 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 02:07:06 -0000 Author: adrian Date: Wed Mar 16 02:07:04 2016 New Revision: 296925 URL: https://svnweb.freebsd.org/changeset/base/296925 Log: [net80211] Begin implementing rate control module stats. * Implement a new ratectl method, which defaults to returning nothing; * Add a top level sysctl (net.wlan.X.rate_stats) to extract it; * Add ratectl info for the 'amrr' module. Tested: * urtwn(4), STA mode Differential Revision: https://reviews.freebsd.org/D5630 Modified: head/sys/net80211/ieee80211_amrr.c head/sys/net80211/ieee80211_ratectl.c head/sys/net80211/ieee80211_ratectl.h Modified: head/sys/net80211/ieee80211_amrr.c ============================================================================== --- head/sys/net80211/ieee80211_amrr.c Wed Mar 16 02:01:17 2016 (r296924) +++ head/sys/net80211/ieee80211_amrr.c Wed Mar 16 02:07:04 2016 (r296925) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -75,6 +76,7 @@ static void amrr_tx_update(const struct const struct ieee80211_node *, void *, void *, void *); static void amrr_sysctlattach(struct ieee80211vap *, struct sysctl_ctx_list *, struct sysctl_oid *); +static void amrr_node_stats(struct ieee80211_node *ni, struct sbuf *s); /* number of references from net80211 layer */ static int nrefs = 0; @@ -91,6 +93,7 @@ static const struct ieee80211_ratectl am .ir_tx_complete = amrr_tx_complete, .ir_tx_update = amrr_tx_update, .ir_setinterval = amrr_setinterval, + .ir_node_stats = amrr_node_stats, }; IEEE80211_RATECTL_MODULE(amrr, 1); IEEE80211_RATECTL_ALG(amrr, IEEE80211_RATECTL_AMRR, amrr); @@ -410,3 +413,31 @@ amrr_sysctlattach(struct ieee80211vap *v "amrr_min_sucess_threshold", CTLFLAG_RW, &amrr->amrr_min_success_threshold, 0, ""); } + +static void +amrr_node_stats(struct ieee80211_node *ni, struct sbuf *s) +{ + int rate; + struct ieee80211_amrr_node *amn = ni->ni_rctls; + struct ieee80211_rateset *rs; + + /* XXX TODO: check locking? */ + + /* XXX TODO: this should be a method */ + if (amrr_node_is_11n(ni)) { + rs = (struct ieee80211_rateset *) &ni->ni_htrates; + rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + sbuf_printf(s, "rate: MCS %d\n", rate); + } else { + rs = &ni->ni_rates; + rate = rs->rs_rates[amn->amn_rix] & IEEE80211_RATE_VAL; + sbuf_printf(s, "rate: %d Mbit\n", rate / 2); + } + + sbuf_printf(s, "ticks: %d\n", amn->amn_ticks); + sbuf_printf(s, "txcnt: %u\n", amn->amn_txcnt); + sbuf_printf(s, "success: %u\n", amn->amn_success); + sbuf_printf(s, "success_threshold: %u\n", amn->amn_success_threshold); + sbuf_printf(s, "recovery: %u\n", amn->amn_recovery); + sbuf_printf(s, "retry_cnt: %u\n", amn->amn_retrycnt); +} Modified: head/sys/net80211/ieee80211_ratectl.c ============================================================================== --- head/sys/net80211/ieee80211_ratectl.c Wed Mar 16 02:01:17 2016 (r296924) +++ head/sys/net80211/ieee80211_ratectl.c Wed Mar 16 02:07:04 2016 (r296925) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -68,12 +69,52 @@ ieee80211_ratectl_unregister(int type) ratectls[type] = NULL; } +static void +ieee80211_ratectl_sysctl_stats_node_iter(void *arg, struct ieee80211_node *ni) +{ + + struct sbuf *sb = (struct sbuf *) arg; + sbuf_printf(sb, "MAC: %6D\n", ni->ni_macaddr, ":"); + ieee80211_ratectl_node_stats(ni, sb); + sbuf_printf(sb, "\n"); +} + +static int +ieee80211_ratectl_sysctl_stats(SYSCTL_HANDLER_ARGS) +{ + struct ieee80211vap *vap = arg1; + struct ieee80211com *ic = vap->iv_ic; + struct sbuf sb; + int error; + + error = sysctl_wire_old_buffer(req, 0); + if (error) + return (error); + sbuf_new_for_sysctl(&sb, NULL, 8, req); + sbuf_clear_flags(&sb, SBUF_INCLUDENUL); + + IEEE80211_LOCK(ic); + ieee80211_iterate_nodes(&ic->ic_sta, + ieee80211_ratectl_sysctl_stats_node_iter, + &sb); + IEEE80211_UNLOCK(ic); + + error = sbuf_finish(&sb); + sbuf_delete(&sb); + return (error); +} + void ieee80211_ratectl_init(struct ieee80211vap *vap) { if (vap->iv_rate == ratectls[IEEE80211_RATECTL_NONE]) ieee80211_ratectl_set(vap, IEEE80211_RATECTL_AMRR); vap->iv_rate->ir_init(vap); + + /* Attach generic stats sysctl */ + SYSCTL_ADD_PROC(vap->iv_sysctl, SYSCTL_CHILDREN(vap->iv_oid), OID_AUTO, + "rate_stats", CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, vap, + 0, ieee80211_ratectl_sysctl_stats, "A", "ratectl node stats"); } void Modified: head/sys/net80211/ieee80211_ratectl.h ============================================================================== --- head/sys/net80211/ieee80211_ratectl.h Wed Mar 16 02:01:17 2016 (r296924) +++ head/sys/net80211/ieee80211_ratectl.h Wed Mar 16 02:07:04 2016 (r296925) @@ -53,6 +53,7 @@ struct ieee80211_ratectl { const struct ieee80211_node *, void *, void *, void *); void (*ir_setinterval)(const struct ieee80211vap *, int); + void (*ir_node_stats)(struct ieee80211_node *ni, struct sbuf *s); }; void ieee80211_ratectl_register(int, const struct ieee80211_ratectl *); @@ -115,3 +116,13 @@ ieee80211_ratectl_setinterval(const stru return; vap->iv_rate->ir_setinterval(vap, msecs); } + +static __inline void +ieee80211_ratectl_node_stats(struct ieee80211_node *ni, struct sbuf *s) +{ + const struct ieee80211vap *vap = ni->ni_vap; + + if (vap->iv_rate->ir_node_stats == NULL) + return; + vap->iv_rate->ir_node_stats(ni, s); +} From owner-svn-src-head@freebsd.org Wed Mar 16 04:05:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EC5FDAD2143; Wed, 16 Mar 2016 04:05:03 +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 C8756A4; Wed, 16 Mar 2016 04:05:03 +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 u2G453vt006364; Wed, 16 Mar 2016 04:05:03 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G452kJ006362; Wed, 16 Mar 2016 04:05:02 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603160405.u2G452kJ006362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Mar 2016 04:05:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296926 - head/usr.sbin/kbdcontrol X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 04:05:04 -0000 Author: emaste Date: Wed Mar 16 04:05:02 2016 New Revision: 296926 URL: https://svnweb.freebsd.org/changeset/base/296926 Log: kbdcontrol: add -P path option to add keymap search paths PR: 193865 Reviewed by: cem Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D5645 Modified: head/usr.sbin/kbdcontrol/kbdcontrol.1 head/usr.sbin/kbdcontrol/kbdcontrol.c Modified: head/usr.sbin/kbdcontrol/kbdcontrol.1 ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.1 Wed Mar 16 02:07:04 2016 (r296925) +++ head/usr.sbin/kbdcontrol/kbdcontrol.1 Wed Mar 16 04:05:02 2016 (r296926) @@ -13,7 +13,7 @@ .\" @(#)kbdcontrol.1 .\" $FreeBSD$ .\" -.Dd January 29, 2008 +.Dd March 16, 2016 .Dt KBDCONTROL 1 .Os .Sh NAME @@ -36,6 +36,7 @@ .Op Fl f Ar # Ar string .Op Fl k Ar keyboard_device .Op Fl L Ar keymap_file +.Op Fl P Ar path .Sh DESCRIPTION The .Nm @@ -171,6 +172,12 @@ and write the compiled from it to stdout. This option is primarily intended for programmers and is probably of little use under normal circumstances. +.It Fl P Ar path +Search for the keymap file in +.Ar path . +The +.Fl P +option may be specified multiple times. .El .Sh ENVIRONMENT The environment variable Modified: head/usr.sbin/kbdcontrol/kbdcontrol.c ============================================================================== --- head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Mar 16 02:07:04 2016 (r296925) +++ head/usr.sbin/kbdcontrol/kbdcontrol.c Wed Mar 16 04:05:02 2016 (r296926) @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "path.h" #include "lex.h" @@ -112,11 +113,13 @@ static const int repeats[] = { 34, 38, static const int ndelays = (sizeof(delays) / sizeof(int)); static const int nrepeats = (sizeof(repeats) / sizeof(int)); static int hex = 0; +static int paths_configured = 0; static int token; int number; char letter; +static void add_keymap_path(const char *path); static void dump_accent_definition(char *name, accentmap_t *accentmap); static void dump_entry(int value); static void dump_key_definition(char *name, keymap_t *keymap); @@ -142,6 +145,12 @@ static void set_keyrates(char *opt); static void show_kbd_info(void); static void usage(void) __dead2; +struct pathent { + STAILQ_ENTRY(pathent) next; + char *path; +}; +static STAILQ_HEAD(, pathent) pathlist = STAILQ_HEAD_INITIALIZER(pathlist); + /* Detect presence of vt(4). */ static int is_vt4(void) @@ -279,11 +288,11 @@ get_entry(void) } static int -get_definition_line(FILE *fd, keymap_t *keymap, accentmap_t *accentmap) +get_definition_line(FILE *file, keymap_t *keymap, accentmap_t *accentmap) { int c; - yyin = fd; + yyin = file; if (token < 0) token = yylex(); @@ -791,32 +800,57 @@ dump_accent_definition(char *name, accen } static void +add_keymap_path(const char *path) +{ + struct pathent* pe; + size_t len; + + len = strlen(path); + if ((pe = malloc(sizeof(*pe))) == NULL || + (pe->path = malloc(len + 2)) == NULL) + err(1, "malloc"); + memcpy(pe->path, path, len); + if (len > 0 && path[len - 1] != '/') + pe->path[len++] = '/'; + pe->path[len] = '\0'; + STAILQ_INSERT_TAIL(&pathlist, pe, next); +} + +static void load_keymap(char *opt, int dumponly) { keymap_t keymap; accentmap_t accentmap; - FILE *fd; - int i, j; + struct pathent *pe; + FILE *file; + int j; char *name, *cp; char blank[] = "", keymap_path[] = KEYMAP_PATH; char vt_keymap_path[] = VT_KEYMAP_PATH, dotkbd[] = ".kbd"; - char *prefix[] = {blank, blank, keymap_path, NULL}; char *postfix[] = {blank, dotkbd, NULL}; - if (is_vt4()) - prefix[2] = vt_keymap_path; - cp = getenv("KEYMAP_PATH"); - if (cp != NULL) - asprintf(&(prefix[0]), "%s/", cp); - - fd = NULL; - for (i=0; prefix[i] && fd == NULL; i++) { - for (j=0; postfix[j] && fd == NULL; j++) { - name = mkfullname(prefix[i], opt, postfix[j]); - fd = fopen(name, "r"); + if (!paths_configured) { + cp = getenv("KEYMAP_PATH"); + if (cp != NULL) + add_keymap_path(cp); + add_keymap_path(""); + if (is_vt4()) + add_keymap_path(vt_keymap_path); + else + add_keymap_path(keymap_path); + paths_configured = 1; + } + + file = NULL; + STAILQ_FOREACH(pe, &pathlist, next) { + for (j=0; postfix[j] && file == NULL; j++) { + name = mkfullname(pe->path, opt, postfix[j]); + file = fopen(name, "r"); + if (file != NULL) + break; } } - if (fd == NULL) { + if (file == NULL) { warn("keymap file \"%s\" not found", opt); return; } @@ -824,7 +858,7 @@ load_keymap(char *opt, int dumponly) memset(&accentmap, 0, sizeof(accentmap)); token = -1; while (1) { - if (get_definition_line(fd, &keymap, &accentmap) < 0) + if (get_definition_line(file, &keymap, &accentmap) < 0) break; } if (dumponly) { @@ -841,13 +875,13 @@ load_keymap(char *opt, int dumponly) } if ((keymap.n_keys > 0) && (ioctl(0, PIO_KEYMAP, &keymap) < 0)) { warn("setting keymap"); - fclose(fd); + fclose(file); return; } if ((accentmap.n_accs > 0) && (ioctl(0, PIO_DEADKEYMAP, &accentmap) < 0)) { warn("setting accentmap"); - fclose(fd); + fclose(file); return; } } @@ -1170,7 +1204,7 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n", "usage: kbdcontrol [-dFKix] [-A name] [-a name] [-b duration.pitch | [quiet.]belltype]", " [-r delay.repeat | speed] [-l mapfile] [-f # string]", -" [-k device] [-L mapfile]"); +" [-k device] [-L mapfile] [-P path]"); exit(1); } @@ -1178,9 +1212,16 @@ usage(void) int main(int argc, char **argv) { + const char *optstring = "A:a:b:df:iKk:Fl:L:P:r:x"; int opt; - while((opt = getopt(argc, argv, "A:a:b:df:iKk:Fl:L:r:x")) != -1) + /* Collect any -P arguments, regardless of where they appear. */ + while ((opt = getopt(argc, argv, optstring)) != -1) + if (opt == 'P') + add_keymap_path(optarg); + + optind = optreset = 1; + while ((opt = getopt(argc, argv, optstring)) != -1) switch(opt) { case 'A': case 'a': @@ -1198,6 +1239,8 @@ main(int argc, char **argv) case 'L': load_keymap(optarg, 1); break; + case 'P': + break; case 'f': set_functionkey(optarg, nextarg(argc, argv, &optind, 'f')); From owner-svn-src-head@freebsd.org Wed Mar 16 04:22:33 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7ED6AD28B3; Wed, 16 Mar 2016 04:22:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 87337B93; Wed, 16 Mar 2016 04:22:33 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2G4MWAb012531; Wed, 16 Mar 2016 04:22:32 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G4MWg1012528; Wed, 16 Mar 2016 04:22:32 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201603160422.u2G4MWg1012528@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 16 Mar 2016 04:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296927 - in head: share/man/man9 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 04:22:34 -0000 Author: cem Date: Wed Mar 16 04:22:32 2016 New Revision: 296927 URL: https://svnweb.freebsd.org/changeset/base/296927 Log: fail(9): Upstreaming some fail point enhancements This is several year's worth of fail point upgrades done at EMC Isilon. They are interdependent enough that it makes sense to put a single diff up for them. Primarily, we added: - Changing all mainline execution paths to be lockless, which lets us use fail points in more sleep-sensitive areas, and allows more parallel execution - A number of additional commands, including 'pause' that lets us do some interesting deterministic repros of race conditions - The ability to dump the stacks of all threads sleeping on a fail point - A number of other API changes to allow marking up the fail point's context in the code, and firing callbacks before and after execution - A man page update Submitted by: Matthew Bryan Reviewed by: cem (earlier version), jhb, kib, pho With feedback from: bdrewery Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D5427 Modified: head/share/man/man9/fail.9 head/sys/kern/kern_fail.c head/sys/kern/subr_sleepqueue.c head/sys/sys/fail.h head/sys/sys/sleepqueue.h Modified: head/share/man/man9/fail.9 ============================================================================== --- head/share/man/man9/fail.9 Wed Mar 16 04:05:02 2016 (r296926) +++ head/share/man/man9/fail.9 Wed Mar 16 04:22:32 2016 (r296927) @@ -26,25 +26,31 @@ .\" .\" $FreeBSD$ .\" -.Dd May 10, 2009 +.Dd February 02, 2016 .Dt FAIL 9 .Os .Sh NAME .Nm KFAIL_POINT_CODE , +.Nm KFAIL_POINT_CODE_FLAGS , +.Nm KFAIL_POINT_CODE_COND , .Nm KFAIL_POINT_RETURN , .Nm KFAIL_POINT_RETURN_VOID , .Nm KFAIL_POINT_ERROR , .Nm KFAIL_POINT_GOTO , +.Nm KFAIL_POINT_SLEEP_CALLBACKS , .Nm fail_point , .Nm DEBUG_FP .Nd fail points .Sh SYNOPSIS .In sys/fail.h .Fn KFAIL_POINT_CODE "parent" "name" "code" +.Fn KFAIL_POINT_CODE_FLAGS "parent" "name" "flags" "code" +.Fn KFAIL_POINT_CODE_COND "parent" "name" "cond" "flags" "code" .Fn KFAIL_POINT_RETURN "parent" "name" .Fn KFAIL_POINT_RETURN_VOID "parent" "name" .Fn KFAIL_POINT_ERROR "parent" "name" "error_var" .Fn KFAIL_POINT_GOTO "parent" "name" "error_var" "label" +.Fn KFAIL_POINT_SLEEP_CALLBACKS "parent" "name" "pre_func" "pre_arg" "post_func" "post_arg" "code" .Sh DESCRIPTION Fail points are used to add code points where errors may be injected in a user controlled fashion. @@ -77,6 +83,42 @@ argument, the evaluation of is derived from the .Fn return value set in the sysctl MIB. +.Pp +Additionally, +.Fn KFAIL_POINT_CODE_FLAGS +provides a +.Fa flags +argument which controls the fail point's behaviour. +This can be used to e.g., mark the fail point's context as non-sleepable, +which causes the +.Sy sleep +action to be coerced to a busy wait. +The supported flags are: +.Bl -ohang -offset indent +.It FAIL_POINT_USE_TIMEOUT_PATH +Rather than sleeping on a +.Fn sleep +call, just fire the post-sleep function after a timeout fires. +.It FAIL_POINT_NONSLEEPABLE +Mark the fail point as being in a non-sleepable context, which coerces +.Fn sleep +calls to +.Fn delay +calls. +.El +.Pp +Likewise, +.Fn KFAIL_POINT_CODE_COND +supplies a +.Fa cond +argument, which allows you to set the condition under which the fail point's +code may fire. +This is equivalent to: +.Bd -literal + if (cond) + KFAIL_POINT_CODE_FLAGS(...); + +.Ed See .Sx SYSCTL VARIABLES below. @@ -107,26 +149,12 @@ Many base kernel MIBs can be found in th tree (referenced in code by .Sy DEBUG_FP ) . .Pp -The sysctl variable may be set using the following grammar: +The sysctl variable may be set in a number of ways: .Bd -literal - :: - ( "->" )* - - :: - ( ( "%") | ( "*" ) )* - - [ "(" ")" ] - [ "[pid " "]" ] - - :: - [ "." ] | - "." - - :: - "off" | "return" | "sleep" | "panic" | "break" | "print" + [%][*][(args...)][->] .Ed .Pp -The argument specifies which action to take: +The argument specifies which action to take; it can be one of: .Bl -tag -width ".Dv return" .It Sy off Take no action (does not trigger fail point code) @@ -140,13 +168,23 @@ Panic Break into the debugger, or trap if there is no debugger support .It Sy print Print that the fail point executed +.It Sy pause +Threads sleep at the fail point until the fail point is set to +.Sy off +.It Sy yield +Thread yields the cpu when the fail point is evaluated +.It Sy delay +Similar to sleep, but busy waits the cpu. +(Useful in non-sleepable contexts.) .El .Pp -The % and * modifiers prior to control when +The % and * modifiers prior to control when is executed. -The % form (e.g. "1.2%") can be used to specify a +The % form (e.g. "1.2%") can be used to specify a probability that will execute. -The * form (e.g. "5*") can be used to specify the number of +This is a decimal in the range (0, 100] which can specify up to +1/10,000% precision. +The * form (e.g. "5*") can be used to specify the number of times should be executed before this is disabled. Only the last probability and the last count are used if multiple are specified, i.e. "1.2%2%" is the same as "2%". @@ -191,6 +229,10 @@ Return 5 once, when pid 1234 executes th .Sh AUTHORS .An -nosplit This manual page was written by +.Pp +.An Matthew Bryan Aq Mt matthew.bryan@isilon.com +and +.Pp .An Zach Loafman Aq Mt zml@FreeBSD.org . .Sh CAVEATS It is easy to shoot yourself in the foot by setting fail points too @@ -206,3 +248,10 @@ Currently, .Fn fail_point_eval does not verify whether the context is appropriate for calling .Fn msleep . +You can force it to evaluate a +.Sy sleep +action as a +.Sy delay +action by specifying the +.Sy FAIL_POINT_NONSLEEPABLE +flag at the point the fail point is declared. Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Wed Mar 16 04:05:02 2016 (r296926) +++ head/sys/kern/kern_fail.c Wed Mar 16 04:22:32 2016 (r296927) @@ -57,12 +57,18 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #ifdef ILOG_DEFINE_FOR_FILE @@ -72,11 +78,45 @@ ILOG_DEFINE_FOR_FILE(L_ISI_FAIL_POINT, L static MALLOC_DEFINE(M_FAIL_POINT, "Fail Points", "fail points system"); #define fp_free(ptr) free(ptr, M_FAIL_POINT) #define fp_malloc(size, flags) malloc((size), M_FAIL_POINT, (flags)) +#define fs_free(ptr) fp_free(ptr) +#define fs_malloc() fp_malloc(sizeof(struct fail_point_setting), \ + M_WAITOK | M_ZERO) + + /** + * These define the wchans that are used for sleeping, pausing respectively. + * They are chosen arbitrarily but need to be distinct to the failpoint and + * the sleep/pause distinction. + */ +#define FP_SLEEP_CHANNEL(fp) (void*)(fp) +#define FP_PAUSE_CHANNEL(fp) __DEVOLATILE(void*, &fp->fp_setting) -static struct mtx g_fp_mtx; -MTX_SYSINIT(g_fp_mtx, &g_fp_mtx, "fail point mtx", MTX_DEF); -#define FP_LOCK() mtx_lock(&g_fp_mtx) -#define FP_UNLOCK() mtx_unlock(&g_fp_mtx) +/** + * Don't allow more than this many entries in a fail point set by sysctl. + * The 99.99...% case is to have 1 entry. I can't imagine having this many + * entries, so it should not limit us. Saves on re-mallocs while holding + * a non-sleepable lock. + */ +#define FP_MAX_ENTRY_COUNT 20 + +/* Used to drain sbufs to the sysctl output */ +int fail_sysctl_drain_func(void *, const char *, int); + +/* Head of tailq of struct fail_point_entry */ +TAILQ_HEAD(fail_point_entry_queue, fail_point_entry); + +/** + * fp entries garbage list; outstanding entries are cleaned up in the + * garbage collector + */ +STAILQ_HEAD(fail_point_setting_garbage, fail_point_setting); +static struct fail_point_setting_garbage fp_setting_garbage = + STAILQ_HEAD_INITIALIZER(fp_setting_garbage); +static struct mtx mtx_garbage_list; +MTX_SYSINIT(mtx_garbage_list, &mtx_garbage_list, "fail point garbage mtx", + MTX_SPIN); + +static struct sx sx_fp_set; +SX_SYSINIT(sx_fp_set, &sx_fp_set, "fail point set sx"); /** * Failpoint types. @@ -90,7 +130,11 @@ enum fail_point_t { FAIL_POINT_BREAK, /**< break into the debugger */ FAIL_POINT_PRINT, /**< print a message */ FAIL_POINT_SLEEP, /**< sleep for some msecs */ - FAIL_POINT_NUMTYPES + FAIL_POINT_PAUSE, /**< sleep until failpoint is set to off */ + FAIL_POINT_YIELD, /**< yield the cpu */ + FAIL_POINT_DELAY, /**< busy wait the cpu */ + FAIL_POINT_NUMTYPES, + FAIL_POINT_INVALID = -1 }; static struct { @@ -104,53 +148,307 @@ static struct { [FAIL_POINT_BREAK] = FP_TYPE_NM_LEN("break"), [FAIL_POINT_PRINT] = FP_TYPE_NM_LEN("print"), [FAIL_POINT_SLEEP] = FP_TYPE_NM_LEN("sleep"), + [FAIL_POINT_PAUSE] = FP_TYPE_NM_LEN("pause"), + [FAIL_POINT_YIELD] = FP_TYPE_NM_LEN("yield"), + [FAIL_POINT_DELAY] = FP_TYPE_NM_LEN("delay"), }; +#define FE_COUNT_UNTRACKED (INT_MIN) + /** * Internal structure tracking a single term of a complete failpoint. * @ingroup failpoint_private */ struct fail_point_entry { - enum fail_point_t fe_type; /**< type of entry */ + volatile bool fe_stale; + enum fail_point_t fe_type; /**< type of entry */ int fe_arg; /**< argument to type (e.g. return value) */ int fe_prob; /**< likelihood of firing in millionths */ - int fe_count; /**< number of times to fire, 0 means always */ + int fe_count; /**< number of times to fire, -1 means infinite */ pid_t fe_pid; /**< only fail for this process */ - TAILQ_ENTRY(fail_point_entry) fe_entries; /**< next entry in fail point */ + struct fail_point *fe_parent; /**< backpointer to fp */ + TAILQ_ENTRY(fail_point_entry) fe_entries; /**< next entry ptr */ +}; + +struct fail_point_setting { + STAILQ_ENTRY(fail_point_setting) fs_garbage_link; + struct fail_point_entry_queue fp_entry_queue; + struct fail_point * fs_parent; + struct mtx feq_mtx; /* Gives fail_point_pause something to do. */ +}; + +/** + * Defines stating the equivalent of probablilty one (100%) + */ +enum { + PROB_MAX = 1000000, /* probability between zero and this number */ + PROB_DIGITS = 6 /* number of zero's in above number */ }; +/* Get a ref on an fp's fp_setting */ +static inline struct fail_point_setting *fail_point_setting_get_ref( + struct fail_point *fp); +/* Release a ref on an fp_setting */ +static inline void fail_point_setting_release_ref(struct fail_point *fp); +/* Allocate and initialize a struct fail_point_setting */ +static struct fail_point_setting *fail_point_setting_new(struct + fail_point *); +/* Free a struct fail_point_setting */ +static void fail_point_setting_destroy(struct fail_point_setting *fp_setting); +/* Allocate and initialize a struct fail_point_entry */ +static struct fail_point_entry *fail_point_entry_new(struct + fail_point_setting *); +/* Free a struct fail_point_entry */ +static void fail_point_entry_destroy(struct fail_point_entry *fp_entry); +/* Append fp setting to garbage list */ +static inline void fail_point_setting_garbage_append( + struct fail_point_setting *fp_setting); +/* Swap fp's setting with fp_setting_new */ +static inline struct fail_point_setting * + fail_point_swap_settings(struct fail_point *fp, + struct fail_point_setting *fp_setting_new); +/* Free up any zero-ref setting in the garbage queue */ +static void fail_point_garbage_collect(void); +/* If this fail point's setting are empty, then swap it out to NULL. */ +static inline void fail_point_eval_swap_out(struct fail_point *fp, + struct fail_point_setting *fp_setting); + +bool +fail_point_is_off(struct fail_point *fp) +{ + bool return_val; + struct fail_point_setting *fp_setting; + struct fail_point_entry *ent; + + return_val = true; + + fp_setting = fail_point_setting_get_ref(fp); + if (fp_setting != NULL) { + TAILQ_FOREACH(ent, &fp_setting->fp_entry_queue, + fe_entries) { + if (!ent->fe_stale) { + return_val = false; + break; + } + } + } + fail_point_setting_release_ref(fp); + + return (return_val); +} + +/* Allocate and initialize a struct fail_point_setting */ +static struct fail_point_setting * +fail_point_setting_new(struct fail_point *fp) +{ + struct fail_point_setting *fs_new; + + fs_new = fs_malloc(); + fs_new->fs_parent = fp; + TAILQ_INIT(&fs_new->fp_entry_queue); + mtx_init(&fs_new->feq_mtx, "fail point entries", NULL, MTX_SPIN); + + fail_point_setting_garbage_append(fs_new); + + return (fs_new); +} + +/* Free a struct fail_point_setting */ +static void +fail_point_setting_destroy(struct fail_point_setting *fp_setting) +{ + struct fail_point_entry *ent; + + while (!TAILQ_EMPTY(&fp_setting->fp_entry_queue)) { + ent = TAILQ_FIRST(&fp_setting->fp_entry_queue); + TAILQ_REMOVE(&fp_setting->fp_entry_queue, ent, fe_entries); + fail_point_entry_destroy(ent); + } + + fs_free(fp_setting); +} + +/* Allocate and initialize a struct fail_point_entry */ +static struct fail_point_entry * +fail_point_entry_new(struct fail_point_setting *fp_setting) +{ + struct fail_point_entry *fp_entry; + + fp_entry = fp_malloc(sizeof(struct fail_point_entry), + M_WAITOK | M_ZERO); + fp_entry->fe_parent = fp_setting->fs_parent; + fp_entry->fe_prob = PROB_MAX; + fp_entry->fe_pid = NO_PID; + fp_entry->fe_count = FE_COUNT_UNTRACKED; + TAILQ_INSERT_TAIL(&fp_setting->fp_entry_queue, fp_entry, + fe_entries); + + return (fp_entry); +} + +/* Free a struct fail_point_entry */ +static void +fail_point_entry_destroy(struct fail_point_entry *fp_entry) +{ + + fp_free(fp_entry); +} + +/* Get a ref on an fp's fp_setting */ +static inline struct fail_point_setting * +fail_point_setting_get_ref(struct fail_point *fp) +{ + struct fail_point_setting *fp_setting; + + /* Invariant: if we have a ref, our pointer to fp_setting is safe */ + atomic_add_acq_32(&fp->fp_ref_cnt, 1); + fp_setting = fp->fp_setting; + + return (fp_setting); +} + +/* Release a ref on an fp_setting */ +static inline void +fail_point_setting_release_ref(struct fail_point *fp) +{ + + KASSERT(&fp->fp_ref_cnt > 0, ("Attempting to deref w/no refs")); + atomic_subtract_rel_32(&fp->fp_ref_cnt, 1); +} + +/* Append fp entries to fp garbage list */ +static inline void +fail_point_setting_garbage_append(struct fail_point_setting *fp_setting) +{ + + mtx_lock_spin(&mtx_garbage_list); + STAILQ_INSERT_TAIL(&fp_setting_garbage, fp_setting, + fs_garbage_link); + mtx_unlock_spin(&mtx_garbage_list); +} + +/* Swap fp's entries with fp_setting_new */ +static struct fail_point_setting * +fail_point_swap_settings(struct fail_point *fp, + struct fail_point_setting *fp_setting_new) +{ + struct fail_point_setting *fp_setting_old; + + fp_setting_old = fp->fp_setting; + fp->fp_setting = fp_setting_new; + + return (fp_setting_old); +} + +static inline void +fail_point_eval_swap_out(struct fail_point *fp, + struct fail_point_setting *fp_setting) +{ + + /* We may have already been swapped out and replaced; ignore. */ + if (fp->fp_setting == fp_setting) + fail_point_swap_settings(fp, NULL); +} + +/* Free up any zero-ref entries in the garbage queue */ +static void +fail_point_garbage_collect() +{ + struct fail_point_setting *fs_current, *fs_next; + struct fail_point_setting_garbage fp_ents_free_list; + + /** + * We will transfer the entries to free to fp_ents_free_list while holding + * the spin mutex, then free it after we drop the lock. This avoids + * triggering witness due to sleepable mutexes in the memory + * allocator. + */ + STAILQ_INIT(&fp_ents_free_list); + + mtx_lock_spin(&mtx_garbage_list); + STAILQ_FOREACH_SAFE(fs_current, &fp_setting_garbage, fs_garbage_link, + fs_next) { + if (fs_current->fs_parent->fp_setting != fs_current && + fs_current->fs_parent->fp_ref_cnt == 0) { + STAILQ_REMOVE(&fp_setting_garbage, fs_current, + fail_point_setting, fs_garbage_link); + STAILQ_INSERT_HEAD(&fp_ents_free_list, fs_current, + fs_garbage_link); + } + } + mtx_unlock_spin(&mtx_garbage_list); + + STAILQ_FOREACH_SAFE(fs_current, &fp_ents_free_list, fs_garbage_link, + fs_next) + fail_point_setting_destroy(fs_current); +} + +/* Drain out all refs from this fail point */ +static inline void +fail_point_drain(struct fail_point *fp, int expected_ref) +{ + struct fail_point_setting *entries; + + entries = fail_point_swap_settings(fp, NULL); + /** + * We have unpaused all threads; so we will wait no longer + * than the time taken for the longest remaining sleep, or + * the length of time of a long-running code block. + */ + while (fp->fp_ref_cnt > expected_ref) { + wakeup(FP_PAUSE_CHANNEL(fp)); + tsleep(&fp, PWAIT, "fail_point_drain", hz / 100); + } + fail_point_swap_settings(fp, entries); +} + static inline void -fail_point_sleep(struct fail_point *fp, struct fail_point_entry *ent, - int msecs, enum fail_point_return_code *pret) +fail_point_pause(struct fail_point *fp, enum fail_point_return_code *pret, + struct mtx *mtx_sleep) { - /* convert from millisecs to ticks, rounding up */ - int timo = ((msecs * hz) + 999) / 1000; + + if (fp->fp_pre_sleep_fn) + fp->fp_pre_sleep_fn(fp->fp_pre_sleep_arg); + + msleep_spin(FP_PAUSE_CHANNEL(fp), mtx_sleep, "failpt", 0); + + if (fp->fp_post_sleep_fn) + fp->fp_post_sleep_fn(fp->fp_post_sleep_arg); +} + +static inline void +fail_point_sleep(struct fail_point *fp, int msecs, + enum fail_point_return_code *pret) +{ + int timo; + + /* Convert from millisecs to ticks, rounding up */ + timo = howmany(msecs * hz, 1000); if (timo > 0) { - if (fp->fp_sleep_fn == NULL) { - msleep(fp, &g_fp_mtx, PWAIT, "failpt", timo); + if (!(fp->fp_flags & FAIL_POINT_USE_TIMEOUT_PATH)) { + if (fp->fp_pre_sleep_fn) + fp->fp_pre_sleep_fn(fp->fp_pre_sleep_arg); + + tsleep(FP_SLEEP_CHANNEL(fp), PWAIT, "failpt", timo); + + if (fp->fp_post_sleep_fn) + fp->fp_post_sleep_fn(fp->fp_post_sleep_arg); } else { - timeout(fp->fp_sleep_fn, fp->fp_sleep_arg, timo); + if (fp->fp_pre_sleep_fn) + fp->fp_pre_sleep_fn(fp->fp_pre_sleep_arg); + + timeout(fp->fp_post_sleep_fn, fp->fp_post_sleep_arg, + timo); *pret = FAIL_POINT_RC_QUEUED; } } } - -/** - * Defines stating the equivalent of probablilty one (100%) - */ -enum { - PROB_MAX = 1000000, /* probability between zero and this number */ - PROB_DIGITS = 6, /* number of zero's in above number */ -}; - -static char *parse_fail_point(struct fail_point_entries *, char *); -static char *parse_term(struct fail_point_entries *, char *); +static char *parse_fail_point(struct fail_point_setting *, char *); +static char *parse_term(struct fail_point_setting *, char *); static char *parse_number(int *out_units, int *out_decimal, char *); static char *parse_type(struct fail_point_entry *, char *); -static void free_entry(struct fail_point_entries *, struct fail_point_entry *); -static void clear_entries(struct fail_point_entries *); /** * Initialize a fail_point. The name is formed in a printf-like fashion @@ -167,7 +465,7 @@ fail_point_init(struct fail_point *fp, c char *name; int n; - TAILQ_INIT(&fp->fp_entries); + fp->fp_setting = NULL; fp->fp_flags = 0; /* Figure out the size of the name. */ @@ -185,25 +483,33 @@ fail_point_init(struct fail_point *fp, c fp->fp_name = name; fp->fp_location = ""; fp->fp_flags |= FAIL_POINT_DYNAMIC_NAME; - fp->fp_sleep_fn = NULL; - fp->fp_sleep_arg = NULL; + fp->fp_pre_sleep_fn = NULL; + fp->fp_pre_sleep_arg = NULL; + fp->fp_post_sleep_fn = NULL; + fp->fp_post_sleep_arg = NULL; } /** - * Free the resources held by a fail_point. - * + * Free the resources held by a fail_point, and wake any paused threads. + * Thou shalt not allow threads to hit this fail point after you enter this + * function, nor shall you call this multiple times for a given fp. * @ingroup failpoint */ void fail_point_destroy(struct fail_point *fp) { + fail_point_drain(fp, 0); + if ((fp->fp_flags & FAIL_POINT_DYNAMIC_NAME) != 0) { fp_free(__DECONST(void *, fp->fp_name)); fp->fp_name = NULL; } fp->fp_flags = 0; - clear_entries(&fp->fp_entries); + + sx_xlock(&sx_fp_set); + fail_point_garbage_collect(); + sx_xunlock(&sx_fp_set); } /** @@ -216,21 +522,51 @@ fail_point_destroy(struct fail_point *fp enum fail_point_return_code fail_point_eval_nontrivial(struct fail_point *fp, int *return_value) { - enum fail_point_return_code ret = FAIL_POINT_RC_CONTINUE; - struct fail_point_entry *ent, *next; + bool execute = false; + struct fail_point_entry *ent; + struct fail_point_setting *fp_setting; + enum fail_point_return_code ret; + int cont; + int count; int msecs; + int usecs; + + ret = FAIL_POINT_RC_CONTINUE; + cont = 0; /* don't continue by default */ - FP_LOCK(); + fp_setting = fail_point_setting_get_ref(fp); + if (fp_setting == NULL) + goto abort; - TAILQ_FOREACH_SAFE(ent, &fp->fp_entries, fe_entries, next) { - int cont = 0; /* don't continue by default */ + TAILQ_FOREACH(ent, &fp_setting->fp_entry_queue, fe_entries) { + + if (ent->fe_stale) + continue; if (ent->fe_prob < PROB_MAX && ent->fe_prob < random() % PROB_MAX) continue; + if (ent->fe_pid != NO_PID && ent->fe_pid != curproc->p_pid) continue; + if (ent->fe_count != FE_COUNT_UNTRACKED) { + count = ent->fe_count; + while (count > 0) { + if (atomic_cmpset_32(&ent->fe_count, count, count - 1)) { + count--; + execute = true; + break; + } + count = ent->fe_count; + } + if (execute == false) + /* We lost the race; consider the entry stale and bail now */ + continue; + if (count == 0) + ent->fe_stale = true; + } + switch (ent->fe_type) { case FAIL_POINT_PANIC: panic("fail point %s panicking", fp->fp_name); @@ -244,7 +580,7 @@ fail_point_eval_nontrivial(struct fail_p case FAIL_POINT_BREAK: printf("fail point %s breaking to debugger\n", - fp->fp_name); + fp->fp_name); breakpoint(); break; @@ -254,51 +590,95 @@ fail_point_eval_nontrivial(struct fail_p break; case FAIL_POINT_SLEEP: - /* - * Free the entry now if necessary, since - * we're about to drop the mutex and sleep. - */ msecs = ent->fe_arg; - if (ent->fe_count > 0 && --ent->fe_count == 0) { - free_entry(&fp->fp_entries, ent); - ent = NULL; - } - if (msecs) - fail_point_sleep(fp, ent, msecs, &ret); + fail_point_sleep(fp, msecs, &ret); + break; + + case FAIL_POINT_PAUSE: + /** + * Pausing is inherently strange with multiple + * entries given our design. That is because some + * entries could be unreachable, for instance in cases like: + * pause->return. We can never reach the return entry. + * The sysctl layer actually truncates all entries after + * a pause for this reason. + */ + mtx_lock_spin(&fp_setting->feq_mtx); + fail_point_pause(fp, &ret, &fp_setting->feq_mtx); + mtx_unlock_spin(&fp_setting->feq_mtx); + break; + + case FAIL_POINT_YIELD: + kern_yield(-1); + break; + + case FAIL_POINT_DELAY: + usecs = ent->fe_arg; + DELAY(usecs); break; default: break; } - if (ent != NULL && ent->fe_count > 0 && --ent->fe_count == 0) - free_entry(&fp->fp_entries, ent); if (cont == 0) break; } - /* Get rid of "off"s at the end. */ - while ((ent = TAILQ_LAST(&fp->fp_entries, fail_point_entries)) && - ent->fe_type == FAIL_POINT_OFF) - free_entry(&fp->fp_entries, ent); + if (fail_point_is_off(fp)) + fail_point_eval_swap_out(fp, fp_setting); - FP_UNLOCK(); +abort: + fail_point_setting_release_ref(fp); return (ret); + } /** * Translate internal fail_point structure into human-readable text. */ static void -fail_point_get(struct fail_point *fp, struct sbuf *sb) +fail_point_get(struct fail_point *fp, struct sbuf *sb, + bool verbose) { struct fail_point_entry *ent; + struct fail_point_setting *fp_setting; + struct fail_point_entry *fp_entry_cpy; + int cnt_sleeping; + int idx; + int printed_entry_count; + + cnt_sleeping = 0; + idx = 0; + printed_entry_count = 0; + + fp_entry_cpy = fp_malloc(sizeof(struct fail_point_entry) * + (FP_MAX_ENTRY_COUNT + 1), M_WAITOK); + + fp_setting = fail_point_setting_get_ref(fp); + + if (fp_setting != NULL) { + TAILQ_FOREACH(ent, &fp_setting->fp_entry_queue, fe_entries) { + if (ent->fe_stale) + continue; - FP_LOCK(); + KASSERT(printed_entry_count < FP_MAX_ENTRY_COUNT, + ("FP entry list larger than allowed")); - TAILQ_FOREACH(ent, &fp->fp_entries, fe_entries) { + fp_entry_cpy[printed_entry_count] = *ent; + ++printed_entry_count; + } + } + fail_point_setting_release_ref(fp); + + /* This is our equivalent of a NULL terminator */ + fp_entry_cpy[printed_entry_count].fe_type = FAIL_POINT_INVALID; + + while (idx < printed_entry_count) { + ent = &fp_entry_cpy[idx]; + ++idx; if (ent->fe_prob < PROB_MAX) { int decimal = ent->fe_prob % (PROB_MAX / 100); int units = ent->fe_prob / (PROB_MAX / 100); @@ -313,7 +693,7 @@ fail_point_get(struct fail_point *fp, st } sbuf_printf(sb, "%%"); } - if (ent->fe_count > 0) + if (ent->fe_count >= 0) sbuf_printf(sb, "%d*", ent->fe_count); sbuf_printf(sb, "%s", fail_type_strings[ent->fe_type].name); if (ent->fe_arg) @@ -323,10 +703,29 @@ fail_point_get(struct fail_point *fp, st if (TAILQ_NEXT(ent, fe_entries)) sbuf_printf(sb, "->"); } - if (TAILQ_EMPTY(&fp->fp_entries)) + if (!printed_entry_count) sbuf_printf(sb, "off"); - FP_UNLOCK(); + fp_free(fp_entry_cpy); + if (verbose) { + /* Print number of sleeping threads. queue=0 is the argument + * used by msleep when sending our threads to sleep. */ + sbuf_printf(sb, "\nsleeping_thread_stacks = {\n"); + sleepq_sbuf_print_stacks(sb, FP_SLEEP_CHANNEL(fp), 0, + &cnt_sleeping); + + sbuf_printf(sb, "},\n"); + sbuf_printf(sb, "sleeping_thread_count = %d,\n", + cnt_sleeping); + + sbuf_printf(sb, "paused_thread_stacks = {\n"); + sleepq_sbuf_print_stacks(sb, FP_PAUSE_CHANNEL(fp), 0, + &cnt_sleeping); + + sbuf_printf(sb, "},\n"); + sbuf_printf(sb, "paused_thread_count = %d\n", + cnt_sleeping); + } } /** @@ -336,38 +735,91 @@ fail_point_get(struct fail_point *fp, st static int fail_point_set(struct fail_point *fp, char *buf) { - int error = 0; struct fail_point_entry *ent, *ent_next; - struct fail_point_entries new_entries; + struct fail_point_setting *entries; + bool should_wake_paused; + bool should_truncate; + int error; + + error = 0; + should_wake_paused = false; + should_truncate = false; /* Parse new entries. */ - TAILQ_INIT(&new_entries); - if (!parse_fail_point(&new_entries, buf)) { - clear_entries(&new_entries); + /** + * ref protects our new malloc'd stuff from being garbage collected + * before we link it. + */ + fail_point_setting_get_ref(fp); + entries = fail_point_setting_new(fp); + if (parse_fail_point(entries, buf) == NULL) { + STAILQ_REMOVE(&fp_setting_garbage, entries, + fail_point_setting, fs_garbage_link); + fail_point_setting_destroy(entries); error = EINVAL; goto end; } - FP_LOCK(); - - /* Move new entries in. */ - TAILQ_SWAP(&fp->fp_entries, &new_entries, fail_point_entry, fe_entries); - clear_entries(&new_entries); + /** + * Transfer the entries we are going to keep to a new list. + * Get rid of useless zero probability entries, and entries with hit + * count 0. + * If 'off' is present, and it has no hit count set, then all entries + * after it are discarded since they are unreachable. + */ + TAILQ_FOREACH_SAFE(ent, &entries->fp_entry_queue, fe_entries, ent_next) { + if (ent->fe_prob == 0 || ent->fe_count == 0) { + printf("Discarding entry which cannot execute %s\n", + fail_type_strings[ent->fe_type].name); + TAILQ_REMOVE(&entries->fp_entry_queue, ent, + fe_entries); + fp_free(ent); + continue; + } else if (should_truncate) { + printf("Discarding unreachable entry %s\n", + fail_type_strings[ent->fe_type].name); + TAILQ_REMOVE(&entries->fp_entry_queue, ent, + fe_entries); + fp_free(ent); + continue; + } - /* Get rid of useless zero probability entries. */ - TAILQ_FOREACH_SAFE(ent, &fp->fp_entries, fe_entries, ent_next) { - if (ent->fe_prob == 0) - free_entry(&fp->fp_entries, ent); + if (ent->fe_type == FAIL_POINT_OFF) { + should_wake_paused = true; + if (ent->fe_count == FE_COUNT_UNTRACKED) { + should_truncate = true; + TAILQ_REMOVE(&entries->fp_entry_queue, ent, + fe_entries); + fp_free(ent); + } + } else if (ent->fe_type == FAIL_POINT_PAUSE) { + should_truncate = true; + } else if (ent->fe_type == FAIL_POINT_SLEEP && (fp->fp_flags & + FAIL_POINT_NONSLEEPABLE)) { + /** + * If this fail point is annotated as being in a + * non-sleepable ctx, convert sleep to delay and + * convert the msec argument to usecs. + */ + printf("Sleep call request on fail point in " + "non-sleepable context; using delay instead " + "of sleep\n"); + ent->fe_type = FAIL_POINT_DELAY; + ent->fe_arg *= 1000; + } } - /* Get rid of "off"s at the end. */ - while ((ent = TAILQ_LAST(&fp->fp_entries, fail_point_entries)) && - ent->fe_type == FAIL_POINT_OFF) - free_entry(&fp->fp_entries, ent); - - FP_UNLOCK(); + if (TAILQ_EMPTY(&entries->fp_entry_queue)) { + entries = fail_point_swap_settings(fp, NULL); + if (entries != NULL) + wakeup(FP_PAUSE_CHANNEL(fp)); + } else { + if (should_wake_paused) + wakeup(FP_PAUSE_CHANNEL(fp)); + fail_point_swap_settings(fp, entries); + } - end: +end: #ifdef IWARNING if (error) IWARNING("Failed to set %s %s to %s", @@ -377,6 +829,7 @@ fail_point_set(struct fail_point *fp, ch fp->fp_name, fp->fp_location, buf); #endif /* IWARNING */ + fail_point_setting_release_ref(fp); return (error); } @@ -385,25 +838,33 @@ fail_point_set(struct fail_point *fp, ch /** * Handle kernel failpoint set/get. */ + int fail_point_sysctl(SYSCTL_HANDLER_ARGS) { - struct fail_point *fp = arg1; - char *buf = NULL; + struct fail_point *fp; + char *buf; + struct sbuf *sb_check; struct sbuf sb; int error; - /* Retrieving */ - sbuf_new(&sb, NULL, 128, SBUF_AUTOEXTEND | SBUF_INCLUDENUL); - fail_point_get(fp, &sb); - sbuf_trim(&sb); - error = sbuf_finish(&sb); - if (error == 0) - error = SYSCTL_OUT(req, sbuf_data(&sb), sbuf_len(&sb)); - sbuf_delete(&sb); + error = 0; + fp = arg1; + buf = NULL; + + sb_check = sbuf_new(&sb, NULL, 1024, SBUF_AUTOEXTEND); + if (sb_check != &sb) + return (ENOMEM); + + sbuf_set_drain(&sb, (sbuf_drain_func *)fail_sysctl_drain_func, req); /* Setting */ - if (!error && req->newptr) { *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 16 04:40:06 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31114AD2CA6; Wed, 16 Mar 2016 04:40:06 +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 EFC491119; Wed, 16 Mar 2016 04:40:05 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from Julian-MBP3.local (ppp121-45-229-231.lns20.per1.internode.on.net [121.45.229.231]) (authenticated bits=0) by vps1.elischer.org (8.15.2/8.15.2) with ESMTPSA id u2G4drV5013964 (version=TLSv1.2 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 15 Mar 2016 21:39:56 -0700 (PDT) (envelope-from julian@freebsd.org) Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys To: Gleb Smirnoff , Ravi Pokala References: <201603150005.u2F050ps086390@repo.freebsd.org> <20160315191229.GU1328@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Julian Elischer Message-ID: <56E8E394.7090100@freebsd.org> Date: Wed, 16 Mar 2016 12:39:48 +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: <20160315191229.GU1328@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 04:40:06 -0000 On 16/03/2016 3:12 AM, Gleb Smirnoff wrote: > Ravi, > > On Mon, Mar 14, 2016 at 05:33:06PM -0700, Ravi Pokala wrote: > R> To make sure I'm reading this correctly: > R> > R> (1) The sysctl operates on an opaque array of (uint64_t)s. The elements of the array are not individually accessible. > > On array of counter_u64_t. The elements are individually accessible of course, > but not by this sysctl API. > > R> (2) Reading the sysctl populates each element of the userspace array by calling counter_u64_fetch() on the corresponding element of the kernelspace array. > > Right. > > R> (3) Writing the sysctl clears the kernelspace array by calling counter_u64_zero() on each element. > > Right. > but it is not atomic. since the user process decides the time delay between a read and write (zero) there could be a lot of missed counts if you are resetting to zero after each read. better to just read in a loop and not zero.. here are somethings I've wanted at various times: read/zero atomic read timestamp as part of imported struct. (because you really can't do accurate timing from user space, but knowing when the data was read is a good replacement). read a "mib" (for want of a better term) for each set, giving individual field names. From owner-svn-src-head@freebsd.org Wed Mar 16 05:05:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 05978AD24F3; Wed, 16 Mar 2016 05:05:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C74FA1E84; Wed, 16 Mar 2016 05:05:56 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2G55swu024581; Wed, 16 Mar 2016 05:05:54 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G55s0b024580; Wed, 16 Mar 2016 05:05:54 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201603160505.u2G55s0b024580@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Wed, 16 Mar 2016 05:05:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296929 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 05:05:57 -0000 Author: cem Date: Wed Mar 16 05:05:54 2016 New Revision: 296929 URL: https://svnweb.freebsd.org/changeset/base/296929 Log: fail.9: Bump Dd Modified: head/share/man/man9/fail.9 Modified: head/share/man/man9/fail.9 ============================================================================== --- head/share/man/man9/fail.9 Wed Mar 16 04:37:26 2016 (r296928) +++ head/share/man/man9/fail.9 Wed Mar 16 05:05:54 2016 (r296929) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 02, 2016 +.Dd March 15, 2016 .Dt FAIL 9 .Os .Sh NAME From owner-svn-src-head@freebsd.org Wed Mar 16 06:26:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2463CAD2384; Wed, 16 Mar 2016 06:26:52 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EA4E86EF; Wed, 16 Mar 2016 06:26:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2G6QpFe048640; Wed, 16 Mar 2016 06:26:51 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G6QprK048639; Wed, 16 Mar 2016 06:26:51 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603160626.u2G6QprK048639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 16 Mar 2016 06:26:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296930 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 06:26:52 -0000 Author: adrian Date: Wed Mar 16 06:26:50 2016 New Revision: 296930 URL: https://svnweb.freebsd.org/changeset/base/296930 Log: Add initial VHT IE's and action codes. Yes, there's more to 802.11ac than this. Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Wed Mar 16 05:05:54 2016 (r296929) +++ head/sys/net80211/ieee80211.h Wed Mar 16 06:26:50 2016 (r296930) @@ -346,6 +346,7 @@ struct ieee80211_action { #define IEEE80211_ACTION_CAT_MESH 13 /* Mesh */ #define IEEE80211_ACTION_CAT_SELF_PROT 15 /* Self-protected */ /* 16 - 125 reserved */ +#define IEEE80211_ACTION_VHT 21 #define IEEE80211_ACTION_CAT_VENDOR 127 /* Vendor Specific */ #define IEEE80211_ACTION_HT_TXCHWIDTH 0 /* recommended xmit chan width*/ @@ -760,6 +761,11 @@ enum { IEEE80211_ELEMID_MESHPXU = 137, IEEE80211_ELEMID_MESHPXUC = 138, IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ + + /* 802.11ac */ + IEEE80211_ELEMID_VHT_CAP = 191, + IEEE80211_ELEMID_VHT_OPMODE = 192, + IEEE80211_ELEMID_VHT_PWR_ENV = 195, }; struct ieee80211_tim_ie { From owner-svn-src-head@freebsd.org Wed Mar 16 06:27:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68C47AD23E7; Wed, 16 Mar 2016 06:27:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B0A08D7; Wed, 16 Mar 2016 06:27: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 u2G6RvpB048720; Wed, 16 Mar 2016 06:27:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G6RvgW048719; Wed, 16 Mar 2016 06:27:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603160627.u2G6RvgW048719@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Wed, 16 Mar 2016 06:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296931 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 06:27:58 -0000 Author: adrian Date: Wed Mar 16 06:27:57 2016 New Revision: 296931 URL: https://svnweb.freebsd.org/changeset/base/296931 Log: Display the VHT IE names. This doesn't decode the IEs just yet. Tested: * Archer c2 AP: TP-LINK_D579_5G 60:e3:27:e1:d5:78 44 54M 26:0 100 EP SSID RATES DSPARMS<44> COUNTRY TIM<050400010000> HTCAP HTINFO VHTCAP VHTOPMODE RSN WME BSSLOAD<0b05000001127a> VEN Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Wed Mar 16 06:26:50 2016 (r296930) +++ head/sbin/ifconfig/ifieee80211.c Wed Mar 16 06:27:57 2016 (r296931) @@ -3087,6 +3087,9 @@ iename(int elemid) case IEEE80211_ELEMID_APCHANREP:return " APCHANREP"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; + case IEEE80211_ELEMID_VHT_CAP: return " VHTCAP"; + case IEEE80211_ELEMID_VHT_OPMODE: return " VHTOPMODE"; + case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV"; } return " ???"; } From owner-svn-src-head@freebsd.org Wed Mar 16 06:42:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5B2F4AD28FF; Wed, 16 Mar 2016 06:42:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29854F3E; Wed, 16 Mar 2016 06:42:16 +0000 (UTC) (envelope-from kp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2G6gFpM054586; Wed, 16 Mar 2016 06:42:15 GMT (envelope-from kp@FreeBSD.org) Received: (from kp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G6gFGl054585; Wed, 16 Mar 2016 06:42:15 GMT (envelope-from kp@FreeBSD.org) Message-Id: <201603160642.u2G6gFGl054585@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kp set sender to kp@FreeBSD.org using -f From: Kristof Provost Date: Wed, 16 Mar 2016 06:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296932 - head/sys/netpfil/pf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 06:42:16 -0000 Author: kp Date: Wed Mar 16 06:42:15 2016 New Revision: 296932 URL: https://svnweb.freebsd.org/changeset/base/296932 Log: pf: Improve forwarding detection When we guess the nature of the outbound packet (output vs. forwarding) we need to take bridges into account. When bridging the input interface does not match the output interface, but we're not forwarding. Similarly, it's possible for the interface to actually be the bridge interface itself (and not a member interface). PR: 202351 MFC after: 2 weeks Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Wed Mar 16 06:27:57 2016 (r296931) +++ head/sys/netpfil/pf/pf.c Wed Mar 16 06:42:15 2016 (r296932) @@ -6192,11 +6192,13 @@ pf_test6(int dir, struct ifnet *ifp, str * We do need to be careful about bridges. If the * net.link.bridge.pfil_bridge sysctl is set we can be filtering on a * bridge, so if the input interface is a bridge member and the output - * interface is its bridge we're not actually forwarding but bridging. + * interface is its bridge or a member of the same bridge we're not + * actually forwarding but bridging. */ - if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif - && (m->m_pkthdr.rcvif->if_bridge == NULL - || m->m_pkthdr.rcvif->if_bridge != ifp->if_softc)) + if (dir == PF_OUT && m->m_pkthdr.rcvif && ifp != m->m_pkthdr.rcvif && + (m->m_pkthdr.rcvif->if_bridge == NULL || + (m->m_pkthdr.rcvif->if_bridge != ifp->if_softc && + m->m_pkthdr.rcvif->if_bridge != ifp->if_bridge))) fwdir = PF_FWD; if (!V_pf_status.running) From owner-svn-src-head@freebsd.org Wed Mar 16 07:24:18 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DBAFAD242C; Wed, 16 Mar 2016 07:24:18 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CEB101F49; Wed, 16 Mar 2016 07:24:17 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 1597B1FE024; Wed, 16 Mar 2016 08:24:12 +0100 (CET) Subject: Re: svn commit: r296880 - in head: share/man/man9 sys/kern sys/sys To: Don Lewis , glebius@FreeBSD.org References: <201603152156.u2FLuDPJ035986@gw.catspoiler.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56E90AC3.50802@selasky.org> Date: Wed, 16 Mar 2016 08:26:59 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <201603152156.u2FLuDPJ035986@gw.catspoiler.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 07:24:18 -0000 On 03/15/16 22:56, Don Lewis wrote: > How can you do a CTASSERT() on something that isn't known at compile > time? > It can be part of the API, that some arguments cannot be variables. It makes typechecking and other checking easier. Gleb: I'll test and submit an array size assert for the static sysctl u64 array version. --HPS From owner-svn-src-head@freebsd.org Wed Mar 16 08:37:53 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E0C28AD1E84; Wed, 16 Mar 2016 08:37:53 +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 A3563846; Wed, 16 Mar 2016 08:37:53 +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 u2G8bqQt087129; Wed, 16 Mar 2016 08:37:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G8bqgr087126; Wed, 16 Mar 2016 08:37:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603160837.u2G8bqgr087126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 16 Mar 2016 08:37:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296933 - in head: share/man/man9 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 08:37:54 -0000 Author: hselasky Date: Wed Mar 16 08:37:52 2016 New Revision: 296933 URL: https://svnweb.freebsd.org/changeset/base/296933 Log: Improve the implementation and documentation of the SYSCTL_COUNTER_U64_ARRAY() macro. - Add proper asserts to the SYSCTL_COUNTER_U64_ARRAY() macro that checks the size of the first element of the array. - Add an example to the counter(9) manual page how to use the SYSCTL_COUNTER_U64_ARRAY() macro. - Add some missing symbolic links for counter(9) while at it. Modified: head/share/man/man9/Makefile head/share/man/man9/counter.9 head/sys/sys/sysctl.h Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Wed Mar 16 06:42:15 2016 (r296932) +++ head/share/man/man9/Makefile Wed Mar 16 08:37:52 2016 (r296933) @@ -639,7 +639,11 @@ MLINKS+=counter.9 counter_u64_alloc.9 \ counter.9 counter_exit.9 \ counter.9 counter_u64_add_protected.9 \ counter.9 counter_u64_fetch.9 \ - counter.9 counter_u64_zero.9 + counter.9 counter_u64_zero.9 \ + counter.9 SYSCTL_COUNTER_U64.9 \ + counter.9 SYSCTL_ADD_COUNTER_U64.9 \ + counter.9 SYSCTL_COUNTER_U64_ARRAY.9 \ + counter.9 SYSCTL_ADD_COUNTER_U64_ARRAY.9 MLINKS+=cpuset.9 CPUSET_T_INITIALIZER.9 \ cpuset.9 CPUSET_FSET.9 \ cpuset.9 CPU_CLR.9 \ Modified: head/share/man/man9/counter.9 ============================================================================== --- head/share/man/man9/counter.9 Wed Mar 16 06:42:15 2016 (r296932) +++ head/share/man/man9/counter.9 Wed Mar 16 08:37:52 2016 (r296933) @@ -215,6 +215,16 @@ amd64 single-instruction implementation. On some architectures updating a counter require a .Xr critical 9 section. +.Sh EXAMPLES +The following example creates a static counter array exported to +userspace through a sysctl: +.Bd -literal -offset indent +#define MY_SIZE 8 +static counter_u64_t array[MY_SIZE]; +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, + &array[0], MY_SIZE, "Test counter array"); +.Ed +.Pp .Sh SEE ALSO .Xr atomic 9 , .Xr critical 9 , Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Wed Mar 16 06:42:15 2016 (r296932) +++ head/sys/sys/sysctl.h Wed Mar 16 08:37:52 2016 (r296933) @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e SYSCTL_OID(parent, nbr, name, \ CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ - CTASSERT(((access) & CTLTYPE) == 0 || \ - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) + CTASSERT((((access) & CTLTYPE) == 0 || \ + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ + sizeof(uint64_t) == sizeof(**(ptr))) #define SYSCTL_ADD_COUNTER_U64_ARRAY(ctx, parent, nbr, name, access, \ ptr, len, descr) \ From owner-svn-src-head@freebsd.org Wed Mar 16 08:49:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 507C9AD2136; Wed, 16 Mar 2016 08:49:39 +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 2150B11BB; Wed, 16 Mar 2016 08:49:39 +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 u2G8ncmv090245; Wed, 16 Mar 2016 08:49:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2G8nclw090244; Wed, 16 Mar 2016 08:49:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603160849.u2G8nclw090244@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 16 Mar 2016 08:49:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296934 - head/sys/contrib/rdma/krping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 08:49:39 -0000 Author: hselasky Date: Wed Mar 16 08:49:38 2016 New Revision: 296934 URL: https://svnweb.freebsd.org/changeset/base/296934 Log: Fix crash in krping when run as a client due to NULL pointer access. Initialize pointer in question which is used only when fast registers mode is selected. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/contrib/rdma/krping/krping.c Modified: head/sys/contrib/rdma/krping/krping.c ============================================================================== --- head/sys/contrib/rdma/krping/krping.c Wed Mar 16 08:37:52 2016 (r296933) +++ head/sys/contrib/rdma/krping/krping.c Wed Mar 16 08:49:38 2016 (r296934) @@ -261,6 +261,7 @@ static int krping_cma_event_handler(stru case RDMA_CM_EVENT_ROUTE_RESOLVED: cb->state = ROUTE_RESOLVED; + cb->child_cm_id = cma_id; wake_up_interruptible(&cb->sem); break; From owner-svn-src-head@freebsd.org Wed Mar 16 10:42:25 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF395AD39F8; Wed, 16 Mar 2016 10:42:25 +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 91671811; Wed, 16 Mar 2016 10:42:25 +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 u2GAgOum027307; Wed, 16 Mar 2016 10:42:24 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GAgOED027306; Wed, 16 Mar 2016 10:42:24 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603161042.u2GAgOED027306@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Wed, 16 Mar 2016 10:42:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296935 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 10:42:25 -0000 Author: hselasky Date: Wed Mar 16 10:42:24 2016 New Revision: 296935 URL: https://svnweb.freebsd.org/changeset/base/296935 Log: Fix kernel build after adding new sysctl asserts in r296933. Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Wed Mar 16 08:49:38 2016 (r296934) +++ head/sys/netinet/tcp_input.c Wed Mar 16 10:42:24 2016 (r296935) @@ -243,7 +243,7 @@ SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPC tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]); SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD | - CTLFLAG_VNET, &VNET_NAME(tcps_states), TCP_NSTATES, + CTLFLAG_VNET, &VNET_NAME(tcps_states)[0], TCP_NSTATES, "TCP connection counts by TCP state"); static void From owner-svn-src-head@freebsd.org Wed Mar 16 12:46:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6FD1BAD252A; Wed, 16 Mar 2016 12:46:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 087E981B; Wed, 16 Mar 2016 12:46:44 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id ADA6C1FE024; Wed, 16 Mar 2016 13:46:41 +0100 (CET) Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib To: John Baldwin References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <2420759.o4YiE5Za4X@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56E95658.2010703@selasky.org> Date: Wed, 16 Mar 2016 13:49:28 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <2420759.o4YiE5Za4X@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 12:46:44 -0000 On 03/15/16 18:43, John Baldwin wrote: > On Tuesday, March 15, 2016 03:47:26 PM Hans Petter Selasky wrote: >> Author: hselasky >> Date: Tue Mar 15 15:47:26 2016 >> New Revision: 296909 >> URL: https://svnweb.freebsd.org/changeset/base/296909 >> >> Log: >> Fix witness panic in the ipoib_ioctl() function when unloading the >> ipoib module. >> >> The bpfdetach() function is trying to turn off promiscious mode on the >> network interface it is attached to while holding a mutex. The fix >> consists of ignoring any further calls to the ipoib_ioctl() function >> when the network interface is going to be detached. The ipoib_ioctl() >> function might sleep. >> >> Sponsored by: Mellanox Technologies >> MFC after: 1 week > > In all of the other NIC drivers I have worked on the fix has been to call > if_detach (or ether_ifdetach) as the first step in your detach method before > you try to stop the interface. The idea is to remove external connections > from your driver first, and the only after those have drained do you actually > shut down the hardware. Given you are calling if_detach() just before > if_free() below, ipoib just seems to be broken here. Hi John, It is a problem that if_ioctl() callbacks come from various places without proper refcounting and unknown context properties, like sleeping allowed or not. The WITNESS assert I'm trying to solve is this one: > db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe04661876c0 > ipoib_ioctl() at ipoib_ioctl+0x29/frame 0xfffffe0466187700 > if_setflag() at if_setflag+0xd5/frame 0xfffffe0466187760 > ifpromisc() at ifpromisc+0x2c/frame 0xfffffe0466187790 > bpf_detachd_locked() at bpf_detachd_locked+0x1e8/frame 0xfffffe04661877d0 > bpfdetach() at bpfdetach+0x152/frame 0xfffffe0466187810 > ipoib_detach() at ipoib_detach+0x42/frame 0xfffffe0466187830 > ipoib_remove_one() at ipoib_remove_one+0x19e/frame 0xfffffe04661878a0 > ib_unregister_client() at ib_unregister_client+0x5e/frame 0xfffffe04661878e0 > ipoib_cleanup_module() at ipoib_cleanup_module+0x52/frame 0xfffffe04661878f0 > _module_run() at _module_run+0x7b/frame 0xfffffe0466187920 > linker_file_unload() at linker_file_unload+0x45f/frame 0xfffffe0466187970 > kern_kldunload() at kern_kldunload+0xbc/frame 0xfffffe04661879a0 > amd64_syscall() at amd64_syscall+0x2db/frame 0xfffffe0466187ab0 > Xfast_syscall() at Xfast_syscall+0xfb/frame 0xfffffe0466187ab0 As you can see bpfdetach() is calling ifpromisc() locked, which basically means we cannot do anything there with regard to ipoib. ipoib is not a NIC driver, but an IP-bearer only. Comparing with PCI devices is not valid here, because with a PCI device you usually only need to write a PCI register to switch promiscious mode on/off, but with IPOIB it involves commands towards the infiniband stack which might sleep. > For example, detach in a typical NIC driver does this: > > struct foo_softc *sc; > > sc = device_get_softc(dev); > ether_ifdetach(sc->sc_ifp); > FOO_LOCK(sc); > foo_stop(sc); > FOO_UNLOCK(sc); > callout_drain(&sc->timer); > bus_teardown_intr(...); > bus_release_resource(...); > if_free(sc->sc_ifp); > > Similarly, devices with a character device in /dev should be calling > destroy_dev() first before shutting down hardware, etc. Right. The problem is not really the detach sequence, but that bpfdetach() calls ifpromisc() locked. I'm not sure if we can change that. --HPS From owner-svn-src-head@freebsd.org Wed Mar 16 13:01:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B3612AD2BD3; Wed, 16 Mar 2016 13:01:50 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4FDD7788; Wed, 16 Mar 2016 13:01:50 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GD1nSJ071079; Wed, 16 Mar 2016 13:01:49 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GD1nOW070993; Wed, 16 Mar 2016 13:01:49 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603161301.u2GD1nOW070993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Wed, 16 Mar 2016 13:01:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296936 - in head/sys: arm/conf arm/nvidia arm/nvidia/tegra124 boot/fdt/dts/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 13:01:50 -0000 Author: mmel Date: Wed Mar 16 13:01:48 2016 New Revision: 296936 URL: https://svnweb.freebsd.org/changeset/base/296936 Log: Import basic support for Nvidia Jetson TK1 board and tegra124 SoC. The following pheripherals are supported: UART, MMC, AHCI, EHCI, PCIe, I2C, PMIC, GPIO, CPU temperature and clock. Note: The PCIe driver is pure mash at this moment. It will be reworked immediately when both D5237 and D2579 enter the current tree. Added: head/sys/arm/conf/JETSON-TK1 (contents, props changed) head/sys/arm/conf/TEGRA124.common (contents, props changed) head/sys/arm/nvidia/ head/sys/arm/nvidia/as3722.c (contents, props changed) head/sys/arm/nvidia/as3722.h (contents, props changed) head/sys/arm/nvidia/as3722_gpio.c (contents, props changed) head/sys/arm/nvidia/as3722_regulators.c (contents, props changed) head/sys/arm/nvidia/as3722_rtc.c (contents, props changed) head/sys/arm/nvidia/tegra124/ head/sys/arm/nvidia/tegra124/files.tegra124 (contents, props changed) head/sys/arm/nvidia/tegra124/std.tegra124 (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_car.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_car.h (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_clk_per.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_clk_pll.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_clk_super.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_coretemp.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_cpufreq.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_machdep.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_mp.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_mp.h (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_pmc.c (contents, props changed) head/sys/arm/nvidia/tegra124/tegra124_xusbpadctl.c (contents, props changed) head/sys/arm/nvidia/tegra_abpmisc.c (contents, props changed) head/sys/arm/nvidia/tegra_ahci.c (contents, props changed) head/sys/arm/nvidia/tegra_efuse.c (contents, props changed) head/sys/arm/nvidia/tegra_efuse.h (contents, props changed) head/sys/arm/nvidia/tegra_ehci.c (contents, props changed) head/sys/arm/nvidia/tegra_gpio.c (contents, props changed) head/sys/arm/nvidia/tegra_i2c.c (contents, props changed) head/sys/arm/nvidia/tegra_lic.c (contents, props changed) head/sys/arm/nvidia/tegra_pcie.c (contents, props changed) head/sys/arm/nvidia/tegra_pinmux.c (contents, props changed) head/sys/arm/nvidia/tegra_pmc.h (contents, props changed) head/sys/arm/nvidia/tegra_rtc.c (contents, props changed) head/sys/arm/nvidia/tegra_sdhci.c (contents, props changed) head/sys/arm/nvidia/tegra_soctherm.c (contents, props changed) head/sys/arm/nvidia/tegra_soctherm_if.m (contents, props changed) head/sys/arm/nvidia/tegra_uart.c (contents, props changed) head/sys/arm/nvidia/tegra_usbphy.c (contents, props changed) head/sys/boot/fdt/dts/arm/tegra124-jetson-tk1-fbsd.dts (contents, props changed) Added: head/sys/arm/conf/JETSON-TK1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/JETSON-TK1 Wed Mar 16 13:01:48 2016 (r296936) @@ -0,0 +1,37 @@ +# Kernel configuration for Jetson TK1 board +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +#NO_UNIVERSE + +include "TEGRA124.common" +ident JETSON-TK1 + +# Flattened Device Tree +options FDT_DTB_STATIC +makeoptions FDT_DTS_FILE=tegra124-jetson-tk1-fbsd.dts + +makeoptions MODULES_OVERRIDE="" +#options BOOTVERBOSE +#options BOOTHOWTO=RB_SINGLE + +#options ROOTDEVNAME=\"ufs:mmcsd0s2a\" +options ROOTDEVNAME=\"ufs:ada0s1a\" + +# CTF doesn't works yet +makeoptions WITHOUT_CTF=1 Added: head/sys/arm/conf/TEGRA124.common ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/conf/TEGRA124.common Wed Mar 16 13:01:48 2016 (r296936) @@ -0,0 +1,154 @@ +# +# Kernel configuration for NVIDIA Tegra124 based boards. +# +# For more information on this file, please read the config(5) manual page, +# and/or the handbook section on Kernel Configuration Files: +# +# http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html +# +# The handbook is also available locally in /usr/share/doc/handbook +# if you've installed the doc distribution, otherwise always see the +# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the +# latest information. +# +# An exhaustive list of options and more detailed explanations of the +# device lines is also present in the ../../conf/NOTES and NOTES files. +# If you are in doubt as to the purpose or necessity of a line, check first +# in NOTES. +# +# $FreeBSD$ + +include "std.armv6" +include "../nvidia/tegra124/std.tegra124" + +options HZ=100 # Scheduling quantum is 10 milliseconds. +options SCHED_ULE # ULE scheduler +options PLATFORM # Platform based SoC +options PLATFORM_SMP +options SMP # Enable multiple cores + +# Debugging for use in -current +makeoptions DEBUG=-g # Build kernel with gdb(1) debug symbols +options BREAK_TO_DEBUGGER +options ALT_BREAK_TO_DEBUGGER +#options VERBOSE_SYSINIT # Enable verbose sysinit messages +options KDB # Enable kernel debugger support +# For minimum debugger support (stable branch) use: +#options KDB_TRACE # Print a stack trace for a panic +# For full debugger support use this instead: +options DDB # Enable the kernel debugger +options INVARIANTS # Enable calls of extra sanity checking +options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS +options WITNESS # Enable checks to detect deadlocks and cycles +options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed + +# Interrupt controller +device gic + +# ARM Generic Timer +device generic_timer + +# EXT_RESOURCES pseudo devices +options EXT_RESOURCES +device clk +device phy +device hwreset +device regulator + +# Pseudo devices. +device loop # Network loopback +device random # Entropy device +device vlan # 802.1Q VLAN support +#device tun # Packet tunnel. +device md # Memory "disks" +#device gif # IPv6 and IPv4 tunneling +#device firmware # firmware assist module +device ether # Ethernet support +device miibus # Required for ethernet +device bpf # Berkeley packet filter (required for DHCP) + + +# General-purpose input/output +device gpio +#device gpioled + +# I2C support +device iic +device iicbus +device icee + +# Serial (COM) ports +device uart # Multi-uart driver +device uart_ns8250 + +# MMC/SD/SDIO Card slot support +device sdhci # SD controller +device mmc # SD/MMC protocol +device mmcsd # SDCard disk device + +# ATA controllers +device ahci # AHCI-compatible SATA controllers + +# SCSI peripherals +device scbus # SCSI bus (required for ATA/SCSI) +device da # Direct Access (disks) +device cd # CD +device pass # Passthrough device (direct ATA/SCSI access) + +# USB support +options USB_HOST_ALIGN=64 # Align usb buffers to cache line size. +options USB_DEBUG # enable debug msgs +device ehci # EHCI USB interface +device usb # USB Bus (required) +device umass # Disks/Mass storage - Requires scbus and da +device uhid # "Human Interface Devices" +#device u3g # USB modems +device ukbd # Allow keyboard like HIDs to control console +device ums # USB mouse + +# USB Ethernet, requires miibus +#device aue # ADMtek USB Ethernet +#device axe # ASIX Electronics USB Ethernet +#device cdce # Generic USB over Ethernet +#device cue # CATC USB Ethernet +#device kue # Kawasaki LSI USB Ethernet +#device rue # RealTek RTL8150 USB Ethernet +#device udav # Davicom DM9601E USB + +# USB Wireless +#device rum # Ralink Technology RT2501USB wireless NICs + +# Wireless NIC cards +#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 wlan_amrr # AMRR transmit rate control algorithm + +# PCI +options NEW_PCIB +device pci + +# PCI Ethernet NICs that use the common MII bus controller code. +# NOTE: Be sure to keep the 'device miibus' line in order to use these NICs! +device re # RealTek 8139C+/8169/8169S/8110S + +# DRM2 +#device fbd +#device vt +#device splash +#device kbdmux +#device drm2 + +# Sound +#device sound +#device snd_hda + +# Flattened Device Tree +options FDT # Configure using FDT/DTB data +device fdt_pinctrl + +# SoC-specific devices + +#device hwpmc +#options HWPMC_HOOKS Added: head/sys/arm/nvidia/as3722.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/nvidia/as3722.c Wed Mar 16 13:01:48 2016 (r296936) @@ -0,0 +1,411 @@ +/*- + * Copyright (c) 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +/* + * AS3722 PMIC driver + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "clock_if.h" +#include "regdev_if.h" + +#include "as3722.h" + +static struct ofw_compat_data compat_data[] = { + {"ams,as3722", 1}, + {NULL, 0}, +}; + +#define LOCK(_sc) sx_xlock(&(_sc)->lock) +#define UNLOCK(_sc) sx_xunlock(&(_sc)->lock) +#define LOCK_INIT(_sc) sx_init(&(_sc)->lock, "as3722") +#define LOCK_DESTROY(_sc) sx_destroy(&(_sc)->lock); +#define ASSERT_LOCKED(_sc) sx_assert(&(_sc)->lock, SA_XLOCKED); +#define ASSERT_UNLOCKED(_sc) sx_assert(&(_sc)->lock, SA_UNLOCKED); + +#define AS3722_DEVICE_ID 0x0C + +/* + * Raw register access function. + */ +int +as3722_read(struct as3722_softc *sc, uint8_t reg, uint8_t *val) +{ + uint8_t addr; + int rv; + struct iic_msg msgs[2] = { + {0, IIC_M_WR, 1, &addr}, + {0, IIC_M_RD, 1, val}, + }; + + msgs[0].slave = sc->bus_addr; + msgs[1].slave = sc->bus_addr; + addr = reg; + + rv = iicbus_transfer(sc->dev, msgs, 2); + if (rv != 0) { + device_printf(sc->dev, + "Error when reading reg 0x%02X, rv: %d\n", reg, rv); + return (EIO); + } + + return (0); +} + +int as3722_read_buf(struct as3722_softc *sc, uint8_t reg, uint8_t *buf, + size_t size) +{ + uint8_t addr; + int rv; + struct iic_msg msgs[2] = { + {0, IIC_M_WR, 1, &addr}, + {0, IIC_M_RD, size, buf}, + }; + + msgs[0].slave = sc->bus_addr; + msgs[1].slave = sc->bus_addr; + addr = reg; + + rv = iicbus_transfer(sc->dev, msgs, 2); + if (rv != 0) { + device_printf(sc->dev, + "Error when reading reg 0x%02X, rv: %d\n", reg, rv); + return (EIO); + } + + return (0); +} + +int +as3722_write(struct as3722_softc *sc, uint8_t reg, uint8_t val) +{ + uint8_t data[2]; + int rv; + + struct iic_msg msgs[1] = { + {0, IIC_M_WR, 2, data}, + }; + + msgs[0].slave = sc->bus_addr; + data[0] = reg; + data[1] = val; + + rv = iicbus_transfer(sc->dev, msgs, 1); + if (rv != 0) { + device_printf(sc->dev, + "Error when writing reg 0x%02X, rv: %d\n", reg, rv); + return (EIO); + } + return (0); +} + +int as3722_write_buf(struct as3722_softc *sc, uint8_t reg, uint8_t *buf, + size_t size) +{ + uint8_t data[1]; + int rv; + struct iic_msg msgs[2] = { + {0, IIC_M_WR, 1, data}, + {0, IIC_M_WR | IIC_M_NOSTART, size, buf}, + }; + + msgs[0].slave = sc->bus_addr; + msgs[1].slave = sc->bus_addr; + data[0] = reg; + + rv = iicbus_transfer(sc->dev, msgs, 2); + if (rv != 0) { + device_printf(sc->dev, + "Error when writing reg 0x%02X, rv: %d\n", reg, rv); + return (EIO); + } + return (0); +} + +int +as3722_modify(struct as3722_softc *sc, uint8_t reg, uint8_t clear, uint8_t set) +{ + uint8_t val; + int rv; + + rv = as3722_read(sc, reg, &val); + if (rv != 0) + return (rv); + + val &= ~clear; + val |= set; + + rv = as3722_write(sc, reg, val); + if (rv != 0) + return (rv); + + return (0); +} + +static int +as3722_get_version(struct as3722_softc *sc) +{ + uint8_t reg; + int rv; + + /* Verify AS3722 ID and version. */ + rv = RD1(sc, AS3722_ASIC_ID1, ®); + if (rv != 0) + return (ENXIO); + + if (reg != AS3722_DEVICE_ID) { + device_printf(sc->dev, "Invalid chip ID is 0x%x\n", reg); + return (ENXIO); + } + + rv = RD1(sc, AS3722_ASIC_ID2, &sc->chip_rev); + if (rv != 0) + return (ENXIO); + + if (bootverbose) + device_printf(sc->dev, "AS3722 rev: 0x%x\n", sc->chip_rev); + return (0); +} + +static int +as3722_init(struct as3722_softc *sc) +{ + uint32_t reg; + int rv; + + reg = 0; + if (sc->int_pullup) + reg |= AS3722_INT_PULL_UP; + if (sc->i2c_pullup) + reg |= AS3722_I2C_PULL_UP; + + rv = RM1(sc, AS3722_IO_VOLTAGE, + AS3722_INT_PULL_UP | AS3722_I2C_PULL_UP, reg); + if (rv != 0) + return (ENXIO); + + /* mask interrupts */ + rv = WR1(sc, AS3722_INTERRUPT_MASK1, 0); + if (rv != 0) + return (ENXIO); + rv = WR1(sc, AS3722_INTERRUPT_MASK2, 0); + if (rv != 0) + return (ENXIO); + rv = WR1(sc, AS3722_INTERRUPT_MASK3, 0); + if (rv != 0) + return (ENXIO); + rv = WR1(sc, AS3722_INTERRUPT_MASK4, 0); + if (rv != 0) + return (ENXIO); + return (0); +} + +static int +as3722_parse_fdt(struct as3722_softc *sc, phandle_t node) +{ + + sc->int_pullup = + OF_hasprop(node, "ams,enable-internal-int-pullup") ? 1 : 0; + sc->i2c_pullup = + OF_hasprop(node, "ams,enable-internal-i2c-pullup") ? 1 : 0; + return 0; +} + +static void +as3722_intr(void *arg) +{ + struct as3722_softc *sc; + + sc = (struct as3722_softc *)arg; + /* XXX Finish temperature alarms. */ +} + +static int +as3722_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_search_compatible(dev, compat_data)->ocd_data) + return (ENXIO); + + device_set_desc(dev, "AS3722 PMIC"); + return (BUS_PROBE_DEFAULT); +} + +static int +as3722_attach(device_t dev) +{ + struct as3722_softc *sc; + const char *dname; + int dunit, rv, rid; + phandle_t node; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->bus_addr = iicbus_get_addr(dev); + node = ofw_bus_get_node(sc->dev); + dname = device_get_name(dev); + dunit = device_get_unit(dev); + rv = 0; + LOCK_INIT(sc); + + rid = 0; + sc->irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (sc->irq_res == NULL) { + device_printf(dev, "Cannot allocate interrupt.\n"); + rv = ENXIO; + goto fail; + } + + rv = as3722_parse_fdt(sc, node); + if (rv != 0) + goto fail; + rv = as3722_get_version(sc); + if (rv != 0) + goto fail; + rv = as3722_init(sc); + if (rv != 0) + goto fail; + rv = as3722_regulator_attach(sc, node); + if (rv != 0) + goto fail; + rv = as3722_gpio_attach(sc, node); + if (rv != 0) + goto fail; + rv = as3722_rtc_attach(sc, node); + if (rv != 0) + goto fail; + + fdt_pinctrl_register(dev, NULL); + fdt_pinctrl_configure_by_name(dev, "default"); + + /* Setup interrupt. */ + rv = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, as3722_intr, sc, &sc->irq_h); + if (rv) { + device_printf(dev, "Cannot setup interrupt.\n"); + goto fail; + } + return (bus_generic_attach(dev)); + +fail: + if (sc->irq_h != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_h); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + LOCK_DESTROY(sc); + return (rv); +} + +static int +as3722_detach(device_t dev) +{ + struct as3722_softc *sc; + + sc = device_get_softc(dev); + if (sc->irq_h != NULL) + bus_teardown_intr(dev, sc->irq_res, sc->irq_h); + if (sc->irq_res != NULL) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->irq_res); + LOCK_DESTROY(sc); + + return (bus_generic_detach(dev)); +} + +static phandle_t +as3722_gpio_get_node(device_t bus, device_t dev) +{ + + /* We only have one child, the GPIO bus, which needs our own node. */ + return (ofw_bus_get_node(bus)); +} + +static device_method_t as3722_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, as3722_probe), + DEVMETHOD(device_attach, as3722_attach), + DEVMETHOD(device_detach, as3722_detach), + + /* Regdev interface */ + DEVMETHOD(regdev_map, as3722_regulator_map), + + /* RTC interface */ + DEVMETHOD(clock_gettime, as3722_rtc_gettime), + DEVMETHOD(clock_settime, as3722_rtc_settime), + + /* GPIO protocol interface */ + DEVMETHOD(gpio_get_bus, as3722_gpio_get_bus), + DEVMETHOD(gpio_pin_max, as3722_gpio_pin_max), + DEVMETHOD(gpio_pin_getname, as3722_gpio_pin_getname), + DEVMETHOD(gpio_pin_getflags, as3722_gpio_pin_getflags), + DEVMETHOD(gpio_pin_getcaps, as3722_gpio_pin_getcaps), + DEVMETHOD(gpio_pin_setflags, as3722_gpio_pin_setflags), + DEVMETHOD(gpio_pin_get, as3722_gpio_pin_get), + DEVMETHOD(gpio_pin_set, as3722_gpio_pin_set), + DEVMETHOD(gpio_pin_toggle, as3722_gpio_pin_toggle), + DEVMETHOD(gpio_map_gpios, as3722_gpio_map_gpios), + + /* fdt_pinctrl interface */ + DEVMETHOD(fdt_pinctrl_configure, as3722_pinmux_configure), + + /* ofw_bus interface */ + DEVMETHOD(ofw_bus_get_node, as3722_gpio_get_node), + + DEVMETHOD_END +}; + +static devclass_t as3722_devclass; +DEFINE_CLASS_0(gpio, as3722_driver, as3722_methods, + sizeof(struct as3722_softc)); +EARLY_DRIVER_MODULE(as3722, iicbus, as3722_driver, as3722_devclass, + 0, 0, 74); Added: head/sys/arm/nvidia/as3722.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/nvidia/as3722.h Wed Mar 16 13:01:48 2016 (r296936) @@ -0,0 +1,323 @@ +/*- + * Copyright (c) 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _AS3722_H_ + +#include + +#define AS3722_SD0_VOLTAGE 0x00 +#define AS3722_SD_VSEL_MASK 0x7F /* For all SD */ +#define AS3722_SD0_VSEL_MIN 0x01 +#define AS3722_SD0_VSEL_MAX 0x5A +#define AS3722_SD0_VSEL_LOW_VOL_MAX 0x6E + +#define AS3722_SD1_VOLTAGE 0x01 +#define AS3722_SD2_VOLTAGE 0x02 +#define AS3722_SD2_VSEL_MIN 0x01 +#define AS3722_SD2_VSEL_MAX 0x7F +#define AS3722_SD3_VOLTAGE 0x03 +#define AS3722_SD4_VOLTAGE 0x04 +#define AS3722_SD5_VOLTAGE 0x05 +#define AS3722_SD6_VOLTAGE 0x06 +#define AS3722_GPIO0_CONTROL 0x08 +#define AS3722_GPIO_INVERT 0x80 +#define AS3722_GPIO_IOSF_MASK 0x0F +#define AS3722_GPIO_IOSF_SHIFT 3 +#define AS3722_GPIO_MODE_MASK 0x07 +#define AS3722_GPIO_MODE_SHIFT 0 + +#define AS3722_GPIO1_CONTROL 0x09 +#define AS3722_GPIO2_CONTROL 0x0A +#define AS3722_GPIO3_CONTROL 0x0B +#define AS3722_GPIO4_CONTROL 0x0C +#define AS3722_GPIO5_CONTROL 0x0D +#define AS3722_GPIO6_CONTROL 0x0E +#define AS3722_GPIO7_CONTROL 0x0F +#define AS3722_LDO0_VOLTAGE 0x10 +#define AS3722_LDO0_VSEL_MASK 0x1F +#define AS3722_LDO0_VSEL_MIN 0x01 +#define AS3722_LDO0_VSEL_MAX 0x12 +#define AS3722_LDO0_NUM_VOLT 0x12 + +#define AS3722_LDO1_VOLTAGE 0x11 +#define AS3722_LDO_VSEL_MASK 0x7F +#define AS3722_LDO_VSEL_MIN 0x01 +#define AS3722_LDO_VSEL_MAX 0x7F +#define AS3722_LDO_VSEL_DNU_MIN 0x25 +#define AS3722_LDO_VSEL_DNU_MAX 0x3F +#define AS3722_LDO_NUM_VOLT 0x80 + +#define AS3722_LDO2_VOLTAGE 0x12 +#define AS3722_LDO3_VOLTAGE 0x13 +#define AS3722_LDO3_VSEL_MASK 0x3F +#define AS3722_LDO3_VSEL_MIN 0x01 +#define AS3722_LDO3_VSEL_MAX 0x2D +#define AS3722_LDO3_NUM_VOLT 0x2D +#define AS3722_LDO3_MODE_MASK (0x3 << 6) +#define AS3722_LDO3_MODE_GET(x) (((x) >> 6) & 0x3) +#define AS3722_LDO3_MODE(x) (((x) & 0x3) << 6) +#define AS3722_LDO3_MODE_PMOS AS3722_LDO3_MODE(0) +#define AS3722_LDO3_MODE_PMOS_TRACKING AS3722_LDO3_MODE(1) +#define AS3722_LDO3_MODE_NMOS AS3722_LDO3_MODE(2) +#define AS3722_LDO3_MODE_SWITCH AS3722_LDO3_MODE(3) + +#define AS3722_LDO4_VOLTAGE 0x14 +#define AS3722_LDO5_VOLTAGE 0x15 +#define AS3722_LDO6_VOLTAGE 0x16 +#define AS3722_LDO6_SEL_BYPASS 0x3F +#define AS3722_LDO7_VOLTAGE 0x17 +#define AS3722_LDO9_VOLTAGE 0x19 +#define AS3722_LDO10_VOLTAGE 0x1A +#define AS3722_LDO11_VOLTAGE 0x1B +#define AS3722_LDO3_SETTINGS 0x1D +#define AS3722_GPIO_DEB1 0x1E +#define AS3722_GPIO_DEB2 0x1F +#define AS3722_GPIO_SIGNAL_OUT 0x20 +#define AS3722_GPIO_SIGNAL_IN 0x21 +#define AS3722_REG_SEQU_MOD1 0x22 +#define AS3722_REG_SEQU_MOD2 0x23 +#define AS3722_REG_SEQU_MOD3 0x24 +#define AS3722_SD_PHSW_CTRL 0x27 +#define AS3722_SD_PHSW_STATUS 0x28 + +#define AS3722_SD0_CONTROL 0x29 +#define AS3722_SD0_MODE_FAST (1 << 4) + +#define AS3722_SD1_CONTROL 0x2A +#define AS3722_SD1_MODE_FAST (1 << 4) + +#define AS3722_SDMPH_CONTROL 0x2B +#define AS3722_SD23_CONTROL 0x2C +#define AS3722_SD3_MODE_FAST (1 << 6) +#define AS3722_SD2_MODE_FAST (1 << 2) + +#define AS3722_SD4_CONTROL 0x2D +#define AS3722_SD4_MODE_FAST (1 << 2) + +#define AS3722_SD5_CONTROL 0x2E +#define AS3722_SD5_MODE_FAST (1 << 2) + +#define AS3722_SD6_CONTROL 0x2F +#define AS3722_SD6_MODE_FAST (1 << 4) + +#define AS3722_SD_DVM 0x30 +#define AS3722_RESET_REASON 0x31 +#define AS3722_BATTERY_VOLTAGE_MONITOR 0x32 +#define AS3722_STARTUP_CONTROL 0x33 +#define AS3722_RESET_TIMER 0x34 +#define AS3722_REFERENCE_CONTROL 0x35 +#define AS3722_RESET_CONTROL 0x36 +#define AS3722_OVERTEMPERATURE_CONTROL 0x37 +#define AS3722_WATCHDOG_CONTROL 0x38 +#define AS3722_REG_STANDBY_MOD1 0x39 +#define AS3722_REG_STANDBY_MOD2 0x3A +#define AS3722_REG_STANDBY_MOD3 0x3B +#define AS3722_ENABLE_CTRL1 0x3C +#define AS3722_SD3_EXT_ENABLE_MASK 0xC0 +#define AS3722_SD2_EXT_ENABLE_MASK 0x30 +#define AS3722_SD1_EXT_ENABLE_MASK 0x0C +#define AS3722_SD0_EXT_ENABLE_MASK 0x03 + +#define AS3722_ENABLE_CTRL2 0x3D +#define AS3722_SD6_EXT_ENABLE_MASK 0x30 +#define AS3722_SD5_EXT_ENABLE_MASK 0x0C +#define AS3722_SD4_EXT_ENABLE_MASK 0x03 + +#define AS3722_ENABLE_CTRL3 0x3E +#define AS3722_LDO3_EXT_ENABLE_MASK 0xC0 +#define AS3722_LDO2_EXT_ENABLE_MASK 0x30 +#define AS3722_LDO1_EXT_ENABLE_MASK 0x0C +#define AS3722_LDO0_EXT_ENABLE_MASK 0x03 + +#define AS3722_ENABLE_CTRL4 0x3F +#define AS3722_LDO7_EXT_ENABLE_MASK 0xC0 +#define AS3722_LDO6_EXT_ENABLE_MASK 0x30 +#define AS3722_LDO5_EXT_ENABLE_MASK 0x0C +#define AS3722_LDO4_EXT_ENABLE_MASK 0x03 + +#define AS3722_ENABLE_CTRL5 0x40 +#define AS3722_LDO11_EXT_ENABLE_MASK 0xC0 +#define AS3722_LDO10_EXT_ENABLE_MASK 0x30 +#define AS3722_LDO9_EXT_ENABLE_MASK 0x0C + +#define AS3722_PWM_CONTROL_L 0x41 +#define AS3722_PWM_CONTROL_H 0x42 +#define AS3722_WATCHDOG_TIMER 0x46 +#define AS3722_WATCHDOG_SOFTWARE_SIGNAL 0x48 +#define AS3722_IO_VOLTAGE 0x49 +#define AS3722_I2C_PULL_UP (1 << 4) +#define AS3722_INT_PULL_UP (1 << 5) + +#define AS3722_BATTERY_VOLTAGE_MONITOR2 0x4A +#define AS3722_SD_CONTROL 0x4D +#define AS3722_SDN_CTRL(x) (1 << (x)) + +#define AS3722_LDO_CONTROL0 0x4E +#define AS3722_LDO7_CTRL (1 << 7) +#define AS3722_LDO6_CTRL (1 << 6) +#define AS3722_LDO5_CTRL (1 << 5) +#define AS3722_LDO4_CTRL (1 << 4) +#define AS3722_LDO3_CTRL (1 << 3) +#define AS3722_LDO2_CTRL (1 << 2) +#define AS3722_LDO1_CTRL (1 << 1) +#define AS3722_LDO0_CTRL (1 << 0) + +#define AS3722_LDO_CONTROL1 0x4F +#define AS3722_LDO11_CTRL (1 << 3) +#define AS3722_LDO10_CTRL (1 << 2) +#define AS3722_LDO9_CTRL (1 << 1) + +#define AS3722_SD0_PROTECT 0x50 +#define AS3722_SD6_PROTECT 0x51 +#define AS3722_PWM_VCONTROL1 0x52 +#define AS3722_PWM_VCONTROL2 0x53 +#define AS3722_PWM_VCONTROL3 0x54 +#define AS3722_PWM_VCONTROL4 0x55 +#define AS3722_BB_CHARGER 0x57 +#define AS3722_CTRL_SEQU1 0x58 +#define AS3722_CTRL_SEQU2 0x59 +#define AS3722_OV_CURRENT 0x5A +#define AS3722_OV_CURRENT_DEB 0x5B +#define AS3722_SDLV_DEB 0x5C +#define AS3722_OC_PG_CTRL 0x5D +#define AS3722_OC_PG_CTRL2 0x5E +#define AS3722_CTRL_STATUS 0x5F +#define AS3722_RTC_CONTROL 0x60 +#define AS3722_RTC_AM_PM_MODE (1 << 7) +#define AS3722_RTC_CLK32K_OUT_EN (1 << 5) +#define AS3722_RTC_IRQ_MODE (1 << 3) +#define AS3722_RTC_ON (1 << 2) +#define AS3722_RTC_ALARM_WAKEUP_EN (1 << 1) +#define AS3722_RTC_REP_WAKEUP_EN (1 << 0) + +#define AS3722_RTC_SECOND 0x61 +#define AS3722_RTC_MINUTE 0x62 +#define AS3722_RTC_HOUR 0x63 +#define AS3722_RTC_DAY 0x64 +#define AS3722_RTC_MONTH 0x65 +#define AS3722_RTC_YEAR 0x66 +#define AS3722_RTC_ALARM_SECOND 0x67 +#define AS3722_RTC_ALARM_MINUTE 0x68 +#define AS3722_RTC_ALARM_HOUR 0x69 +#define AS3722_RTC_ALARM_DAY 0x6A +#define AS3722_RTC_ALARM_MONTH 0x6B +#define AS3722_RTC_ALARM_YEAR 0x6C +#define AS3722_SRAM 0x6D +#define AS3722_RTC_ACCESS 0x6F +#define AS3722_REG_STATUS 0x73 +#define AS3722_INTERRUPT_MASK1 0x74 +#define AS3722_INTERRUPT_MASK2 0x75 +#define AS3722_INTERRUPT_MASK3 0x76 +#define AS3722_INTERRUPT_MASK4 0x77 +#define AS3722_INTERRUPT_STATUS1 0x78 +#define AS3722_INTERRUPT_STATUS2 0x79 +#define AS3722_INTERRUPT_STATUS3 0x7A +#define AS3722_INTERRUPT_STATUS4 0x7B +#define AS3722_TEMP_STATUS 0x7D +#define AS3722_ADC0_CONTROL 0x80 +#define AS3722_ADC1_CONTROL 0x81 +#define AS3722_ADC0_MSB_RESULT 0x82 +#define AS3722_ADC0_LSB_RESULT 0x83 +#define AS3722_ADC1_MSB_RESULT 0x84 +#define AS3722_ADC1_LSB_RESULT 0x85 +#define AS3722_ADC1_THRESHOLD_HI_MSB 0x86 +#define AS3722_ADC1_THRESHOLD_HI_LSB 0x87 +#define AS3722_ADC1_THRESHOLD_LO_MSB 0x88 +#define AS3722_ADC1_THRESHOLD_LO_LSB 0x89 +#define AS3722_ADC_CONFIGURATION 0x8A +#define AS3722_ASIC_ID1 0x90 +#define AS3722_ASIC_ID2 0x91 +#define AS3722_LOCK 0x9E +#define AS3722_FUSE7 0x9E +#define AS3722_FUSE7_SD0_LOW_VOLTAGE (1 << 4) + +struct as3722_reg_sc; +struct as3722_gpio_pin; + +struct as3722_softc { + device_t dev; + struct sx lock; + int bus_addr; + struct resource *irq_res; + void *irq_h; + + uint8_t chip_rev; + int int_pullup; + int i2c_pullup; + + /* Regulators. */ + struct as3722_reg_sc **regs; + int nregs; + + /* GPIO */ + device_t gpio_busdev; + struct as3722_gpio_pin **gpio_pins; + int gpio_npins; + struct sx gpio_lock; + +}; + +#define RD1(sc, reg, val) as3722_read(sc, reg, val) +#define WR1(sc, reg, val) as3722_write(sc, reg, val) +#define RM1(sc, reg, clr, set) as3722_modify(sc, reg, clr, set) + +int as3722_read(struct as3722_softc *sc, uint8_t reg, uint8_t *val); +int as3722_write(struct as3722_softc *sc, uint8_t reg, uint8_t val); +int as3722_modify(struct as3722_softc *sc, uint8_t reg, uint8_t clear, + uint8_t set); +int as3722_read_buf(struct as3722_softc *sc, uint8_t reg, uint8_t *buf, + size_t size); +int as3722_write_buf(struct as3722_softc *sc, uint8_t reg, uint8_t *buf, + size_t size); + +/* Regulators */ +int as3722_regulator_attach(struct as3722_softc *sc, phandle_t node); +int as3722_regulator_map(device_t dev, phandle_t xref, int ncells, + pcell_t *cells, int *num); + +/* RTC */ +int as3722_rtc_attach(struct as3722_softc *sc, phandle_t node); +int as3722_rtc_gettime(device_t dev, struct timespec *ts); +int as3722_rtc_settime(device_t dev, struct timespec *ts); + +/* GPIO */ +device_t as3722_gpio_get_bus(device_t dev); +int as3722_gpio_pin_max(device_t dev, int *maxpin); +int as3722_gpio_pin_getname(device_t dev, uint32_t pin, char *name); +int as3722_gpio_pin_getflags(device_t dev, uint32_t pin, uint32_t *flags); +int as3722_gpio_pin_getcaps(device_t dev, uint32_t pin, uint32_t *caps); +int as3722_gpio_pin_setflags(device_t dev, uint32_t pin, uint32_t flags); +int as3722_gpio_pin_set(device_t dev, uint32_t pin, unsigned int value); +int as3722_gpio_pin_get(device_t dev, uint32_t pin, unsigned int *val); +int as3722_gpio_pin_toggle(device_t dev, uint32_t pin); +int as3722_gpio_map_gpios(device_t dev, phandle_t pdev, phandle_t gparent, + int gcells, pcell_t *gpios, uint32_t *pin, uint32_t *flags); +int as3722_gpio_attach(struct as3722_softc *sc, phandle_t node); +int as3722_pinmux_configure(device_t dev, phandle_t cfgxref); + +#endif /* _AS3722_H_ */ Added: head/sys/arm/nvidia/as3722_gpio.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/nvidia/as3722_gpio.c Wed Mar 16 13:01:48 2016 (r296936) @@ -0,0 +1,577 @@ +/*- + * Copyright (c) 2016 Michal Meloun + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +#include "as3722.h" + +MALLOC_DEFINE(M_AS3722_GPIO, "AS3722 gpio", "AS3722 GPIO"); + +/* AS3722_GPIOx_CONTROL MODE and IOSF definition. */ +#define AS3722_IOSF_GPIO 0x00 +#define AS3722_IOSF_INTERRUPT_OUT 0x01 +#define AS3722_IOSF_VSUP_VBAT_LOW_UNDEBOUNCE_OUT 0x02 +#define AS3722_IOSF_GPIO_IN_INTERRUPT 0x03 +#define AS3722_IOSF_PWM_IN 0x04 +#define AS3722_IOSF_VOLTAGE_IN_STANDBY 0x05 +#define AS3722_IOSF_OC_PG_SD0 0x06 +#define AS3722_IOSF_POWERGOOD_OUT 0x07 +#define AS3722_IOSF_CLK32K_OUT 0x08 +#define AS3722_IOSF_WATCHDOG_IN 0x09 +#define AS3722_IOSF_SOFT_RESET_IN 0x0b +#define AS3722_IOSF_PWM_OUT 0x0c +#define AS3722_IOSF_VSUP_VBAT_LOW_DEBOUNCE_OUT 0x0d *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 16 14:00:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5FE69AD301B; Wed, 16 Mar 2016 14:00:46 +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 22F76767; Wed, 16 Mar 2016 14:00:46 +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 u2GE0jRV086546; Wed, 16 Mar 2016 14:00:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GE0jUY086545; Wed, 16 Mar 2016 14:00:45 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603161400.u2GE0jUY086545@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Wed, 16 Mar 2016 14:00:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296937 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 14:00:46 -0000 Author: trasz Date: Wed Mar 16 14:00:45 2016 New Revision: 296937 URL: https://svnweb.freebsd.org/changeset/base/296937 Log: Pacify Coverity in a better way, to avoid write-only variable when building without INVARIANTS. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/fs/autofs/autofs_vnops.c Modified: head/sys/fs/autofs/autofs_vnops.c ============================================================================== --- head/sys/fs/autofs/autofs_vnops.c Wed Mar 16 13:01:48 2016 (r296936) +++ head/sys/fs/autofs/autofs_vnops.c Wed Mar 16 14:00:45 2016 (r296937) @@ -370,10 +370,8 @@ static size_t autofs_dirent_reclen(const char *name) { size_t reclen; - int error; - error = autofs_readdir_one(NULL, name, -1, &reclen); - KASSERT(error == 0, ("autofs_readdir_one() failed")); + (void)autofs_readdir_one(NULL, name, -1, &reclen); return (reclen); } From owner-svn-src-head@freebsd.org Wed Mar 16 14:02:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A3CBAD315D; Wed, 16 Mar 2016 14:02:03 +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 101F7A4B; Wed, 16 Mar 2016 14:02:03 +0000 (UTC) (envelope-from etnapierala@gmail.com) Received: by mail-wm0-x231.google.com with SMTP id l68so74014788wml.1; Wed, 16 Mar 2016 07:02:02 -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=vZ0qmqyuNbqy5ZiFExmJAXiND1eS3/5O4/aC8ZPNbTc=; b=itmZf1dcv4bIryiJyon28DzwjIwHrkWYcNdiJNxqWCRpgVUasDuTMQfP/qQw7qJSeV 5aO+NsegtucZfORowXPPLmoD7M1OWIXQsDc8Z1X+U1Nww6dynuCoXWMilYFzvVYxELFa fRF4MBR2cwtKuFzR0X7x4E3qDWnP9FJx423hIKyxo2AHblDOdBjGyPlU6m6DSS651nS5 oJj4MevFVwhHNUT6wREHzMyGfLiW9Nbtp3VcQe3lEHDX7+lGTCxmtgGTZT+Oj5odLUG8 IqjFzlIpdkJN209DnUNEdxf/h1pZJ66XRmynMqfcYD97btBIN5AjrazVDgQDL1OmannU bTRA== 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=vZ0qmqyuNbqy5ZiFExmJAXiND1eS3/5O4/aC8ZPNbTc=; b=AtjB93MJz/reTNlllXcmEDpAxEckvpsQf/WwbJD7lu9BPrQjUKHBPTUXRw0dCQvFOb XlfimRlwnkLfrAB1ZOB+KHX++D6kcVjIVwWTy2F6RieJlleL26l2FbR7BWj8RpN4jahf 77mLxomowx5vPvmbdHaOYXCmVAgWvSPicgIpdaa4GgTwa1SXvdv02FLaA1wKSiSFUlPA 6puewWp4z1d5+JVNL5RoBG96yr2Xxq/hEbEUHQDo30vKfBpwxXCYfjqPIzIMLLcqHUUf nv9u+Qu/6HlVd5qX8vGf7yNm+ZjFKfp5/eJzr9lEmg3hkOsfFrBUy1OgrktXFp/dxgQX eM3w== X-Gm-Message-State: AD7BkJKCT9gJzUf6+lWqWLQWwdY7K4hXnCsBvgITg41OAptW/xS4x66iKxhCuBxwLA7VKQ== X-Received: by 10.194.87.161 with SMTP id az1mr4022167wjb.163.1458136921604; Wed, 16 Mar 2016 07:02:01 -0700 (PDT) Received: from brick.home (etb152.neoplus.adsl.tpnet.pl. [83.20.147.152]) by smtp.gmail.com with ESMTPSA id u16sm3696516wmd.5.2016.03.16.07.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 07:01:59 -0700 (PDT) Sender: =?UTF-8?Q?Edward_Tomasz_Napiera=C5=82a?= Date: Wed, 16 Mar 2016 15:01:56 +0100 From: Edward Tomasz Napierala To: Conrad Meyer Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296918 - head/sys/fs/autofs Message-ID: <20160316140156.GA3846@brick.home> Mail-Followup-To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603152042.u2FKgafc073412@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-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 14:02:03 -0000 You're right. I've added the explicit cast to void, let's see if that helps. On 0315T1346, Conrad Meyer wrote: > Instead you will get, "warning: unused but set variable 'error'" on > -NODEBUG builds. Maybe add: > > (void)error; > > Best, > Conrad > > On Tue, Mar 15, 2016 at 1:42 PM, Edward Tomasz Napierala > wrote: > > Author: trasz > > Date: Tue Mar 15 20:42:36 2016 > > New Revision: 296918 > > URL: https://svnweb.freebsd.org/changeset/base/296918 > > > > Log: > > Pacify Coverity. > > > > MFC after: 1 month > > Sponsored by: The FreeBSD Foundation > > > > Modified: > > head/sys/fs/autofs/autofs_vnops.c > > > > Modified: head/sys/fs/autofs/autofs_vnops.c > > ============================================================================== > > --- head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 19:45:24 2016 (r296917) > > +++ head/sys/fs/autofs/autofs_vnops.c Tue Mar 15 20:42:36 2016 (r296918) > > @@ -370,8 +370,10 @@ static size_t > > autofs_dirent_reclen(const char *name) > > { > > size_t reclen; > > + int error; > > > > - autofs_readdir_one(NULL, name, -1, &reclen); > > + error = autofs_readdir_one(NULL, name, -1, &reclen); > > + KASSERT(error == 0, ("autofs_readdir_one() failed")); > > > > return (reclen); > > } > > From owner-svn-src-head@freebsd.org Wed Mar 16 14:10:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9CD78AD32C6; Wed, 16 Mar 2016 14:10:36 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 333EFCF1; Wed, 16 Mar 2016 14:10:36 +0000 (UTC) (envelope-from baptiste.daroussin@gmail.com) Received: by mail-wm0-x234.google.com with SMTP id p65so74416958wmp.0; Wed, 16 Mar 2016 07:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=4UQ4qlXqdy0epX++0fKAWyLoPGfrk8DdmlrUfojRpHk=; b=cV34WBh7dDD4M2rxuQnBwLypXlcg3Jenor4knEuzatFDV1EskDbEYqdqHYKFCphpv4 C2GdmMPRl3hrNQo2Vq1JvY46C0/o9pYnUy69o7Bhc+aqriF7D94iThcojnx0F5Vuh2NS C6EkCL001HoZ6MrRctjw1qheRxmAPTMO0emmxCj0rqTCDUSUz0C7HALHBeRlq/8Rl+1K j4N1F5FPDcpQDKlwwiOURRdMD8Hht9wJ/ysif7n+ImFMflxiUdpK36lPonj8L2ntA5KT NhPXLhtsJCY928uRqZ0aFA+/mlEYOKaU+mCxbAAit07MS/qr4ILnOLvq2otjWUl6v2rl BzTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:date:from:to:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=4UQ4qlXqdy0epX++0fKAWyLoPGfrk8DdmlrUfojRpHk=; b=LY8iGHXhq2Ur8PRpv+6rT38PDL3OPVSFoQwJExa90t7ad7Mjho1xBamkE/cBgfxKOL 3BwKCDnvuIt6gJWxze1ZM0DEuCxDJJlCS4xAewg1rLmCp9ofmUolEeZsVM7tFT+sT/0F 7RDi0AaGLynyNPiZNXBxPC2ou42dm/AHdkC6Tg9Kj/t5wy0Jikz+W81/iRn+VUe+ue1G UiNNDYRz0yYEtUU6/vKmpyZljv2lQ5AC32y2eiMC5qK8mrsipEhhpS0LZM8js9I/gI83 U9J5fN3duTPnHEi4clRHZNZ2fqa72ERjKVL4tuzineUgVd7+xaYjNxy4ubO2eq+q6FQm P/tw== X-Gm-Message-State: AD7BkJLyBBqGBqY4Yj2dNS6A6hKCxv3pZr1ZnZ10mEkIX9UX9VvGoD7kkm/zDL5RD4GxGQ== X-Received: by 10.194.185.180 with SMTP id fd20mr4299099wjc.98.1458137434739; Wed, 16 Mar 2016 07:10:34 -0700 (PDT) Received: from ivaldir.etoilebsd.net ([2001:41d0:8:db4c::1]) by smtp.gmail.com with ESMTPSA id ls5sm3222088wjb.33.2016.03.16.07.10.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 07:10:33 -0700 (PDT) Sender: Baptiste Daroussin Date: Wed, 16 Mar 2016 15:10:31 +0100 From: Baptiste Daroussin To: Conrad Meyer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296918 - head/sys/fs/autofs Message-ID: <20160316141031.GL11339@ivaldir.etoilebsd.net> References: <201603152042.u2FKgafc073412@repo.freebsd.org> <20160316140156.GA3846@brick.home> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="L1EIGrW/+75u5Nmw" Content-Disposition: inline In-Reply-To: <20160316140156.GA3846@brick.home> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 14:10:36 -0000 --L1EIGrW/+75u5Nmw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 16, 2016 at 03:01:56PM +0100, Edward Tomasz Napierala wrote: > You're right. I've added the explicit cast to void, let's see > if that helps. >=20 > On 0315T1346, Conrad Meyer wrote: > > Instead you will get, "warning: unused but set variable 'error'" on > > -NODEBUG builds. Maybe add: > >=20 > > (void)error; Why everyone keeps casting when we have __unused? Bapt --L1EIGrW/+75u5Nmw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW6WlXAAoJEGOJi9zxtz5aYNkP/jK3BqLe4dKJe6oX+E4Y9nfj lXbkPzm7mQ8c6fV84RMHDu1Gs3maZNMCmR/CyHsZTayEHI3G0UYRP95tycMTmgtF SC+dE4KRIOyZt8YfOORCz+TLWLTcUk+UP3o82+XAB0FdKNlwCg+QZ2c7VtLYlmUX G7TjwiTPRL3pMRfoJ1dr5Of1qQsKcb838EYFvlLU0MKVZ/B+ri6n+aK99n5CNAed txfFzDDWPDxuUQtAWKJ3/nf2RwZiwpIa7COg7aDXLJ8Ui3NvGxRPICOSmWeZZGkU Ixjs6iwbVZGTjVXX8g/+Sbrv6NgQdRDT6fJTkOVQU2HuNWyuApt/n2tXnbJhFver R5Oz+IbZQbuXYayZPE5h7BGsr2H8evVc4uqlnXde+OD9bAoTjtvO7WQ1G/LcSmaX S+knn4O8WMveiIQnKg94dnxDRc8cUGgtzqP9WdQOr35CRaBYLyRicsr4ph4xyVrE ewkZbsCqW0izE6IEnB6EsjUN8QIy18ttfczOE/ggGottl+ovCpvgn/j6DZidsisY YWpdwDE077+mJ1YqnuVwYtgObtzYMecnpqOC4isZH38jHoNviEcV1t1E+UXLjFjQ pQGLljROmnUW0KEAC/5a9TWM151L4p/7fLL9cNC2a+U45szUIb0dUu8Ax3dVCL1F +nKXGPV9nbORsN0XmWVd =WDLu -----END PGP SIGNATURE----- --L1EIGrW/+75u5Nmw-- From owner-svn-src-head@freebsd.org Wed Mar 16 15:05:15 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7E1C7AD25F0 for ; Wed, 16 Mar 2016 15:05:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x236.google.com (mail-qg0-x236.google.com [IPv6:2607:f8b0:400d:c04::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B24CD2C for ; Wed, 16 Mar 2016 15:05:15 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x236.google.com with SMTP id w104so45308814qge.1 for ; Wed, 16 Mar 2016 08:05:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6n+zSyyJErxW1lXNLImvWmCjQXmGnYvVPYeVTZp7mz0=; b=NWH96N8IYyy0V4AmXg0/FQX7aQV1nU/BA7KQZfVXY5BKvOjJaeKREhF0b8oL4CRC+x ghaVzEics7kk+DNXFY1FeyWunXPD46CTUgAKlJXrWT0YkfxQdVVujVZNeq9r9EancAvY YIVpFd4q6XQyO061ZJ/kdNN1l8koeQ2WWIZXAK3flWcWDi9GziHl51e5ljyGA1EQS9am 4u/cgacImxPLRXRZMaKoftrBfzXXho5exm8BM0U6oY0K5gcell0w1Z9aqm0iHv1T58Eq YFN0CxP8PU5Dy3C/zJjQKb8K43HBmRPSy2dWbeKvvWl0tZDQHrhRxJ+evk8/w8IZMsH7 e45g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6n+zSyyJErxW1lXNLImvWmCjQXmGnYvVPYeVTZp7mz0=; b=bnh/mEHvRWoOf367ir/6FwTpT9yanf7BFojtjylEgtFJFsaF3TsaPtZirXvJOA5mEV itr/wruCeivQukbZLRnnI7nKrd49cZdUS+lMtPiS3H7+S8vPrBezR03QcrwvpHHBtoa9 PzEx+lmU+m/a/G8l1r6f8CTPEQWYB6GfP1qmQ/MsY2RAO6z/uYFoYym8w0XVPBtX6Hvn mMiojLpnW2ONGlvqcVQCo8rlIt38p2wnI7Gi27JRCMMCVICkPa2Dm2qBIaxOZa0Z9mVX R4fq0R086moWDSDPnw9fRiEB/QD/s//2B9iV/oOjhdrJ0KbGyIrAtGQTYDhzUXBrlkt1 GJnA== X-Gm-Message-State: AD7BkJJgxlr0j4o/1QipOH4VtQ+0rX3RejOQLtka6q+syRsTgcLYRBInrRbhH+C5YeO5A4Ul X-Received: by 10.140.42.39 with SMTP id b36mr5964782qga.4.1458140714288; Wed, 16 Mar 2016 08:05:14 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.105]) by smtp.gmail.com with ESMTPSA id 139sm1634937qhh.33.2016.03.16.08.05.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 08:05:12 -0700 (PDT) Date: Wed, 16 Mar 2016 11:05:06 -0400 From: Shawn Webb To: Gleb Smirnoff Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet Message-ID: <20160316150506.GA88619@mutt-hardenedbsd> References: <201603150015.u2F0FATD089432@repo.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="SUOF0GtieIMvvwua" Content-Disposition: inline In-Reply-To: <201603150015.u2F0FATD089432@repo.freebsd.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:05:15 -0000 --SUOF0GtieIMvvwua Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Mar 15, 2016 at 12:15:10AM +0000, Gleb Smirnoff wrote: > Author: glebius > Date: Tue Mar 15 00:15:10 2016 > New Revision: 296881 > URL: https://svnweb.freebsd.org/changeset/base/296881 >=20 > Log: > Redo r294869. The array of counters for TCP states doesn't belong to > struct tcpstat, because the structure can be zeroed out by netstat(1) -= z, > and of course running connection counts shouldn't be touched. > =20 > Place running connection counts into separate array, and provide > separate read-only sysctl oid for it. >=20 > Modified: > head/contrib/bsnmp/snmp_mibII/mibII_tcp.c > head/sys/netinet/tcp_input.c > head/sys/netinet/tcp_subr.c > head/sys/netinet/tcp_syncache.c > head/sys/netinet/tcp_timewait.c > head/sys/netinet/tcp_usrreq.c > head/sys/netinet/tcp_var.h >=20 [snip] >=20 > Modified: head/sys/netinet/tcp_input.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- head/sys/netinet/tcp_input.c Tue Mar 15 00:05:00 2016 (r296880) > +++ head/sys/netinet/tcp_input.c Tue Mar 15 00:15:10 2016 (r296881) > @@ -235,16 +235,39 @@ VNET_DEFINE(struct inpcbhead, tcb); > VNET_DEFINE(struct inpcbinfo, tcbinfo); > =20 > /* > - * TCP statistics are stored in an "array" of counter(9)s. > + * TCP statistics are stored in an array of counter(9)s, which size matc= hes > + * size of struct tcpstat. TCP running connection count is a regular ar= ray. > */ > VNET_PCPUSTAT_DEFINE(struct tcpstat, tcpstat); > -VNET_PCPUSTAT_SYSINIT(tcpstat); > SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat, > tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); > +VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]); > +SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_R= D | > + CTLFLAG_VNET, &VNET_NAME(tcps_states), TCP_NSTATES, > + "TCP connection counts by TCP state"); This breaks the build on amd64: /usr/src/sys/netinet/tcp_input.c:245:1: error: static_assert failed "compil= e-time assertion failed" SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/sys/sysctl.h:657:2: note: expanded from macro 'SYSCTL_COUNTER_= U64_ARRAY' CTASSERT((((access) & CTLTYPE) =3D=3D 0 || = \ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/src/sys/sys/systm.h:103:21: note: expanded from macro 'CTASSERT' #define CTASSERT(x) _Static_assert(x, "compile-time assertion failed") ^ ~ --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --SUOF0GtieIMvvwua Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW6XYgAAoJEGqEZY9SRW7uPIEP+QFD1adlt/SC8b5Z6ZzXmmob U7bSvuKfP7FcQqMta/V12rOBnnIJopfVctaO50cWIZlEjIukOGhP34NsZMkAfUrj hft1jfCnUkEZhh4D2z1YQBkEyZmBPrZ1vBieLOPN0B3eCZGuFjqmkth27IN0nDp9 VcWvCk7VDph1+g17gCVGdCFCMZ0wtms4Kp+FM3omRaL6jlsY5ltK7BRhagKD2txZ gfxgAw9BFaxfObxw+MPws6Kndqp52lvTuBpu1uuG1Z934gNompKMx02xFnsyCoup SGqs2xTFXV4QhvS8nB1SlamDeKHYE1rEN5OzKOlJq6lmcWQ8E5g6J4H1zPTixCQU g/JlpHh1pYsGwUdbxRcKFUx0oixID5AxlDzeiBOWovTE5EvAlhX7M8U5BuTdO1G8 eP9PpQ+d6q/1/IGaCbH4e7S/FyIb9a1VQgeEHaceK+s58bnqvlGSKcVDOQ2PBZAM QnCktAYJYAbQHj92IXjroGCkUsn1vwFCOv2JzYvan1rhdZI6edObYkhfD1t0a0Ac UfwztMUcuvbNuTQwzy3E9DtdPx2WEkSjmMWhJ8r0MP3UZy+T0S2e60NGIqKlDgom +Gk2oG0r+gqWUHGs4CJjN39zMAtVAoOXmbKt6ZO7FRKXiNXMdbzBbJoR6wmTwNgx wisnOn0LzLDDGSV0kx5B =CbOx -----END PGP SIGNATURE----- --SUOF0GtieIMvvwua-- From owner-svn-src-head@freebsd.org Wed Mar 16 15:11:38 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50690AD292F; Wed, 16 Mar 2016 15:11:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (mail.turbocat.net [IPv6:2a01:4f8:d16:4514::2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1AF5A89; Wed, 16 Mar 2016 15:11:38 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id EDCE01FE024; Wed, 16 Mar 2016 16:11:35 +0100 (CET) Subject: Re: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet To: Shawn Webb , Gleb Smirnoff References: <201603150015.u2F0FATD089432@repo.freebsd.org> <20160316150506.GA88619@mutt-hardenedbsd> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56E9784E.50005@selasky.org> Date: Wed, 16 Mar 2016 16:14:22 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160316150506.GA88619@mutt-hardenedbsd> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:11:38 -0000 On 03/16/16 16:05, Shawn Webb wrote: > This breaks the build on amd64: I believe this is fixed by r296935. --HPS From owner-svn-src-head@freebsd.org Wed Mar 16 15:21:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 076ADAD2B63 for ; Wed, 16 Mar 2016 15:21:32 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: from mail-qg0-x22c.google.com (mail-qg0-x22c.google.com [IPv6:2607:f8b0:400d:c04::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AEEF68DC for ; Wed, 16 Mar 2016 15:21:31 +0000 (UTC) (envelope-from shawn.webb@hardenedbsd.org) Received: by mail-qg0-x22c.google.com with SMTP id u110so45672304qge.3 for ; Wed, 16 Mar 2016 08:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hardenedbsd-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=1+fpGHgkpGjH0xREGsFLAKSwm/d29BlA8vgz91LouO4=; b=mVkhNcQc1kuxjMYCsFqAF6T43zNnAILsIOiimK0JVa0dWepidWbJtpLzjAC/6/vb+0 wBMfLrcgTxpKkNRloiSYNwdY0IPgVbVZNM9F/B7KhEYqN9LVP+hup6XwcC/HUfhuRBX0 QYsWuEIdkd5S1utPzQojMaEfgeRF6EdCTFy6X9jurQuRTZvNchMyHpXeE651fBtDNxZ1 ioWNX+4WsHKbtJHFZWrWhFdUUqDMl9BiE7Vo6T/gpgm3fG+xul6uHaSDSQ4bhi96JgK1 hLoDkD5B/lAz0BVLjD4kQzwQR0OzNu0t+zx9mWh6d9SIz8v2LxhU/xuTZd17Q+hnI2x5 /+gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=1+fpGHgkpGjH0xREGsFLAKSwm/d29BlA8vgz91LouO4=; b=duwXp6nALAx8N6bXdcLv5Qjj7p/wqGVTqwrEFQP3wD68W9IwH+DybtwxdZZa/U/Mn4 gN1lSuaRbt9jUJ0c9ztxxJiwdpuJJKUFgTqI2aByiQmnOJ6XEKvdeMD68s1I7iMncDSe ZgKVMFC0o+P8sByUEd5eamZIjh56H5wYjqQK+IO/UpDNIYLnLiFwrJUQWUw05QvO3+sa VIdHniHOz7WfNKaik1wOqMdD0gSO2NzcDyp0vjwqyR9iXYiNhyDur+J0LLLoE3M2o4bg 3e3jkaNjMLaZzii0ptSymOx11+ar6L1JFFJ0BqZkR52+1S3atSKhDcLA+x4ub+IRcg/M pjxw== X-Gm-Message-State: AD7BkJIdnI7b7+s25g9jzAQ9k/pL1FSz6mrkVFaTCaJJY1rNswU40ZHHD9cAejQsKO2AkTzD X-Received: by 10.140.18.168 with SMTP id 37mr6072706qgf.59.1458141690769; Wed, 16 Mar 2016 08:21:30 -0700 (PDT) Received: from mutt-hardenedbsd ([63.88.83.105]) by smtp.gmail.com with ESMTPSA id u13sm1687332qkl.17.2016.03.16.08.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 08:21:29 -0700 (PDT) Date: Wed, 16 Mar 2016 11:21:25 -0400 From: Shawn Webb To: Hans Petter Selasky Cc: Gleb Smirnoff , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296881 - in head: contrib/bsnmp/snmp_mibII sys/netinet Message-ID: <20160316152125.GB88619@mutt-hardenedbsd> References: <201603150015.u2F0FATD089432@repo.freebsd.org> <20160316150506.GA88619@mutt-hardenedbsd> <56E9784E.50005@selasky.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="nVMJ2NtxeReIH9PS" Content-Disposition: inline In-Reply-To: <56E9784E.50005@selasky.org> X-Operating-System: FreeBSD mutt-hardenedbsd 11.0-CURRENT-HBSD FreeBSD 11.0-CURRENT-HBSD X-PGP-Key: http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6A84658F52456EEE User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:21:32 -0000 --nVMJ2NtxeReIH9PS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Mar 16, 2016 at 04:14:22PM +0100, Hans Petter Selasky wrote: > On 03/16/16 16:05, Shawn Webb wrote: > > This breaks the build on amd64: >=20 > I believe this is fixed by r296935. You're right. My src tree was outdated. Thanks! --=20 Shawn Webb HardenedBSD GPG Key ID: 0x6A84658F52456EEE GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89 3D9E 6A84 658F 5245 6EEE --nVMJ2NtxeReIH9PS Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJW6XnyAAoJEGqEZY9SRW7uWyEP/1Hgr8YqHnsHpFv2nGTCiaVC 2Eqq+l/9hacO/aneKsZdQUxz9vQnPF5ii8bMAw0yoUtn21nxWtH/6cW4A8ZEpWq+ vgF86IzhwAfNs1FBibivkFS4U4n9eXYZcKz1TN1CbmOqOVDbEfonzbzMhJvRtJf6 nJe8t/0fMCBOseZpC6m6lrmIqm5TszqXA7+iJMQSvsGx7SToJYdiCig0UGPco5MC 1ClzyZCqkxtidnlH/q+3q3br9eFsakpjKPK6pReGEcYnYRtlOxIY7zWOJI6oplK0 rBSfKtq4O/gZG3PnYqrFtVNcI/2dRtIVQHgwc6zHWMBM/zh2XrX2p2jJhCkNtzEv dJPBwoQtsXr1Hh05oWJ3AsVFxB+4tGn9CvnDhqUXj12oYa/5I0cdzbuQ2mQPHmsi wb81p7o9Pug8ZVUwkUDZu1qiR2whKBH46U9e4W9kLKNnZe7sju7cGbfnLAsBxSvA kOeOpay6cfLNkOA1ZvFfyU+M+0HszD6sgzlWuyZAlxyVkwKJYjQBCiko+dNh+2pv XOUwWZ1bZjpcv8qGc/4CIVgBZO0vFKSLfT9s5jymBrbO+7WrqJOT+IAuMC2mCrP5 +uiZdfjpUoJ4AhgDsJ1uaj8nVZLRnQJ0481OkMKvInLSes8pznLm+3JoWAMOLJ9v rWCfOc+3lgD42q89nBk0 =TxI/ -----END PGP SIGNATURE----- --nVMJ2NtxeReIH9PS-- From owner-svn-src-head@freebsd.org Wed Mar 16 15:25:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0AB59AD2DCB; Wed, 16 Mar 2016 15:25:31 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from kif.fubar.geek.nz (kif.fubar.geek.nz [178.62.119.249]) by mx1.freebsd.org (Postfix) with ESMTP id D0195C41; Wed, 16 Mar 2016 15:25:30 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from zapp (global-5-141.nat-2.net.cam.ac.uk [131.111.5.141]) by kif.fubar.geek.nz (Postfix) with ESMTPSA id AC812D80AA; Wed, 16 Mar 2016 15:24:54 +0000 (UTC) Date: Wed, 16 Mar 2016 15:24:51 +0000 From: Andrew Turner To: Warner Losh Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296891 - in head/sys: cam dev/arcmsr dev/iir dev/isci dev/ncr dev/ppbus Message-ID: <20160316152451.716a7e60@zapp> In-Reply-To: <201603150517.u2F5HTkd082357@repo.freebsd.org> References: <201603150517.u2F5HTkd082357@repo.freebsd.org> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; amd64-portbld-freebsd11.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:25:31 -0000 On Tue, 15 Mar 2016 05:17:29 +0000 (UTC) Warner Losh wrote: ... > Modified: head/sys/dev/ppbus/vpo.c > ============================================================================== > --- head/sys/dev/ppbus/vpo.c Tue Mar 15 04:56:39 2016 > (r296890) +++ head/sys/dev/ppbus/vpo.c Tue Mar 15 05:17:29 > 2016 (r296891) @@ -187,17 +187,19 @@ vpo_intr(struct vpo_data ... > @@ -307,11 +309,15 @@ vpo_action(struct cam_sim *sim, union cc > > csio = &ccb->csio; > > + if (ccb->ccb_h.flags & CAM_CDB_PHYS) { > + ccb->ccb_h.status = CAM_REQ_INVALID; > + xpt_done(ccb); > + break; > + } > #ifdef VP0_DEBUG > device_printf(vpo->vpo_dev, "XPT_SCSI_IO (0x%x) > request\n", > - csio->cdb_io.cdb_bytes[0]); > + scsiio_cdb_ptr(csio)); This is broken, scsiio_cdb_ptr returns a uint8_t * while %x expects an int. Andrew From owner-svn-src-head@freebsd.org Wed Mar 16 15:31:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A10E7AD308E; Wed, 16 Mar 2016 15:31:11 +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 7AFF5E9C; Wed, 16 Mar 2016 15:31:11 +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 u2GFVAj8015988; Wed, 16 Mar 2016 15:31:10 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GFV9Dl015978; Wed, 16 Mar 2016 15:31:09 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603161531.u2GFV9Dl015978@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Wed, 16 Mar 2016 15:31:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296938 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 15:31:11 -0000 Author: andrew Date: Wed Mar 16 15:31:09 2016 New Revision: 296938 URL: https://svnweb.freebsd.org/changeset/base/296938 Log: Remove old COMPAT_FREEBSD options from the ARM kernel configs. We replaced the ABI in 10.0, and have removed support for the old ABI in 11. As such any of these options to provide compatibility prior to 10 are unneeded. Sponsored by: ABT Systems Ltd Modified: head/sys/arm/conf/ATMEL head/sys/arm/conf/CNS11XXNAS head/sys/arm/conf/EFIKA_MX head/sys/arm/conf/ETHERNUT5 head/sys/arm/conf/IMX53 head/sys/arm/conf/NOTES head/sys/arm/conf/SAM9260EK head/sys/arm/conf/std.arm head/sys/arm/conf/std.armv6 Modified: head/sys/arm/conf/ATMEL ============================================================================== --- head/sys/arm/conf/ATMEL Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/ATMEL Wed Mar 16 15:31:09 2016 (r296938) @@ -57,11 +57,6 @@ options GEOM_PART_BSD # BSD partition options GEOM_PART_MBR # MBR partition scheme options GEOM_PART_GPT # GUID Partition Tables. options GEOM_LABEL # Provides labelization -options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -options COMPAT_FREEBSD7 # Compatible with FreeBSD7 -options COMPAT_FREEBSD9 # Compatible with FreeBSD9 -options COMPAT_FREEBSD10 # Compatible with FreeBSD10 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support options STACK # stack(9) support Modified: head/sys/arm/conf/CNS11XXNAS ============================================================================== --- head/sys/arm/conf/CNS11XXNAS Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/CNS11XXNAS Wed Mar 16 15:31:09 2016 (r296938) @@ -46,11 +46,6 @@ options DDB # Enable the kernel debug #options DIAGNOSTIC -#options COMPAT_FREEBSD5 -#options COMPAT_FREEBSD6 -#options COMPAT_FREEBSD7n - - options SCHED_ULE # ULE scheduler #options SCHED_4BSD # 4BSD scheduler options GEOM_PART_BSD # BSD partition scheme Modified: head/sys/arm/conf/EFIKA_MX ============================================================================== --- head/sys/arm/conf/EFIKA_MX Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/EFIKA_MX Wed Mar 16 15:31:09 2016 (r296938) @@ -30,9 +30,6 @@ options SOC_IMX51 options SCHED_4BSD # 4BSD scheduler #options MD_ROOT # MD is a potential root device #options NFSD # Network Filesystem Server -#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/ETHERNUT5 ============================================================================== --- head/sys/arm/conf/ETHERNUT5 Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/ETHERNUT5 Wed Mar 16 15:31:09 2016 (r296938) @@ -53,9 +53,6 @@ options GEOM_PART_BSD # BSD partition options GEOM_PART_MBR # MBR partition scheme #options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_LABEL # Provides labelization -#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support #options STACK # stack(9) support Modified: head/sys/arm/conf/IMX53 ============================================================================== --- head/sys/arm/conf/IMX53 Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/IMX53 Wed Mar 16 15:31:09 2016 (r296938) @@ -27,9 +27,6 @@ options SOC_IMX53 options SCHED_4BSD # 4BSD scheduler #options NFSD # Network Filesystem Server -#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options PLATFORM options INCLUDE_CONFIG_FILE # Include this file in kernel Modified: head/sys/arm/conf/NOTES ============================================================================== --- head/sys/arm/conf/NOTES Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/NOTES Wed Mar 16 15:31:09 2016 (r296938) @@ -58,6 +58,10 @@ nooptions SMP nooptions MAXCPU nooptions COMPAT_FREEBSD4 +nooptions COMPAT_FREEBSD5 +nooptions COMPAT_FREEBSD6 +nooptions COMPAT_FREEBSD7 +nooptions COMPAT_FREEBSD9 nooption PPC_PROBE_CHIPSET nodevice fdc Modified: head/sys/arm/conf/SAM9260EK ============================================================================== --- head/sys/arm/conf/SAM9260EK Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/SAM9260EK Wed Mar 16 15:31:09 2016 (r296938) @@ -64,9 +64,6 @@ options GEOM_PART_BSD # BSD partition options GEOM_PART_MBR # MBR partition scheme #options GEOM_PART_GPT # GUID Partition Tables. #options GEOM_LABEL # Provides labelization -#options COMPAT_FREEBSD5 # Compatible with FreeBSD5 -#options COMPAT_FREEBSD6 # Compatible with FreeBSD6 -#options COMPAT_FREEBSD7 # Compatible with FreeBSD7 options SCSI_DELAY=5000 # Delay (in ms) before probing SCSI options KTRACE # ktrace(1) support #options STACK # stack(9) support Modified: head/sys/arm/conf/std.arm ============================================================================== --- head/sys/arm/conf/std.arm Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/std.arm Wed Mar 16 15:31:09 2016 (r296938) @@ -2,4 +2,5 @@ # # $FreeBSD$ +options COMPAT_FREEBSD10 # Compatible with FreeBSD10 Modified: head/sys/arm/conf/std.armv6 ============================================================================== --- head/sys/arm/conf/std.armv6 Wed Mar 16 14:00:45 2016 (r296937) +++ head/sys/arm/conf/std.armv6 Wed Mar 16 15:31:09 2016 (r296938) @@ -39,6 +39,8 @@ options KBD_INSTALL_CDEV # install a CD options FREEBSD_BOOT_LOADER # Process metadata passed from loader(8) options VFP # Enable floating point hardware support +options COMPAT_FREEBSD10 # Compatible with FreeBSD10 + # DTrace support options KDTRACE_HOOKS # Kernel DTrace hooks options DDB_CTF # all architectures - kernel ELF linker loads CTF data From owner-svn-src-head@freebsd.org Wed Mar 16 16:56:29 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 752DAAD2E21; Wed, 16 Mar 2016 16:56:29 +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 47A881612; Wed, 16 Mar 2016 16:56:29 +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 u2GGuSbe041465; Wed, 16 Mar 2016 16:56:28 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GGuSxH041464; Wed, 16 Mar 2016 16:56:28 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201603161656.u2GGuSxH041464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 16 Mar 2016 16:56:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296944 - head/sys/dev/ppbus X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 16:56:29 -0000 Author: imp Date: Wed Mar 16 16:56:28 2016 New Revision: 296944 URL: https://svnweb.freebsd.org/changeset/base/296944 Log: Fix debug printf Modified: head/sys/dev/ppbus/vpo.c Modified: head/sys/dev/ppbus/vpo.c ============================================================================== --- head/sys/dev/ppbus/vpo.c Wed Mar 16 16:52:31 2016 (r296943) +++ head/sys/dev/ppbus/vpo.c Wed Mar 16 16:56:28 2016 (r296944) @@ -316,7 +316,7 @@ vpo_action(struct cam_sim *sim, union cc } #ifdef VP0_DEBUG device_printf(vpo->vpo_dev, "XPT_SCSI_IO (0x%x) request\n", - scsiio_cdb_ptr(csio)); + *scsiio_cdb_ptr(csio)); #endif vpo_intr(vpo, csio); From owner-svn-src-head@freebsd.org Wed Mar 16 18:39:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FFE7AD323C; Wed, 16 Mar 2016 18:39:49 +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 02467241; Wed, 16 Mar 2016 18:39: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 u2GIdm7R072961; Wed, 16 Mar 2016 18:39:48 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GIdm5C072960; Wed, 16 Mar 2016 18:39:48 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201603161839.u2GIdm5C072960@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Wed, 16 Mar 2016 18:39:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296947 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 18:39:49 -0000 Author: bdrewery Date: Wed Mar 16 18:39:48 2016 New Revision: 296947 URL: https://svnweb.freebsd.org/changeset/base/296947 Log: Remove incorrect BUGS entry about asserting lock not held. For non-WITNESS< assertion support for SA_UNLOCKED was added in r125421 and made to panic in r126316. MFC after: 1 week Modified: head/share/man/man9/sx.9 Modified: head/share/man/man9/sx.9 ============================================================================== --- head/share/man/man9/sx.9 Wed Mar 16 17:35:55 2016 (r296946) +++ head/share/man/man9/sx.9 Wed Mar 16 18:39:48 2016 (r296947) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 13, 2016 +.Dd March 16, 2016 .Dt SX 9 .Os .Sh NAME @@ -320,11 +320,6 @@ end up sleeping while holding a mutex, w .Xr rwlock 9 , .Xr sema 9 .Sh BUGS -Currently there is no way to assert that a lock is not held. -This is not possible in the -.No non- Ns Dv WITNESS -case for asserting that this thread -does not hold a shared lock. In the .No non- Ns Dv WITNESS case, the From owner-svn-src-head@freebsd.org Wed Mar 16 18:45:52 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 49DA4AD3404; Wed, 16 Mar 2016 18:45:52 +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 BFF8B904; Wed, 16 Mar 2016 18:45:51 +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 u2GIjjI4025641 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Wed, 16 Mar 2016 20:45:45 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2GIjjI4025641 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2GIjjAT025639; Wed, 16 Mar 2016 20:45:45 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 16 Mar 2016 20:45:45 +0200 From: Konstantin Belousov To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296947 - head/share/man/man9 Message-ID: <20160316184545.GN1741@kib.kiev.ua> References: <201603161839.u2GIdm5C072960@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603161839.u2GIdm5C072960@repo.freebsd.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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 18:45:52 -0000 On Wed, Mar 16, 2016 at 06:39:48PM +0000, Bryan Drewery wrote: > Author: bdrewery > Date: Wed Mar 16 18:39:48 2016 > New Revision: 296947 > URL: https://svnweb.freebsd.org/changeset/base/296947 > > Log: > Remove incorrect BUGS entry about asserting lock not held. > > For non-WITNESS< assertion support for SA_UNLOCKED was added in r125421 and > made to panic in r126316. > > MFC after: 1 week > > Modified: > head/share/man/man9/sx.9 > > Modified: head/share/man/man9/sx.9 > ============================================================================== > --- head/share/man/man9/sx.9 Wed Mar 16 17:35:55 2016 (r296946) > +++ head/share/man/man9/sx.9 Wed Mar 16 18:39:48 2016 (r296947) > @@ -26,7 +26,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd March 13, 2016 > +.Dd March 16, 2016 > .Dt SX 9 > .Os > .Sh NAME > @@ -320,11 +320,6 @@ end up sleeping while holding a mutex, w > .Xr rwlock 9 , > .Xr sema 9 > .Sh BUGS > -Currently there is no way to assert that a lock is not held. > -This is not possible in the > -.No non- Ns Dv WITNESS > -case for asserting that this thread > -does not hold a shared lock. > In the > .No non- Ns Dv WITNESS > case, the The removed text was not quite correct, but its removal is not quite correct either. sx (and rw) locks do not track shared owners, so in non-witness case only exclusive ownership by curthread triggers panic for SA_UNLOCKED case. Shared ownership is silently ignored by the assert. From owner-svn-src-head@freebsd.org Wed Mar 16 18:55:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 27228AD3632; Wed, 16 Mar 2016 18:55:19 +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 E5C42F43; Wed, 16 Mar 2016 18:55:18 +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 u2GItIr2078735; Wed, 16 Mar 2016 18:55:18 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GItIZ8078734; Wed, 16 Mar 2016 18:55:18 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201603161855.u2GItIZ8078734@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Wed, 16 Mar 2016 18:55:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296948 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 18:55:19 -0000 Author: emaste Date: Wed Mar 16 18:55:17 2016 New Revision: 296948 URL: https://svnweb.freebsd.org/changeset/base/296948 Log: Remove armeb FreeBSD 6 compat shim r296861 addressed a build failure due to undefined SYS_freebsd6_lseek by adding a COMPAT_FREEBSD6 conditional, but we do not support FreeBSD 6 compatibility on armeb anyway so remove it completely. Reviewed by: andrew, bz Differential Revision: https://reviews.freebsd.org/D5643 Modified: head/sys/arm/arm/vm_machdep.c Modified: head/sys/arm/arm/vm_machdep.c ============================================================================== --- head/sys/arm/arm/vm_machdep.c Wed Mar 16 18:39:48 2016 (r296947) +++ head/sys/arm/arm/vm_machdep.c Wed Mar 16 18:55:17 2016 (r296948) @@ -191,11 +191,7 @@ cpu_set_syscall_retval(struct thread *td register_t code = ap[_QUAD_LOWWORD]; if (td->td_proc->p_sysent->sv_mask) code &= td->td_proc->p_sysent->sv_mask; - fixup = ( -#if defined(COMPAT_FREEBSD6) && defined(SYS_freebsd6_lseek) - code != SYS_freebsd6_lseek && -#endif - code != SYS_lseek) ? 1 : 0; + fixup = (code != SYS_lseek); } #endif From owner-svn-src-head@freebsd.org Wed Mar 16 19:18:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6249AAD3C7C; Wed, 16 Mar 2016 19:18:36 +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 4B6BC1AA2; Wed, 16 Mar 2016 19:18:36 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 36D75136A; Wed, 16 Mar 2016 19:18:36 +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 EAFF11FFD2; Wed, 16 Mar 2016 19:18:35 +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 3MlQechj5MMp; Wed, 16 Mar 2016 19:18:32 +0000 (UTC) Subject: Re: svn commit: r296947 - head/share/man/man9 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7F8601FFCD To: Konstantin Belousov References: <201603161839.u2GIdm5C072960@repo.freebsd.org> <20160316184545.GN1741@kib.kiev.ua> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56E9B194.9070008@FreeBSD.org> Date: Wed, 16 Mar 2016 12:18:44 -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: <20160316184545.GN1741@kib.kiev.ua> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="o3LNveQ5VfxUmAWjgoSSPaRjwwWvb6juH" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 19:18:36 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --o3LNveQ5VfxUmAWjgoSSPaRjwwWvb6juH Content-Type: multipart/mixed; boundary="ToQuchvP8JMOeebp0q6g77at569GIK31N" From: Bryan Drewery To: Konstantin Belousov Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56E9B194.9070008@FreeBSD.org> Subject: Re: svn commit: r296947 - head/share/man/man9 References: <201603161839.u2GIdm5C072960@repo.freebsd.org> <20160316184545.GN1741@kib.kiev.ua> In-Reply-To: <20160316184545.GN1741@kib.kiev.ua> --ToQuchvP8JMOeebp0q6g77at569GIK31N Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/16/2016 11:45 AM, Konstantin Belousov wrote: > On Wed, Mar 16, 2016 at 06:39:48PM +0000, Bryan Drewery wrote: >> Author: bdrewery >> Date: Wed Mar 16 18:39:48 2016 >> New Revision: 296947 >> URL: https://svnweb.freebsd.org/changeset/base/296947 >> >> Log: >> Remove incorrect BUGS entry about asserting lock not held. >> =20 >> For non-WITNESS< assertion support for SA_UNLOCKED was added in r125= 421 and >> made to panic in r126316. >> =20 >> MFC after: 1 week >> >> Modified: >> head/share/man/man9/sx.9 >> >> Modified: head/share/man/man9/sx.9 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- head/share/man/man9/sx.9 Wed Mar 16 17:35:55 2016 (r296946) >> +++ head/share/man/man9/sx.9 Wed Mar 16 18:39:48 2016 (r296947) >> @@ -26,7 +26,7 @@ >> .\" >> .\" $FreeBSD$ >> .\" >> -.Dd March 13, 2016 >> +.Dd March 16, 2016 >> .Dt SX 9 >> .Os >> .Sh NAME >> @@ -320,11 +320,6 @@ end up sleeping while holding a mutex, w >> .Xr rwlock 9 , >> .Xr sema 9 >> .Sh BUGS >> -Currently there is no way to assert that a lock is not held. >> -This is not possible in the >> -.No non- Ns Dv WITNESS >> -case for asserting that this thread >> -does not hold a shared lock. >> In the >> .No non- Ns Dv WITNESS >> case, the > The removed text was not quite correct, but its removal is not quite co= rrect > either. sx (and rw) locks do not track shared owners, so in non-witnes= s > case only exclusive ownership by curthread triggers panic for SA_UNLOCK= ED > case. Shared ownership is silently ignored by the assert. >=20 Yes you're right. The original change for this in r125421 was checking shared count: > Index: head/sys/kern/kern_sx.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 > --- head/sys/kern/kern_sx.c (revision 125420) > +++ head/sys/kern/kern_sx.c (revision 125421) > @@ -344,6 +344,17 @@ > sx->sx_object.lo_name, file, line); > mtx_unlock(sx->sx_lock); > break; > + case SX_UNLOCKED: > +#ifdef WITNESS > + witness_assert(&sx->sx_object, what, file, line); > +#else > + mtx_lock(sx->sx_lock); > + if (sx->sx_cnt !=3D 0 && sx->sx_xholder =3D=3D curthrea= d) > + printf("Lock %s locked @ %s:%d\n", > + sx->sx_object.lo_name, file, line); > + mtx_unlock(sx->sx_lock); > +#endif > + break; > default: > panic("Unknown sx lock assertion: %d @ %s:%d", what, fi= le, > line); But it was later removed in r126003: > Index: head/sys/kern/kern_sx.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 > --- head/sys/kern/kern_sx.c (revision 126002) > +++ head/sys/kern/kern_sx.c (revision 126003) > @@ -348,8 +348,12 @@ > #ifdef WITNESS > witness_assert(&sx->sx_object, what, file, line); > #else > + /* > + * We are able to check only exclusive lock here, > + * we cannot assert that *this* thread owns slock. > + */ > mtx_lock(sx->sx_lock); > - if (sx->sx_cnt !=3D 0 && sx->sx_xholder =3D=3D curthrea= d) > + if (sx->sx_xholder =3D=3D curthread) > printf("Lock %s locked @ %s:%d\n", > sx->sx_object.lo_name, file, line); > mtx_unlock(sx->sx_lock); I incorrectly was looking at only the original code and the panic fix, rather than current code to ensure it still was checking shared lock holders. --=20 Regards, Bryan Drewery --ToQuchvP8JMOeebp0q6g77at569GIK31N-- --o3LNveQ5VfxUmAWjgoSSPaRjwwWvb6juH 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 iQEcBAEBAgAGBQJW6bGUAAoJEDXXcbtuRpfPDxUH/23sWb4+uLtL16rSS/HdehET dmktp7mBOQ61Wvyj3MiU5fSLVtZHgHtsjMqRykNrfGkUT91d/Cki9w2X8OlitCgU TMuCoT1OexBGSo6kFfqcH5zsqEFsSPvmVXB35x2jYQXEpihqUrlm3HjMDVDUpGlL Ew0PRJv1riGc+jW+52IEHXquQ+luwRRN1KLTLYi+U+JcQbascRGRRi/R9ykx5tTd mbBcDtX+ZCwJsewD70Yl7dbI5O4fJXi7fryiYOx6CXnLqK0YfDB3cO3zCoCvVPb6 brbyYUOrRTT0EU4yXWiuiqleQYsMCL5hgmAx30m6IYP0nEiD6q1MjuS09VyR1DY= =zkR0 -----END PGP SIGNATURE----- --o3LNveQ5VfxUmAWjgoSSPaRjwwWvb6juH-- From owner-svn-src-head@freebsd.org Wed Mar 16 19:36:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34458AD23FB; Wed, 16 Mar 2016 19:36:13 +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 055857ED; Wed, 16 Mar 2016 19:36:12 +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 u2GJaC1C090905; Wed, 16 Mar 2016 19:36:12 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GJaC2Q090904; Wed, 16 Mar 2016 19:36:12 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603161936.u2GJaC2Q090904@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 16 Mar 2016 19:36:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296949 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 19:36:13 -0000 Author: np Date: Wed Mar 16 19:36:11 2016 New Revision: 296949 URL: https://svnweb.freebsd.org/changeset/base/296949 Log: cxgbe(4): Remove a couple of pointless assignments in sysctl_meminfo. Do not display range if start = stop (this is a workaround for some unused regions). Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Mar 16 18:55:17 2016 (r296948) +++ head/sys/dev/cxgbe/t4_main.c Wed Mar 16 19:36:11 2016 (r296949) @@ -6287,6 +6287,9 @@ mem_region_show(struct sbuf *sb, const c { unsigned int size; + if (from == to) + return; + size = to - from + 1; if (size == 0) return; @@ -6390,13 +6393,10 @@ sysctl_meminfo(SYSCTL_HANDLER_ARGS) md++; if (t4_read_reg(sc, A_LE_DB_CONFIG) & F_HASHEN) { - if (chip_id(sc) <= CHELSIO_T5) { - hi = t4_read_reg(sc, A_LE_DB_TID_HASHBASE) / 4; + if (chip_id(sc) <= CHELSIO_T5) md->base = t4_read_reg(sc, A_LE_DB_HASH_TID_BASE); - } else { - hi = t4_read_reg(sc, A_LE_DB_HASH_TID_BASE); + else md->base = t4_read_reg(sc, A_LE_DB_HASH_TBL_BASE_ADDR); - } md->limit = 0; } else { md->base = 0; From owner-svn-src-head@freebsd.org Wed Mar 16 19:41:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14BF5AD24EE; Wed, 16 Mar 2016 19:41:02 +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 CAD23A1C; Wed, 16 Mar 2016 19:41:01 +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 u2GJf02P091108; Wed, 16 Mar 2016 19:41:00 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GJf0GW091106; Wed, 16 Mar 2016 19:41:00 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603161941.u2GJf0GW091106@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 16 Mar 2016 19:41:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296950 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 19:41:02 -0000 Author: np Date: Wed Mar 16 19:41:00 2016 New Revision: 296950 URL: https://svnweb.freebsd.org/changeset/base/296950 Log: cxgbe(4): Update some register settings in the default configuration files to match the "uwire" configuration. Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:36:11 2016 (r296949) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:41:00 2016 (r296950) @@ -10,7 +10,7 @@ [global] rss_glb_config_mode = basicvirtual - rss_glb_config_options = tnlmapen, hashtoeplitz, tnlalllkp + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp sge_timer_value = 1, 5, 10, 50, 100, 200 # usecs @@ -20,28 +20,29 @@ # disable TP_PARA_REG3.RxFragEn reg[0x7d6c] = 0x00000000/0x00007000 - # TP_SHIFT_CNT - reg[0x7dc0] = 0x62f8849 + reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe filterMask = protocol, fcoe - # TP rx and tx channels (0 = auto). + tp_pmrx = 38, 512 + tp_pmrx_pagesize = 64K + + # TP number of RX channels (0 = auto) tp_nrxch = 0 - tp_ntxch = 0 - # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38, 512 tp_pmtx = 60, 512 - tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K - # cluster, lan, or wan. - tp_tcptuning = lan + # TP number of TX channels (0 = auto) + tp_ntxch = 0 # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 + # cluster, lan, or wan. + tp_tcptuning = lan + # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by # these 4 PFs only. Not used here at all. [function "0"] @@ -166,7 +167,7 @@ [fini] version = 0x1 - checksum = 0x98210e18 + checksum = 0x5a34a3ce # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:36:11 2016 (r296949) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:41:00 2016 (r296950) @@ -10,12 +10,33 @@ [global] rss_glb_config_mode = basicvirtual - rss_glb_config_options = tnlmapen, hashtoeplitz, tnlalllkp + rss_glb_config_options = tnlmapen,hashtoeplitz,tnlalllkp # PL_TIMEOUT register - pl_timeout_value = 200 # the timeout value in units of us + pl_timeout_value = 10000 # the timeout value in units of us - sge_timer_value = 1, 5, 10, 50, 100, 200 # usecs + # SGE_THROTTLE_CONTROL + bar2throttlecount = 500 # bar2throttlecount in us + + sge_timer_value = 1, 5, 10, 50, 100, 200 # SGE_TIMER_VALUE* in usecs + + reg[0x1124] = 0x00000400/0x00000400 # SGE_CONTROL2, enable VFIFO; if + # SGE_VFIFO_SIZE is not set, then + # firmware will set it up in function + # of number of egress queues used + + reg[0x1130] = 0x00d5ffeb # SGE_DBP_FETCH_THRESHOLD, fetch + # threshold set to queue depth + # minus 128-entries for FL and HP + # queues, and 0xfff for LP which + # prompts the firmware to set it up + # in function of egress queues + # used + + reg[0x113c] = 0x0002ffc0 # SGE_VFIFO_SIZE, set to 0x2ffc0 which + # prompts the firmware to set it up in + # function of number of egress queues + # used # enable TP_OUT_CONFIG.IPIDSPLITMODE reg[0x7d04] = 0x00010000/0x00010000 @@ -26,34 +47,38 @@ # enable TP_PARA_REG6.EnableCSnd reg[0x7d78] = 0x00000400/0x00000000 - # TP_SHIFT_CNT - reg[0x7dc0] = 0x62f8849 - - # TP_GLOBAL_CONFIG - reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable - - # TP_PARA_REG0 - reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 + reg[0x7dc0] = 0x0e2f8849 # TP_SHIFT_CNT filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe filterMask = protocol, fcoe - # TP rx and tx channels (0 = auto). + tp_pmrx = 38, 512 + tp_pmrx_pagesize = 64K + + # TP number of RX channels (0 = auto) tp_nrxch = 0 - tp_ntxch = 0 - # TP rx and tx payload memory (% of the total EDRAM + DDR3). - tp_pmrx = 38, 512 tp_pmtx = 60, 512 - tp_pmrx_pagesize = 64K tp_pmtx_pagesize = 64K - # cluster, lan, or wan. - tp_tcptuning = lan + # TP number of TX channels (0 = auto) + tp_ntxch = 0 # TP OFLD MTUs tp_mtus = 88, 256, 512, 576, 808, 1024, 1280, 1488, 1500, 2002, 2048, 4096, 4352, 8192, 9000, 9600 + # TP_GLOBAL_CONFIG + reg[0x7d08] = 0x00000800/0x00000800 # set IssFromCplEnable + + # TP_PC_CONFIG + reg[0x7d48] = 0x00000000/0x00000400 # clear EnableFLMError + + # TP_PARA_REG0 + reg[0x7d60] = 0x06000000/0x07000000 # set InitCWND to 6 + + # cluster, lan, or wan. + tp_tcptuning = lan + # MC configuration mc_mode_brc[0] = 1 # mc0 - 1: enable BRC, 0: enable RBC mc_mode_brc[1] = 1 # mc1 - 1: enable BRC, 0: enable RBC @@ -186,7 +211,7 @@ [fini] version = 0x1 - checksum = 0x7044b7fd + checksum = 0xdd685b # # $FreeBSD$ # From owner-svn-src-head@freebsd.org Wed Mar 16 19:43:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DBC9BAD26FD; Wed, 16 Mar 2016 19:43:45 +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 9F4F0DC6; Wed, 16 Mar 2016 19:43:45 +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 u2GJhiOi093824; Wed, 16 Mar 2016 19:43:44 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GJhisY093821; Wed, 16 Mar 2016 19:43:44 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603161943.u2GJhisY093821@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 16 Mar 2016 19:43:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296951 - in head/sys/dev/cxgbe: . firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 19:43:46 -0000 Author: np Date: Wed Mar 16 19:43:44 2016 New Revision: 296951 URL: https://svnweb.freebsd.org/changeset/base/296951 Log: cxgbe(4): Enable additional capabilities in the default configuration files. All features with FreeBSD drivers of some kind are now in the default configuration. Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:41:00 2016 (r296950) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:43:44 2016 (r296951) @@ -25,13 +25,13 @@ filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe filterMask = protocol, fcoe - tp_pmrx = 38, 512 + tp_pmrx = 36, 512 tp_pmrx_pagesize = 64K # TP number of RX channels (0 = auto) tp_nrxch = 0 - tp_pmtx = 60, 512 + tp_pmtx = 46, 512 tp_pmtx_pagesize = 64K # TP number of TX channels (0 = auto) @@ -92,10 +92,14 @@ pmask = all # driver will mask off features it won't use - protocol = ofld + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu tp_l2t = 4096 tp_ddp = 2 + tp_ddp_iscsi = 2 + tp_stag = 2 + tp_pbl = 5 + tp_rq = 7 # TCAM has 8K cells; each region must start at a multiple of 128 cell. # Each entry in these categories takes 4 cells each. nhash will use the @@ -167,7 +171,7 @@ [fini] version = 0x1 - checksum = 0x5a34a3ce + checksum = 0x76b034e0 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:41:00 2016 (r296950) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:43:44 2016 (r296951) @@ -52,13 +52,13 @@ filterMode = fragmentation, mpshittype, protocol, vlan, port, fcoe filterMask = protocol, fcoe - tp_pmrx = 38, 512 + tp_pmrx = 36, 512 tp_pmrx_pagesize = 64K # TP number of RX channels (0 = auto) tp_nrxch = 0 - tp_pmtx = 60, 512 + tp_pmtx = 46, 512 tp_pmtx_pagesize = 64K # TP number of TX channels (0 = auto) @@ -136,10 +136,14 @@ pmask = all # driver will mask off features it won't use - protocol = ofld + protocol = ofld, rddp, rdmac, iscsi_initiator_pdu, iscsi_target_pdu, iscsi_t10dif tp_l2t = 4096 tp_ddp = 2 + tp_ddp_iscsi = 2 + tp_stag = 2 + tp_pbl = 5 + tp_rq = 7 # TCAM has 8K cells; each region must start at a multiple of 128 cell. # Each entry in these categories takes 4 cells each. nhash will use the @@ -211,7 +215,7 @@ [fini] version = 0x1 - checksum = 0xdd685b + checksum = 0xebb87494 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Mar 16 19:41:00 2016 (r296950) +++ head/sys/dev/cxgbe/t4_main.c Wed Mar 16 19:43:44 2016 (r296951) @@ -334,7 +334,8 @@ TUNABLE_INT("hw.cxgbe.nbmcaps_allowed", static int t4_linkcaps_allowed = 0; /* No DCBX, PPP, etc. by default */ TUNABLE_INT("hw.cxgbe.linkcaps_allowed", &t4_linkcaps_allowed); -static int t4_switchcaps_allowed = 0; +static int t4_switchcaps_allowed = FW_CAPS_CONFIG_SWITCH_INGRESS | + FW_CAPS_CONFIG_SWITCH_EGRESS; TUNABLE_INT("hw.cxgbe.switchcaps_allowed", &t4_switchcaps_allowed); static int t4_niccaps_allowed = FW_CAPS_CONFIG_NIC; @@ -343,13 +344,13 @@ TUNABLE_INT("hw.cxgbe.niccaps_allowed", static int t4_toecaps_allowed = -1; TUNABLE_INT("hw.cxgbe.toecaps_allowed", &t4_toecaps_allowed); -static int t4_rdmacaps_allowed = 0; +static int t4_rdmacaps_allowed = -1; TUNABLE_INT("hw.cxgbe.rdmacaps_allowed", &t4_rdmacaps_allowed); static int t4_tlscaps_allowed = 0; TUNABLE_INT("hw.cxgbe.tlscaps_allowed", &t4_tlscaps_allowed); -static int t4_iscsicaps_allowed = 0; +static int t4_iscsicaps_allowed = -1; TUNABLE_INT("hw.cxgbe.iscsicaps_allowed", &t4_iscsicaps_allowed); static int t4_fcoecaps_allowed = 0; @@ -9103,9 +9104,26 @@ tweak_tunables(void) if (t4_toecaps_allowed == -1) t4_toecaps_allowed = FW_CAPS_CONFIG_TOE; + + if (t4_rdmacaps_allowed == -1) { + t4_rdmacaps_allowed = FW_CAPS_CONFIG_RDMA_RDDP | + FW_CAPS_CONFIG_RDMA_RDMAC; + } + + if (t4_iscsicaps_allowed == -1) { + t4_iscsicaps_allowed = FW_CAPS_CONFIG_ISCSI_INITIATOR_PDU | + FW_CAPS_CONFIG_ISCSI_TARGET_PDU | + FW_CAPS_CONFIG_ISCSI_T10DIF; + } #else if (t4_toecaps_allowed == -1) t4_toecaps_allowed = 0; + + if (t4_rdmacaps_allowed == -1) + t4_rdmacaps_allowed = 0; + + if (t4_iscsicaps_allowed == -1) + t4_iscsicaps_allowed = 0; #endif #ifdef DEV_NETMAP From owner-svn-src-head@freebsd.org Wed Mar 16 19:46:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3546BAD27E9; Wed, 16 Mar 2016 19:46: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 1023BFB5; Wed, 16 Mar 2016 19:46:23 +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 u2GJkNG8093971; Wed, 16 Mar 2016 19:46:23 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GJkNwb093969; Wed, 16 Mar 2016 19:46:23 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603161946.u2GJkNwb093969@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Wed, 16 Mar 2016 19:46:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296952 - head/sys/dev/cxgbe/firmware X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 19:46:24 -0000 Author: np Date: Wed Mar 16 19:46:22 2016 New Revision: 296952 URL: https://svnweb.freebsd.org/changeset/base/296952 Log: cxgbe(4): Enable PFs 0-3, and allow creation of SR-IOV VFs on these PFs in the default configuration files. Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Modified: head/sys/dev/cxgbe/firmware/t4fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:43:44 2016 (r296951) +++ head/sys/dev/cxgbe/firmware/t4fw_cfg.txt Wed Mar 16 19:46:22 2016 (r296952) @@ -44,38 +44,58 @@ tp_tcptuning = lan # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by -# these 4 PFs only. Not used here at all. +# these 4 PFs only. [function "0"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "0/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x1 [function "1"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "1/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x2 [function "2"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "2/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x4 [function "3"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "3/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x8 # PF4 is the resource-rich PF that the bus/nexus driver attaches to. # It gets 32 MSI/128 MSI-X vectors. @@ -87,7 +107,7 @@ niqflint = 512 nethctrl = 1024 neq = 2048 - nexactf = 328 + nexactf = 280 cmask = all pmask = all @@ -135,6 +155,60 @@ nexactf = 8 nfilter = 16 +# For Virtual functions, we only allow NIC functionality and we only allow +# access to one port (1 << PF). Note that because of limitations in the +# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL +# and GTS registers, the number of Ingress and Egress Queues must be a power +# of 2. +# +[function "0/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "1/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +[function "2/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x4 + +[function "3/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x8 + # MPS has 192K buffer space for ingress packets from the wire as well as # loopback path of the L2 switch. [port "0"] @@ -171,7 +245,7 @@ [fini] version = 0x1 - checksum = 0x76b034e0 + checksum = 0xbec0621 # # $FreeBSD$ # Modified: head/sys/dev/cxgbe/firmware/t5fw_cfg.txt ============================================================================== --- head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:43:44 2016 (r296951) +++ head/sys/dev/cxgbe/firmware/t5fw_cfg.txt Wed Mar 16 19:46:22 2016 (r296952) @@ -88,38 +88,58 @@ # TPT error. # PFs 0-3. These get 8 MSI/8 MSI-X vectors each. VFs are supported by -# these 4 PFs only. Not used here at all. +# these 4 PFs only. [function "0"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "0/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x1 [function "1"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "1/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x2 [function "2"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "2/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x4 [function "3"] - nvf = 16 - nvi = 1 - rssnvi = 0 -[function "3/*"] - nvi = 1 - rssnvi = 0 + nvf = 4 + wx_caps = all + r_caps = all + nvi = 2 + rssnvi = 2 + niqflint = 4 + nethctrl = 4 + neq = 8 + nexactf = 4 + cmask = all + pmask = 0x8 # PF4 is the resource-rich PF that the bus/nexus driver attaches to. # It gets 32 MSI/128 MSI-X vectors. @@ -131,7 +151,7 @@ niqflint = 512 nethctrl = 1024 neq = 2048 - nexactf = 328 + nexactf = 456 cmask = all pmask = all @@ -179,6 +199,60 @@ nexactf = 8 nfilter = 16 +# For Virtual functions, we only allow NIC functionality and we only allow +# access to one port (1 << PF). Note that because of limitations in the +# Scatter Gather Engine (SGE) hardware which checks writes to VF KDOORBELL +# and GTS registers, the number of Ingress and Egress Queues must be a power +# of 2. +# +[function "0/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x1 + +[function "1/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x2 + +[function "2/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x4 + +[function "3/*"] + wx_caps = 0x82 + r_caps = 0x86 + nvi = 1 + rssnvi = 1 + niqflint = 2 + nethctrl = 2 + neq = 4 + nexactf = 2 + cmask = all + pmask = 0x8 + # MPS has 192K buffer space for ingress packets from the wire as well as # loopback path of the L2 switch. [port "0"] @@ -215,7 +289,7 @@ [fini] version = 0x1 - checksum = 0xebb87494 + checksum = 0x2d7417e5 # # $FreeBSD$ # From owner-svn-src-head@freebsd.org Wed Mar 16 20:27:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3B914AD32EE; Wed, 16 Mar 2016 20:27:45 +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 0C2D3666; Wed, 16 Mar 2016 20:27:44 +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 u2GKRcWs077538 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 13:27:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2GKRcnQ077537; Wed, 16 Mar 2016 13:27:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 16 Mar 2016 13:27:38 -0700 From: Gleb Smirnoff To: John Baldwin Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib Message-ID: <20160316202738.GL1328@FreeBSD.org> References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <2420759.o4YiE5Za4X@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2420759.o4YiE5Za4X@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 20:27:45 -0000 On Tue, Mar 15, 2016 at 10:43:53AM -0700, John Baldwin wrote: J> > Log: J> > Fix witness panic in the ipoib_ioctl() function when unloading the J> > ipoib module. J> > J> > The bpfdetach() function is trying to turn off promiscious mode on the J> > network interface it is attached to while holding a mutex. The fix J> > consists of ignoring any further calls to the ipoib_ioctl() function J> > when the network interface is going to be detached. The ipoib_ioctl() J> > function might sleep. J> > J> > Sponsored by: Mellanox Technologies J> > MFC after: 1 week J> J> In all of the other NIC drivers I have worked on the fix has been to call J> if_detach (or ether_ifdetach) as the first step in your detach method before J> you try to stop the interface. The idea is to remove external connections J> from your driver first, and the only after those have drained do you actually J> shut down the hardware. Given you are calling if_detach() just before J> if_free() below, ipoib just seems to be broken here. J> J> For example, detach in a typical NIC driver does this: J> J> struct foo_softc *sc; J> J> sc = device_get_softc(dev); J> ether_ifdetach(sc->sc_ifp); J> FOO_LOCK(sc); J> foo_stop(sc); J> FOO_UNLOCK(sc); J> callout_drain(&sc->timer); J> bus_teardown_intr(...); J> bus_release_resource(...); J> if_free(sc->sc_ifp); J> J> Similarly, devices with a character device in /dev should be calling J> destroy_dev() first before shutting down hardware, etc. In the new KPI in the projects/ifnet branch, I am doing the following: - there is only one if_detach(), that does both detach and free - if_detach() is called at the very last stage, after stopping hardware (if hw is still present) - driver is responsible to be ready to be called from upper half of the stack, regardless of the state of hardware. Ususally it means that it should lock internal mutex, and check internal RUNNING flag. Note, that hardware can go away asynchronously, so demand to call if_detach() before stopping hardware can't be fulfiled. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Mar 16 20:32:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30873AD3676; Wed, 16 Mar 2016 20:32:42 +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 19CF2D23; Wed, 16 Mar 2016 20:32:41 +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 u2GKWffp077560 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 13:32:41 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2GKWfh7077559; Wed, 16 Mar 2016 13:32:41 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 16 Mar 2016 13:32:41 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <20160316203241.GM1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603160837.u2G8bqgr087126@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 20:32:42 -0000 On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: H> Author: hselasky H> Date: Wed Mar 16 08:37:52 2016 H> New Revision: 296933 H> URL: https://svnweb.freebsd.org/changeset/base/296933 H> H> Log: H> Improve the implementation and documentation of the H> SYSCTL_COUNTER_U64_ARRAY() macro. H> H> - Add proper asserts to the SYSCTL_COUNTER_U64_ARRAY() macro that checks H> the size of the first element of the array. H> - Add an example to the counter(9) manual page how to use the H> SYSCTL_COUNTER_U64_ARRAY() macro. H> - Add some missing symbolic links for counter(9) while at it. ... H> +.Sh EXAMPLES H> +The following example creates a static counter array exported to H> +userspace through a sysctl: H> +.Bd -literal -offset indent H> +#define MY_SIZE 8 H> +static counter_u64_t array[MY_SIZE]; H> +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, H> + &array[0], MY_SIZE, "Test counter array"); I always wondered what is stylistically better: array or &array[0]? I usually prefer the former. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Mar 16 20:34:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7845AD375E; Wed, 16 Mar 2016 20:34:49 +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 B04E2EBD; Wed, 16 Mar 2016 20:34:49 +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 u2GKYmnJ077586 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 13:34:49 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2GKYmXD077585; Wed, 16 Mar 2016 13:34:48 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 16 Mar 2016 13:34:48 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <20160316203448.GN1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203241.GM1328@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160316203241.GM1328@FreeBSD.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 20:34:49 -0000 On Wed, Mar 16, 2016 at 01:32:41PM -0700, Gleb Smirnoff wrote: T> H> +.Sh EXAMPLES T> H> +The following example creates a static counter array exported to T> H> +userspace through a sysctl: T> H> +.Bd -literal -offset indent T> H> +#define MY_SIZE 8 T> H> +static counter_u64_t array[MY_SIZE]; T> H> +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, T> H> + &array[0], MY_SIZE, "Test counter array"); T> T> I always wondered what is stylistically better: array or &array[0]? I T> usually prefer the former. And now your assertion forces to do the latter. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Mar 16 20:36:02 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4B566AD37E1; Wed, 16 Mar 2016 20:36:02 +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 376BF9D; Wed, 16 Mar 2016 20:36:01 +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 u2GKa1O0077602 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 13:36:01 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2GKa1jO077601; Wed, 16 Mar 2016 13:36:01 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Wed, 16 Mar 2016 13:36:01 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <20160316203601.GO1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603160837.u2G8bqgr087126@repo.freebsd.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 20:36:02 -0000 On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: H> Modified: head/sys/sys/sysctl.h H> ============================================================================== H> --- head/sys/sys/sysctl.h Wed Mar 16 06:42:15 2016 (r296932) H> +++ head/sys/sys/sysctl.h Wed Mar 16 08:37:52 2016 (r296933) H> @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e H> SYSCTL_OID(parent, nbr, name, \ H> CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ H> (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ H> - CTASSERT(((access) & CTLTYPE) == 0 || \ H> - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) H> + CTASSERT((((access) & CTLTYPE) == 0 || \ H> + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ H> + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ H> + sizeof(uint64_t) == sizeof(**(ptr))) I don't agree with the last line. Does it assert that counter_u64_t is implemented using uint64_t? That is true, but that is internal detail, that might be changed in future. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Wed Mar 16 21:34:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCDF9AD2984; Wed, 16 Mar 2016 21:34:49 +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 99037ECF; Wed, 16 Mar 2016 21:34:49 +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 610D0B985; Wed, 16 Mar 2016 17:34:48 -0400 (EDT) From: John Baldwin To: Gleb Smirnoff Cc: Hans Petter Selasky , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib Date: Wed, 16 Mar 2016 14:31:37 -0700 Message-ID: <5463538.GTDDlnsCR6@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <20160316202738.GL1328@FreeBSD.org> References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <2420759.o4YiE5Za4X@ralph.baldwin.cx> <20160316202738.GL1328@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); Wed, 16 Mar 2016 17:34:48 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 21:34:49 -0000 On Wednesday, March 16, 2016 01:27:38 PM Gleb Smirnoff wrote: > On Tue, Mar 15, 2016 at 10:43:53AM -0700, John Baldwin wrote: > J> > Log: > J> > Fix witness panic in the ipoib_ioctl() function when unloading the > J> > ipoib module. > J> > > J> > The bpfdetach() function is trying to turn off promiscious mode on the > J> > network interface it is attached to while holding a mutex. The fix > J> > consists of ignoring any further calls to the ipoib_ioctl() function > J> > when the network interface is going to be detached. The ipoib_ioctl() > J> > function might sleep. > J> > > J> > Sponsored by: Mellanox Technologies > J> > MFC after: 1 week > J> > J> In all of the other NIC drivers I have worked on the fix has been to call > J> if_detach (or ether_ifdetach) as the first step in your detach method before > J> you try to stop the interface. The idea is to remove external connections > J> from your driver first, and the only after those have drained do you actually > J> shut down the hardware. Given you are calling if_detach() just before > J> if_free() below, ipoib just seems to be broken here. > J> > J> For example, detach in a typical NIC driver does this: > J> > J> struct foo_softc *sc; > J> > J> sc = device_get_softc(dev); > J> ether_ifdetach(sc->sc_ifp); > J> FOO_LOCK(sc); > J> foo_stop(sc); > J> FOO_UNLOCK(sc); > J> callout_drain(&sc->timer); > J> bus_teardown_intr(...); > J> bus_release_resource(...); > J> if_free(sc->sc_ifp); > J> > J> Similarly, devices with a character device in /dev should be calling > J> destroy_dev() first before shutting down hardware, etc. > > In the new KPI in the projects/ifnet branch, I am doing the following: > > - there is only one if_detach(), that does both detach and free > - if_detach() is called at the very last stage, after stopping hardware (if hw is still present) > - driver is responsible to be ready to be called from upper half of the stack, > regardless of the state of hardware. Ususally it means that it should lock internal mutex, > and check internal RUNNING flag. > > Note, that hardware can go away asynchronously, so demand to call if_detach() > before stopping hardware can't be fulfiled. How do you prevent a userland application from doing the equivalent of 'ifconfig up' in between a driver calling foo_stop() to clear RUNNING and the later call to if_detach? This race is why I think as a general rule drivers should try to detach external references first before trying to quiesce the hardware. Certainly if the hardware is gone there's nothing to quiesce, but that's orthogonal to the race of how you ensure the user doesn't "undo" the explicit hardware quiesce performed during detach when your hardware is still around. (You do agree that a driver should explicitly stop hardware when being detached so it doesn't continue to DMA or fire interrupts, right? And that needs to happen at least once after ensuring you can't be "upped".) Previously some drivers tried to handle this by duplicating logic to set a "detaching" flag during detach to ignore all ioctls. It seems cleaner to me for drivers to instead call if_detach first (and let it drain once it is fixed to actually do some sort of drain ala bus_teardown_intr()) rather than having that code duplicated in all the drivers. -- John Baldwin From owner-svn-src-head@freebsd.org Wed Mar 16 22:03:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A70F7AD32C3; Wed, 16 Mar 2016 22:03:00 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 38A2F1DDA; Wed, 16 Mar 2016 22:02:59 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) 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 565E825D3899; Wed, 16 Mar 2016 22:02:55 +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 57F71C789B6; Wed, 16 Mar 2016 22:02:54 +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 H_qQZN0p6l7y; Wed, 16 Mar 2016 22:02:51 +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 69657C78994; Wed, 16 Mar 2016 22:02:51 +0000 (UTC) Date: Wed, 16 Mar 2016 22:02:51 +0000 (UTC) From: "Bjoern A. Zeeb" To: "Conrad E. Meyer" cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296927 - in head: share/man/man9 sys/kern sys/sys In-Reply-To: <201603160422.u2G4MWg1012528@repo.freebsd.org> Message-ID: References: <201603160422.u2G4MWg1012528@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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:03:00 -0000 On Wed, 16 Mar 2016, Conrad E. Meyer wrote: > Author: cem > Date: Wed Mar 16 04:22:32 2016 > New Revision: 296927 > URL: https://svnweb.freebsd.org/changeset/base/296927 > > Log: > fail(9): Upstreaming some fail point enhancements > > This is several year's worth of fail point upgrades done at EMC Isilon. They > are interdependent enough that it makes sense to put a single diff up for them. > Primarily, we added: > > - Changing all mainline execution paths to be lockless, which lets us use fail > points in more sleep-sensitive areas, and allows more parallel execution > - A number of additional commands, including 'pause' that lets us do some > interesting deterministic repros of race conditions > - The ability to dump the stacks of all threads sleeping on a fail point > - A number of other API changes to allow marking up the fail point's context in > the code, and firing callbacks before and after execution > - A man page update > > Submitted by: Matthew Bryan > Reviewed by: cem (earlier version), jhb, kib, pho > With feedback from: bdrewery > Sponsored by: EMC / Isilon Storage Division > Differential Revision: https://reviews.freebsd.org/D5427 > > Modified: > head/share/man/man9/fail.9 > head/sys/kern/kern_fail.c > head/sys/kern/subr_sleepqueue.c > head/sys/sys/fail.h > head/sys/sys/sleepqueue.h This seems to have broken a few kernel configs (just one example); linking kernel.full subr_sleepqueue.o: In function `sleepq_sbuf_print_stacks': /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): undefined reference to `stack_create' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): relocation truncated to fit: R_MIPS_26 against `stack_create' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): undefined reference to `stack_save_td' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): relocation truncated to fit: R_MIPS_26 against `stack_save_td' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): undefined reference to `stack_sbuf_print' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): relocation truncated to fit: R_MIPS_26 against `stack_sbuf_print' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): undefined reference to `stack_destroy' /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): relocation truncated to fit: R_MIPS_26 against `stack_destroy' --- kernel.full --- *** [kernel.full] Error code 1 bmake[5]: stopped in /storage/head/obj/mips.mipsn32/scratch/tmp/bz/head.svn/sys/XLPN32 From owner-svn-src-head@freebsd.org Wed Mar 16 22:12:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 84470AD35BE; Wed, 16 Mar 2016 22:12:23 +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 65BBA662; Wed, 16 Mar 2016 22:12:23 +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 56076B918; Wed, 16 Mar 2016 18:12:22 -0400 (EDT) From: John Baldwin To: Bryan Drewery Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296947 - head/share/man/man9 Date: Wed, 16 Mar 2016 15:12:20 -0700 Message-ID: <1525892.cfDzejblxM@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603161839.u2GIdm5C072960@repo.freebsd.org> References: <201603161839.u2GIdm5C072960@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); Wed, 16 Mar 2016 18:12:22 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:12:23 -0000 On Wednesday, March 16, 2016 06:39:48 PM Bryan Drewery wrote: > Author: bdrewery > Date: Wed Mar 16 18:39:48 2016 > New Revision: 296947 > URL: https://svnweb.freebsd.org/changeset/base/296947 > > Log: > Remove incorrect BUGS entry about asserting lock not held. > > For non-WITNESS< assertion support for SA_UNLOCKED was added in r125421 and > made to panic in r126316. > > MFC after: 1 week Eh, how can this possibly work? That is, suppose I have this code: sx_slock(&foo); sx_assert(&foo, SA_UNLOCKED); How does that safely work without WITNESS? It needs to not panic in the case that some other thread does sx_slock(&foo). In fact, the comment (modulo the spelling nit) says this explicitly: case SA_UNLOCKED: #ifdef WITNESS witness_assert(&sx->lock_object, what, file, line); #else /* * If we hold an exclusve lock fail. We can't * reliably check to see if we hold a shared lock or * not. */ if (sx_xholder(sx) == curthread) panic("Lock %s exclusively locked @ %s:%d\n", sx->lock_object.lo_name, file, line); #endif break; You could perhaps reword the bug to say that SA_UNLOCKED will panic if the lock is exclusively locked in the non-WITNESS case, but will fail to panic if the thread holds a shared lock. The wording in rwlock(9) is better than sx(9) though it should mention that RA_UNLOCKED can detect a write lock. That wording could then be used in sx(9). -- John Baldwin From owner-svn-src-head@freebsd.org Wed Mar 16 22:21:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7DE50AD3736; Wed, 16 Mar 2016 22:21:19 +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 67729989; Wed, 16 Mar 2016 22:21:19 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 61CA612F1; Wed, 16 Mar 2016 22:21:19 +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 1AFBB1F1EE; Wed, 16 Mar 2016 22:21:19 +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 Lg5td4jilMXW; Wed, 16 Mar 2016 22:21:16 +0000 (UTC) Subject: Re: svn commit: r296947 - head/share/man/man9 DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 0AE651F1E8 To: John Baldwin References: <201603161839.u2GIdm5C072960@repo.freebsd.org> <1525892.cfDzejblxM@ralph.baldwin.cx> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: <56E9DC58.7080008@FreeBSD.org> Date: Wed, 16 Mar 2016 15:21:12 -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: <1525892.cfDzejblxM@ralph.baldwin.cx> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="4ap9GI5WPcXhJbCKsbnu7hGXvoHSvCo7P" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:21:19 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4ap9GI5WPcXhJbCKsbnu7hGXvoHSvCo7P Content-Type: multipart/mixed; boundary="ikg1x5joLF8bvA6RSWrtXfcXEOHvM3jHP" From: Bryan Drewery To: John Baldwin Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <56E9DC58.7080008@FreeBSD.org> Subject: Re: svn commit: r296947 - head/share/man/man9 References: <201603161839.u2GIdm5C072960@repo.freebsd.org> <1525892.cfDzejblxM@ralph.baldwin.cx> In-Reply-To: <1525892.cfDzejblxM@ralph.baldwin.cx> --ikg1x5joLF8bvA6RSWrtXfcXEOHvM3jHP Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 3/16/2016 3:12 PM, John Baldwin wrote: > On Wednesday, March 16, 2016 06:39:48 PM Bryan Drewery wrote: >> Author: bdrewery >> Date: Wed Mar 16 18:39:48 2016 >> New Revision: 296947 >> URL: https://svnweb.freebsd.org/changeset/base/296947 >> >> Log: >> Remove incorrect BUGS entry about asserting lock not held. >> =20 >> For non-WITNESS< assertion support for SA_UNLOCKED was added in r125= 421 and >> made to panic in r126316. >> =20 >> MFC after: 1 week > Eh, how can this possibly work? Kib and I discussed it on here already. I have a fix in https://reviews.freebsd.org/D5659 --=20 Regards, Bryan Drewery --ikg1x5joLF8bvA6RSWrtXfcXEOHvM3jHP-- --4ap9GI5WPcXhJbCKsbnu7hGXvoHSvCo7P 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 iQEcBAEBAgAGBQJW6dxYAAoJEDXXcbtuRpfPKWQIALfXXrarFWACzIZ1NHnjWuTn SYI1PfZQ8cU/CzTkq+8017Iyoh9QcbvO6Z+S6EgKCQFfDpBBGEsNdmCp0hRdBLqZ 8/pwNcoBoHjnS/px4wwDRwZQqKfon52QhNTL2g+Nz6tmfx60f+9P7DBH+j19YNf+ vpYxZ7dHj5zQc+3MYG05JrjKeEdgqCxQj47GoA6+K9nWKVu5xddRyLCHMlRtgwxM O0rqHWha5MR/5dUNMPM2MY0W5gp2MC/OdhZH3cU3u1nAujitME+kP82jV9Uz8ERz 1d4fvZ7Vsz32Bi2rQqLBfr6+g9UYrlSL1oqrvcd/TUDKfd5e7JSDUIppbywk/xE= =Dz+A -----END PGP SIGNATURE----- --4ap9GI5WPcXhJbCKsbnu7hGXvoHSvCo7P-- From owner-svn-src-head@freebsd.org Wed Mar 16 22:33:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1B91AD3BAA; Wed, 16 Mar 2016 22:33:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6F1F3685; Wed, 16 Mar 2016 22:33:13 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GMXCZT045951; Wed, 16 Mar 2016 22:33:12 GMT (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GMXCbJ045950; Wed, 16 Mar 2016 22:33:12 GMT (envelope-from glebius@FreeBSD.org) Message-Id: <201603162233.u2GMXCbJ045950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: glebius set sender to glebius@FreeBSD.org using -f From: Gleb Smirnoff Date: Wed, 16 Mar 2016 22:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296956 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:33:13 -0000 Author: glebius Date: Wed Mar 16 22:33:12 2016 New Revision: 296956 URL: https://svnweb.freebsd.org/changeset/base/296956 Log: Due to invalid use of a signed intermediate value in the bounds checking during argument validity verification, unbound zero'ing of the process LDT and adjacent memory can be initiated from usermode. Submitted by: CORE Security Patch by: kib Security: SA-16:15 Modified: head/sys/amd64/amd64/sys_machdep.c Modified: head/sys/amd64/amd64/sys_machdep.c ============================================================================== --- head/sys/amd64/amd64/sys_machdep.c Wed Mar 16 22:31:04 2016 (r296955) +++ head/sys/amd64/amd64/sys_machdep.c Wed Mar 16 22:33:12 2016 (r296956) @@ -580,8 +580,8 @@ amd64_set_ldt(td, uap, descs) struct i386_ldt_args *uap; struct user_segment_descriptor *descs; { - int error = 0, i; - int largest_ld; + int error = 0; + unsigned int largest_ld, i; struct mdproc *mdp = &td->td_proc->p_md; struct proc_ldt *pldt; struct user_segment_descriptor *dp; From owner-svn-src-head@freebsd.org Wed Mar 16 22:37:10 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7CC1AD3D5C; Wed, 16 Mar 2016 22:37:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-ig0-x232.google.com (mail-ig0-x232.google.com [IPv6:2607:f8b0:4001:c05::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 B25ADBC0; Wed, 16 Mar 2016 22:37:10 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: by mail-ig0-x232.google.com with SMTP id nk17so107234901igb.1; Wed, 16 Mar 2016 15:37:10 -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=3A4ls+l3VJHUU6MLE3LgA92qCp+yChjH7DVHblEF0YM=; b=vpQu2EUYu87hr8W443updPyWtdJg8ZYeCt+eF8vcsTMiI/VWczItbayTq3qATbHl7e xbwFV8t8Wq7ZUHAvkmgIXB+UMB/9cDT/ACLR61IYPY9Y2oCUbjyOzFhNWFaKlqAKNfDg XE/hNPsbI044YDeHBJufwIksSKAjVY/1WBhg7RYYeHOpxgUSkMHDZo2DOzNwDDrDoywF n5Fo8MIrqnWnqfnT5W/rvUzlp0E76127FCfmnIHifCdIckf3F5vt9++X23AjX9Vq6yOo VKEwyfRDJp++nS/n8VYQPp0gMNdnt3frSGZSxT3ZVPBkY/Bk6HnOIH5Wh8dds+MkT2AJ ivMw== 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=3A4ls+l3VJHUU6MLE3LgA92qCp+yChjH7DVHblEF0YM=; b=lxDCoPLn0L+aRrVgdoYL8OSUXTGAprjTj2DXQ0+iEZr3JSHiqtJ3ObMg/+yxXAFJde yfKzEuFBXYN/Kf3lOtEq2HFJ1Lh3a4916xcWMuhMqTzWx6s9l9H4BtQyP9nX3US+0+rs 92iGQ95jVp52YpIBY0Z86ThdSBg8zOsc1V6TBwN4U+QVcKjx1v16O+oQqi1xtda+NrxA 7BFzjNVOhSdpU7jBjrm4MIuwLvYEp9/Gy8Zuq0vvs1nfEUgFn5wvD3pdp9nOiLUa3aXe OcL9YamkY4SkfDUlL7YC/tMwauG3wrrztPGSX/kEXXZFOpXoMOlOi7v3aAheQzUXUriO ikQA== X-Gm-Message-State: AD7BkJKtejakTF4c8jzmgb+a241dbFqOm16VQZhLRDXtY4evbYW8yOhHyuLv9Z3RYPa4m3HYgnFLrGowrWsurQ== MIME-Version: 1.0 X-Received: by 10.50.157.39 with SMTP id wj7mr31874042igb.61.1458167830046; Wed, 16 Mar 2016 15:37:10 -0700 (PDT) Received: by 10.36.14.19 with HTTP; Wed, 16 Mar 2016 15:37:09 -0700 (PDT) In-Reply-To: <5463538.GTDDlnsCR6@ralph.baldwin.cx> References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <2420759.o4YiE5Za4X@ralph.baldwin.cx> <20160316202738.GL1328@FreeBSD.org> <5463538.GTDDlnsCR6@ralph.baldwin.cx> Date: Wed, 16 Mar 2016 15:37:09 -0700 Message-ID: Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib From: Adrian Chadd To: John Baldwin Cc: Gleb Smirnoff , Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:37:11 -0000 I've fought this problem in USB drivers. Ideally you'd also have the detach path /also/ take said lock and drain anyone currently doing anything active (tx, rx, ioctls, net80211 methods, etc) to completion before continuing. A lot of drivers don't do this very well, or at all. -adrian From owner-svn-src-head@freebsd.org Wed Mar 16 22:40:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 910AAAD3E08; Wed, 16 Mar 2016 22:40:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x233.google.com (mail-ob0-x233.google.com [IPv6:2607:f8b0:4003:c01::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 550F8D87; Wed, 16 Mar 2016 22:40:42 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x233.google.com with SMTP id fz5so66381844obc.0; Wed, 16 Mar 2016 15:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=5NirBD2e7BdV+WMcw5Edm8nEmfGKjqWsnFTx28UqlzY=; b=eIeHQJqmvwTBKrCZbJjiDJs2QPUxpzaLkyvP2z2vDcOtdnN1QWRg/Zml5P3PuR7U/l RqLCP89aeozJX66+IeElyBVZKqsmIredlMCOpH2LOfyrB2kVdmY41Vz4tcwjKC6heG4l f9n+eFAwnBRY84VE5CFpTXDUFlw53OmLwssnx7duqzFAelXZNxeyCsO34VA2JBCPs1DV ac1G0bxYgN5gRAZDdURVbQk4t1LpMl12L+h+/eoblLCHhs6RcaFOJSKXZeZMTW3hsvtO 9pWSVsCNRX+vg4l4Rluu19rWzxG8dKLBI+pRnm7S1W5jkLt6bv/Ki9cFL2ABdddHyhv2 2V/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=5NirBD2e7BdV+WMcw5Edm8nEmfGKjqWsnFTx28UqlzY=; b=jp+gyoil37cgEkh4k1+F59mdYT+zqb1G5tIW3Gd00j7qVyetjGb+z3oxfR9ECObATS Mx5aOmv43RE9GxLobUFLsutvzb/Syfr5OCr06w9SN6AGX/H3Y5j80gmynbyAzgmSm3lK WNk1JzfO2MytaxHSaA+AMTsphzTleUZgJGfYAlvOK97sShic4qFstkWh5CkvgqAxCWS5 td2HVbUsujtLtMkZlrvQx/aZRcKa5j9ga4E7xnVZniMf636JjmE1B4v+NHQkXZcCpDyG ttFuEIg4J40VDwsBXs+yNUstERzbCMIYTWSTyTdW+0gsBwapWIoJyWh1UY2gp6vEj0c2 kyyg== X-Gm-Message-State: AD7BkJIU8xYiF8lOx3iZSY6kZb62RHYPWCyFEWcExTtUfqKGWEpiccZEB/sn0LSqT7L9Q29FEwxoNo6eTPeTrg== MIME-Version: 1.0 X-Received: by 10.182.104.138 with SMTP id ge10mr871553obb.81.1458168041619; Wed, 16 Mar 2016 15:40:41 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Wed, 16 Mar 2016 15:40:41 -0700 (PDT) In-Reply-To: <201509040014.t840ELno034811@repo.freebsd.org> References: <201509040014.t840ELno034811@repo.freebsd.org> Date: Wed, 16 Mar 2016 16:40:41 -0600 X-Google-Sender-Auth: nTOO6UXT143UAi8BJIni3WID3uc Message-ID: Subject: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools From: Alan Somers To: Xin LI 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:40:42 -0000 On Thu, Sep 3, 2015 at 6:14 PM, Xin LI wrote: > Author: delphij > Date: Fri Sep 4 00:14:20 2015 > New Revision: 287445 > URL: https://svnweb.freebsd.org/changeset/base/287445 > > Log: > Expose an interface to determine if an ACE is inherited. > > Submitted by: sef > Reviewed by: trasz > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D3540 > > Modified: > head/bin/setfacl/setfacl.1 > head/lib/libc/posix1e/acl_add_flag_np.3 > head/lib/libc/posix1e/acl_support_nfs4.c > head/share/man/man9/acl.9 > head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c > head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h > head/sys/kern/subr_acl_nfs4.c > head/sys/sys/acl.h > head/tools/regression/acltools/tools-crossfs.test > head/tools/regression/acltools/tools-nfs4-psarc.test > head/tools/regression/acltools/tools-nfs4-trivial.test > head/tools/regression/acltools/tools-nfs4.test > ... > Modified: head/sys/sys/acl.h > > ============================================================================== > --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) > +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) > @@ -249,11 +249,12 @@ typedef void *acl_t; > #define ACL_ENTRY_INHERIT_ONLY 0x0008 > #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 > #define ACL_ENTRY_FAILED_ACCESS 0x0020 > +#define ACL_ENTRY_INHERITED 0x0080 > > #define ACL_FLAGS_BITS (ACL_ENTRY_FILE_INHERIT | \ > ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | \ > ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ > - ACL_ENTRY_FAILED_ACCESS) > + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) > > /* > * Undefined value in ae_id field. ae_id should be set to this value > Out of curiosity, why did you choose 0x0080 for ACL_ENTRY_INHERITED instead of 0x0040 ? From owner-svn-src-head@freebsd.org Wed Mar 16 22:56:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6AFDAD240B; Wed, 16 Mar 2016 22:56:47 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.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 704059AC; Wed, 16 Mar 2016 22:56:46 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f170.google.com with SMTP id h129so80223048ywb.1; Wed, 16 Mar 2016 15:56:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=s1Jkula7ejgrvSpOebu5T7fXXPGk3csfEXljODUOBmg=; b=egM8sxennmXy6pCzwg9SWmXh/JRFsGW9sWM1s4Dmx9etl9AvUK2QOcf+8hQIJ9JcHf c/7pGHk2GNcGERnyxxaTgr5I9CkeSrGUvZ0l1ixe+FN+YUCzoqZc/prYSMPTZ5v4bIEU rvbPMCOQfUvw+FjeOr6fje8mzpqhFz5dSwYNtjEAv8CO1EWUdW+pj+fg0Eo3BePij29v JFx5p691e3Hb+Nt1ZH/12jamRvGLPH9CBUlMheG1bt2UpR1nbbokjAUl+smRRQKqGsBH CAj9+8BAXuOi8/Xd1oMeJcf/W3fADSse4VTeeKLRxEuYsMi/STPzQlAd85fdpG3LO/CJ 5PXQ== X-Gm-Message-State: AD7BkJJ6cwtij2DjPXfQETaVlwm7UBiySplTvJP/ADXYzhCVEyQIdilwh/d8AjJb9jbcTw== X-Received: by 10.37.109.198 with SMTP id i189mr2757684ybc.171.1458168999712; Wed, 16 Mar 2016 15:56:39 -0700 (PDT) Received: from mail-yw0-f180.google.com (mail-yw0-f180.google.com. [209.85.161.180]) by smtp.gmail.com with ESMTPSA id w127sm3320025ywd.13.2016.03.16.15.56.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 15:56:39 -0700 (PDT) Received: by mail-yw0-f180.google.com with SMTP id g3so80230708ywa.3; Wed, 16 Mar 2016 15:56:38 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.13.217.77 with SMTP id b74mr2790907ywe.73.1458168998737; Wed, 16 Mar 2016 15:56:38 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.115.134 with HTTP; Wed, 16 Mar 2016 15:56:38 -0700 (PDT) In-Reply-To: References: <201603160422.u2G4MWg1012528@repo.freebsd.org> Date: Wed, 16 Mar 2016 15:56:38 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r296927 - in head: share/man/man9 sys/kern sys/sys From: Conrad Meyer To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 22:56:47 -0000 Sorry. I guess that whole routine needs to be wrapped in #if defined(STACK). I'll work to put together a patch soon. Thanks, Conrad On Wed, Mar 16, 2016 at 3:02 PM, Bjoern A. Zeeb wrote: > On Wed, 16 Mar 2016, Conrad E. Meyer wrote: > >> Author: cem >> Date: Wed Mar 16 04:22:32 2016 >> New Revision: 296927 >> URL: https://svnweb.freebsd.org/changeset/base/296927 >> >> Log: >> fail(9): Upstreaming some fail point enhancements >> >> This is several year's worth of fail point upgrades done at EMC Isilon. >> They >> are interdependent enough that it makes sense to put a single diff up for >> them. >> Primarily, we added: >> >> - Changing all mainline execution paths to be lockless, which lets us use >> fail >> points in more sleep-sensitive areas, and allows more parallel >> execution >> - A number of additional commands, including 'pause' that lets us do some >> interesting deterministic repros of race conditions >> - The ability to dump the stacks of all threads sleeping on a fail point >> - A number of other API changes to allow marking up the fail point's >> context in >> the code, and firing callbacks before and after execution >> - A man page update >> >> Submitted by: Matthew Bryan >> Reviewed by: cem (earlier version), jhb, kib, pho >> With feedback from: bdrewery >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D5427 >> >> Modified: >> head/share/man/man9/fail.9 >> head/sys/kern/kern_fail.c >> head/sys/kern/subr_sleepqueue.c >> head/sys/sys/fail.h >> head/sys/sys/sleepqueue.h > > > This seems to have broken a few kernel configs (just one example); > > linking kernel.full > subr_sleepqueue.o: In function `sleepq_sbuf_print_stacks': > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): undefined > reference to `stack_create' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): > relocation truncated to fit: R_MIPS_26 against `stack_create' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): undefined > reference to `stack_save_td' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): > relocation truncated to fit: R_MIPS_26 against `stack_save_td' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): undefined > reference to `stack_sbuf_print' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): > relocation truncated to fit: R_MIPS_26 against `stack_sbuf_print' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): undefined > reference to `stack_destroy' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): > relocation truncated to fit: R_MIPS_26 against `stack_destroy' > --- kernel.full --- > *** [kernel.full] Error code 1 > > bmake[5]: stopped in > /storage/head/obj/mips.mipsn32/scratch/tmp/bz/head.svn/sys/XLPN32 From owner-svn-src-head@freebsd.org Wed Mar 16 23:12:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 903B2AD2BA3; Wed, 16 Mar 2016 23:12:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2703198C; Wed, 16 Mar 2016 23:12:22 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GNCLuW058317; Wed, 16 Mar 2016 23:12:21 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GNCJdO058299; Wed, 16 Mar 2016 23:12:19 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201603162312.u2GNCJdO058299@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Wed, 16 Mar 2016 23:12:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296963 - in head/sys/boot: . common geli i386/common i386/gptboot i386/gptzfsboot i386/libi386 i386/loader i386/zfsboot zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 23:12:22 -0000 Author: allanjude Date: Wed Mar 16 23:12:19 2016 New Revision: 296963 URL: https://svnweb.freebsd.org/changeset/base/296963 Log: Implement GELI (AES-XTS and AES-CBC only) in gptboot and gptzfsboot Allows booting from a GELI encrypted root file system, via UFS or ZFS Reviewed by: gnn, smh (previous version), delphij (previous version) Relnotes: yes Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D4593 Added: head/sys/boot/geli/ head/sys/boot/geli/Makefile (contents, props changed) head/sys/boot/geli/geliboot.c (contents, props changed) head/sys/boot/geli/geliboot.h (contents, props changed) head/sys/boot/geli/geliboot_crypto.c (contents, props changed) head/sys/boot/geli/pwgets.c (contents, props changed) - copied, changed from r292837, head/lib/libstand/gets.c Modified: head/sys/boot/Makefile.amd64 head/sys/boot/Makefile.i386 head/sys/boot/common/disk.c head/sys/boot/common/disk.h head/sys/boot/common/gpt.c head/sys/boot/common/gpt.h head/sys/boot/i386/common/bootargs.h head/sys/boot/i386/common/cons.c head/sys/boot/i386/common/drv.c head/sys/boot/i386/common/drv.h head/sys/boot/i386/gptboot/Makefile head/sys/boot/i386/gptboot/gptboot.c head/sys/boot/i386/gptzfsboot/Makefile head/sys/boot/i386/libi386/Makefile head/sys/boot/i386/libi386/biosdisk.c head/sys/boot/i386/loader/Makefile head/sys/boot/i386/loader/main.c head/sys/boot/i386/zfsboot/zfsboot.c head/sys/boot/zfs/libzfs.h Modified: head/sys/boot/Makefile.amd64 ============================================================================== --- head/sys/boot/Makefile.amd64 Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/Makefile.amd64 Wed Mar 16 23:12:19 2016 (r296963) @@ -3,6 +3,7 @@ SUBDIR+= efi SUBDIR+= libstand32 SUBDIR+= zfs +SUBDIR+= geli SUBDIR+= userboot .if ${MK_FORTH} != "no" Modified: head/sys/boot/Makefile.i386 ============================================================================== --- head/sys/boot/Makefile.i386 Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/Makefile.i386 Wed Mar 16 23:12:19 2016 (r296963) @@ -3,3 +3,4 @@ SUBDIR+= efi SUBDIR+= libstand32 SUBDIR+= zfs +SUBDIR+= geli Modified: head/sys/boot/common/disk.c ============================================================================== --- head/sys/boot/common/disk.c Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/common/disk.c Wed Mar 16 23:12:19 2016 (r296963) @@ -170,7 +170,7 @@ display_size(uint64_t size, u_int sector return (buf); } -static int +int ptblread(void *d, void *buf, size_t blocks, off_t offset) { struct disk_devdesc *dev; Modified: head/sys/boot/common/disk.h ============================================================================== --- head/sys/boot/common/disk.h Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/common/disk.h Wed Mar 16 23:12:19 2016 (r296963) @@ -107,6 +107,7 @@ extern int disk_read(struct disk_devdesc u_int blocks); extern int disk_write(struct disk_devdesc *dev, void *buf, off_t offset, u_int blocks); +extern int ptblread(void *d, void *buf, size_t blocks, off_t offset); /* * Print information about slices on a disk. Modified: head/sys/boot/common/gpt.c ============================================================================== --- head/sys/boot/common/gpt.c Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/common/gpt.c Wed Mar 16 23:12:19 2016 (r296963) @@ -39,8 +39,6 @@ __FBSDID("$FreeBSD$"); #include "util.h" #include "gpt.h" -#define MAXTBLENTS 128 - static struct gpt_hdr hdr_primary, hdr_backup, *gpthdr; static uint64_t hdr_primary_lba, hdr_backup_lba; static struct gpt_ent table_primary[MAXTBLENTS], table_backup[MAXTBLENTS]; Modified: head/sys/boot/common/gpt.h ============================================================================== --- head/sys/boot/common/gpt.h Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/common/gpt.h Wed Mar 16 23:12:19 2016 (r296963) @@ -32,6 +32,8 @@ #include #include +#define MAXTBLENTS 128 + int gptread(const uuid_t *uuid, struct dsk *dskp, char *buf); int gptfind(const uuid_t *uuid, struct dsk *dskp, int part); void gptbootfailed(struct dsk *dskp); Added: head/sys/boot/geli/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/Makefile Wed Mar 16 23:12:19 2016 (r296963) @@ -0,0 +1,52 @@ +# $FreeBSD$ +# libgeliboot + +MAN= + +.include +MK_SSP= no + +LIB= geliboot +INTERNALLIB= +MK_PROFILE= no +NO_PIC= + +.if ${MACHINE_CPUARCH} == "i386" || ${MACHINE_CPUARCH} == "amd64" +CFLAGS+= -march=i386 +.endif +.if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "powerpc64" +CFLAGS+= -m32 +.endif + +WARNS?= 0 + +# string functions from libc +.PATH: ${.CURDIR}/../../../lib/libc/string +SRCS+= bcmp.c bcopy.c bzero.c + +# Our password input method +SRCS+= pwgets.c + +# sha256 and sha512 from sys/crypto +.PATH: ${.CURDIR}/../../crypto/sha2 +CFLAGS+= -DWEAK_REFS +SRCS+= sha256c.c sha512c.c + +# md5 from libmd +.PATH: ${.CURDIR}/../../../lib/libmd +SRCS+= md5c.c + +# AES implementation from sys/crypto +.PATH: ${.CURDIR}/../../crypto/rijndael +CFLAGS+= -I${.CURDIR}/../../ +# Remove asserts +CFLAGS+= -DNDEBUG +SRCS+= rijndael-alg-fst.c rijndael-api-fst.c rijndael-api.c + +# local GELI Implementation +.PATH: ${.CURDIR}/../../geom/eli +CFLAGS+= -D_STAND +SRCS+= geliboot_crypto.c g_eli_hmac.c g_eli_key.c g_eli_key_cache.c pkcs5v2.c + +.include +.include Added: head/sys/boot/geli/geliboot.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/geliboot.c Wed Mar 16 23:12:19 2016 (r296963) @@ -0,0 +1,284 @@ +/*- + * Copyright (c) 2015 Allan Jude + * Copyright (c) 2005-2011 Pawel Jakub Dawidek + * 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$ + */ + +#include "geliboot.h" + +SLIST_HEAD(geli_list, geli_entry) geli_head = SLIST_HEAD_INITIALIZER(geli_head); +struct geli_list *geli_headp; + +static int +geli_same_device(struct geli_entry *ge, struct dsk *dskp) +{ + + if (geli_e->dsk->drive == dskp->drive && + dskp->part == 255 && geli_e->dsk->part == dskp->slice) { + /* + * Sometimes slice = slice, and sometimes part = slice + * If the incoming struct dsk has part=255, it means look at + * the slice instead of the part number + */ + return (0); + } + + /* Is this the same device? */ + if (geli_e->dsk->drive != dskp->drive || + geli_e->dsk->slice != dskp->slice || + geli_e->dsk->part != dskp->part) { + return (1); + } + + return (0); +} + +void +geli_init(void) +{ + + geli_count = 0; + SLIST_INIT(&geli_head); +} + +/* + * Read the last sector of the drive or partition pointed to by dsk and see + * if it is GELI encrypted + */ +int +geli_taste(int read_func(void *vdev, void *priv, off_t off, void *buf, + size_t bytes), struct dsk *dskp, daddr_t lastsector) +{ + struct g_eli_metadata md; + u_char buf[DEV_BSIZE]; + int error; + + error = read_func(NULL, dskp, (off_t) lastsector * DEV_BSIZE, &buf, + (size_t) DEV_BSIZE); + if (error != 0) { + return (error); + } + error = eli_metadata_decode(buf, &md); + if (error != 0) { + return (error); + } + + if ((md.md_flags & G_ELI_FLAG_ONETIME)) { + /* Swap device, skip it */ + return (1); + } + if (!(md.md_flags & G_ELI_FLAG_BOOT)) { + /* Disk is not GELI boot device, skip it */ + return (1); + } + geli_e = malloc(sizeof(struct geli_entry)); + if (geli_e == NULL) + return (2); + + geli_e->dsk = malloc(sizeof(struct dsk)); + if (geli_e->dsk == NULL) + return (2); + memcpy(geli_e->dsk, dskp, sizeof(struct dsk)); + geli_e->part_end = lastsector; + if (dskp->part == 255) { + geli_e->dsk->part = dskp->slice; + } + + geli_e->md = md; + eli_metadata_softc(&geli_e->sc, &md, DEV_BSIZE, + (lastsector + DEV_BSIZE) * DEV_BSIZE); + + SLIST_INSERT_HEAD(&geli_head, geli_e, entries); + geli_count++; + + return (0); +} + +/* + * Attempt to decrypt the device + */ +int +geli_attach(struct dsk *dskp, const char *passphrase) +{ + u_char key[G_ELI_USERKEYLEN], mkey[G_ELI_DATAIVKEYLEN], *mkp; + u_int keynum; + struct hmac_ctx ctx; + int error; + + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + g_eli_crypto_hmac_init(&ctx, NULL, 0); + /* + * Prepare Derived-Key from the user passphrase. + */ + if (geli_e->md.md_iterations == 0) { + g_eli_crypto_hmac_update(&ctx, geli_e->md.md_salt, + sizeof(geli_e->md.md_salt)); + g_eli_crypto_hmac_update(&ctx, passphrase, + strlen(passphrase)); + } else if (geli_e->md.md_iterations > 0) { + printf("Calculating GELI Decryption Key disk%dp%d @ %lu " + "iterations...\n", dskp->unit, + (dskp->slice > 0 ? dskp->slice : dskp->part), + geli_e->md.md_iterations); + u_char dkey[G_ELI_USERKEYLEN]; + + pkcs5v2_genkey(dkey, sizeof(dkey), geli_e->md.md_salt, + sizeof(geli_e->md.md_salt), passphrase, + geli_e->md.md_iterations); + g_eli_crypto_hmac_update(&ctx, dkey, sizeof(dkey)); + bzero(&dkey, sizeof(dkey)); + } + + g_eli_crypto_hmac_final(&ctx, key, 0); + + error = g_eli_mkey_decrypt(&geli_e->md, key, mkey, &keynum); + bzero(&key, sizeof(key)); + if (error == -1) { + bzero(&mkey, sizeof(mkey)); + printf("Bad GELI key: %d\n", error); + return (error); + } else if (error != 0) { + bzero(&mkey, sizeof(mkey)); + printf("Failed to decrypt GELI master key: %d\n", error); + return (error); + } + + /* Store the keys */ + bcopy(mkey, geli_e->sc.sc_mkey, sizeof(geli_e->sc.sc_mkey)); + bcopy(mkey, geli_e->sc.sc_ivkey, sizeof(geli_e->sc.sc_ivkey)); + mkp = mkey + sizeof(geli_e->sc.sc_ivkey); + if ((geli_e->sc.sc_flags & G_ELI_FLAG_AUTH) == 0) { + bcopy(mkp, geli_e->sc.sc_ekey, G_ELI_DATAKEYLEN); + } else { + /* + * The encryption key is: ekey = HMAC_SHA512(Data-Key, 0x10) + */ + g_eli_crypto_hmac(mkp, G_ELI_MAXKEYLEN, "\x10", 1, + geli_e->sc.sc_ekey, 0); + } + bzero(&mkey, sizeof(mkey)); + + /* Initialize the per-sector IV */ + switch (geli_e->sc.sc_ealgo) { + case CRYPTO_AES_XTS: + break; + default: + SHA256_Init(&geli_e->sc.sc_ivctx); + SHA256_Update(&geli_e->sc.sc_ivctx, geli_e->sc.sc_ivkey, + sizeof(geli_e->sc.sc_ivkey)); + break; + } + + return (0); + } + + /* Disk not found */ + return (2); +} + +int +is_geli(struct dsk *dskp) +{ + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) == 0) { + return (0); + } + } + + return (1); +} + +int +geli_read(struct dsk *dskp, off_t offset, u_char *buf, size_t bytes) +{ + u_char iv[G_ELI_IVKEYLEN]; + u_char *pbuf; + int error; + off_t os; + uint64_t keyno; + size_t n, nb; + struct g_eli_key gkey; + + SLIST_FOREACH_SAFE(geli_e, &geli_head, entries, geli_e_tmp) { + if (geli_same_device(geli_e, dskp) != 0) { + continue; + } + + nb = bytes / DEV_BSIZE; + for (n = 0; n < nb; n++) { + os = offset + (n * DEV_BSIZE); + pbuf = buf + (n * DEV_BSIZE); + + g_eli_crypto_ivgen(&geli_e->sc, os, iv, G_ELI_IVKEYLEN); + + /* Get the key that corresponds to this offset */ + keyno = (os >> G_ELI_KEY_SHIFT) / DEV_BSIZE; + g_eli_key_fill(&geli_e->sc, &gkey, keyno); + + error = geliboot_crypt(geli_e->sc.sc_ealgo, 0, pbuf, + DEV_BSIZE, gkey.gek_key, geli_e->sc.sc_ekeylen, iv); + + if (error != 0) { + bzero(&gkey, sizeof(gkey)); + printf("Failed to decrypt in geli_read()!"); + return (error); + } + } + bzero(&gkey, sizeof(gkey)); + return (0); + } + + printf("GELI provider not found\n"); + return (1); +} + +int +geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp) +{ + int i; + + /* TODO: Implement GELI keyfile(s) support */ + for (i = 0; i < 3; i++) { + /* Try cached passphrase */ + if (i == 0 && pw[0] != '\0') { + if (geli_attach(dskp, pw) == 0) { + return (0); + } + } + printf("GELI Passphrase for disk%d%c%d: ", disk, parttype, part); + pwgets(pw, GELI_PW_MAXLEN); + printf("\n"); + if (geli_attach(dskp, pw) == 0) { + return (0); + } + } + + return (1); +} Added: head/sys/boot/geli/geliboot.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/geliboot.h Wed Mar 16 23:12:19 2016 (r296963) @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2015 Allan Jude + * Copyright (c) 2005-2011 Pawel Jakub Dawidek + * 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$ + */ + +#include +#include + +#ifndef _GELIBOOT_H_ +#define _GELIBOOT_H_ + +#define _STRING_H_ +#define _STRINGS_H_ +#define _STDIO_H_ +#include +#include + +/* Pull in the md5, sha256, and sha512 implementations */ +#include +#include +#include + +/* Pull in AES implementation */ +#include + +/* AES-XTS implementation */ +#define _STAND +#define STAND_H /* We don't want stand.h in {gpt,zfs,gptzfs}boot */ +#include + +#ifndef DEV_BSIZE +#define DEV_BSIZE 512 +#endif + +#ifndef MIN +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#define GELI_PW_MAXLEN 256 +extern void pwgets(char *buf, int n); + +struct geli_entry { + struct dsk *dsk; + off_t part_end; + struct g_eli_softc sc; + struct g_eli_metadata md; + SLIST_ENTRY(geli_entry) entries; +} *geli_e, *geli_e_tmp; + +int geli_count; + +void geli_init(void); +int geli_taste(int read_func(void *vdev, void *priv, off_t off, + void *buf, size_t bytes), struct dsk *dsk, daddr_t lastsector); +int geli_attach(struct dsk *dskp, const char *passphrase); +int is_geli(struct dsk *dsk); +int geli_read(struct dsk *dsk, off_t offset, u_char *buf, size_t bytes); +int geli_decrypt(u_int algo, u_char *data, size_t datasize, + const u_char *key, size_t keysize, const uint8_t* iv); +int geli_passphrase(char *pw, int disk, int parttype, int part, struct dsk *dskp); + +#endif /* _GELIBOOT_H_ */ Added: head/sys/boot/geli/geliboot_crypto.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/boot/geli/geliboot_crypto.c Wed Mar 16 23:12:19 2016 (r296963) @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2005-2010 Pawel Jakub Dawidek + * Copyright (c) 2015 Allan Jude + * 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$ + */ + +#include "geliboot.h" + +int +geliboot_crypt(u_int algo, int enc, u_char *data, size_t datasize, + const u_char *key, size_t keysize, u_char *iv) +{ + keyInstance aeskey; + cipherInstance cipher; + struct aes_xts_ctx xtsctx, *ctxp; + size_t xts_len; + int err, blks, i; + + switch (algo) { + case CRYPTO_AES_CBC: + err = rijndael_makeKey(&aeskey, !enc, keysize, + (const char *)key); + if (err < 0) { + printf("Failed to setup decryption keys: %d\n", err); + return (err); + } + + err = rijndael_cipherInit(&cipher, MODE_CBC, iv); + if (err < 0) { + printf("Failed to setup IV: %d\n", err); + return (err); + } + + switch (enc) { + case 0: /* decrypt */ + blks = rijndael_blockDecrypt(&cipher, &aeskey, data, + datasize * 8, data); + break; + case 1: /* encrypt */ + blks = rijndael_blockEncrypt(&cipher, &aeskey, data, + datasize * 8, data); + break; + } + if (datasize != (blks / 8)) { + printf("Failed to decrypt the entire input: " + "%u != %u\n", blks, datasize); + return (1); + } + break; + case CRYPTO_AES_XTS: + xts_len = keysize << 1; + ctxp = &xtsctx; + + rijndael_set_key(&ctxp->key1, key, xts_len / 2); + rijndael_set_key(&ctxp->key2, key + (xts_len / 16), xts_len / 2); + + enc_xform_aes_xts.reinit(ctxp, iv); + + switch (enc) { + case 0: /* decrypt */ + for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { + enc_xform_aes_xts.decrypt(ctxp, data + i); + } + break; + case 1: /* encrypt */ + for (i = 0; i < datasize; i += AES_XTS_BLOCKSIZE) { + enc_xform_aes_xts.encrypt(ctxp, data + i); + } + break; + } + break; + default: + printf("Unsupported crypto algorithm #%d\n", algo); + return (1); + } + + return (0); +} + +static int +g_eli_crypto_cipher(u_int algo, int enc, u_char *data, size_t datasize, + const u_char *key, size_t keysize) +{ + u_char iv[keysize]; + + bzero(iv, sizeof(iv)); + return (geliboot_crypt(algo, enc, data, datasize, key, keysize, iv)); +} + +int +g_eli_crypto_encrypt(u_int algo, u_char *data, size_t datasize, + const u_char *key, size_t keysize) +{ + + /* We prefer AES-CBC for metadata protection. */ + if (algo == CRYPTO_AES_XTS) + algo = CRYPTO_AES_CBC; + + return (g_eli_crypto_cipher(algo, 1, data, datasize, key, keysize)); +} + +int +g_eli_crypto_decrypt(u_int algo, u_char *data, size_t datasize, + const u_char *key, size_t keysize) +{ + + /* We prefer AES-CBC for metadata protection. */ + if (algo == CRYPTO_AES_XTS) + algo = CRYPTO_AES_CBC; + + return (g_eli_crypto_cipher(algo, 0, data, datasize, key, keysize)); +} Copied and modified: head/sys/boot/geli/pwgets.c (from r292837, head/lib/libstand/gets.c) ============================================================================== --- head/lib/libstand/gets.c Mon Dec 28 18:36:00 2015 (r292837, copy source) +++ head/sys/boot/geli/pwgets.c Wed Mar 16 23:12:19 2016 (r296963) @@ -36,10 +36,10 @@ __FBSDID("$FreeBSD$"); #include "stand.h" -/* gets() with constrained input length */ +/* gets() with constrained input length, for passwords */ void -ngets(char *buf, int n) +pwgets(char *buf, int n) { int c; char *lp; @@ -76,37 +76,8 @@ ngets(char *buf, int n) default: if ((n < 1) || ((lp - buf) < n - 1)) { *lp++ = c; - putchar(c); + putchar('*'); } } /*NOTREACHED*/ } - -int -fgetstr(char *buf, int size, int fd) -{ - char c; - int err, len; - - size--; /* leave space for terminator */ - len = 0; - while (size != 0) { - err = read(fd, &c, sizeof(c)); - if (err < 0) /* read error */ - return(-1); - if (err == 0) { /* EOF */ - if (len == 0) - return(-1); /* nothing to read */ - break; - } - if ((c == '\r') || /* line terminators */ - (c == '\n')) - break; - *buf++ = c; /* keep char */ - size--; - len++; - } - *buf = 0; - return(len); -} - Modified: head/sys/boot/i386/common/bootargs.h ============================================================================== --- head/sys/boot/i386/common/bootargs.h Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/common/bootargs.h Wed Mar 16 23:12:19 2016 (r296963) @@ -64,6 +64,12 @@ struct bootargs */ }; +struct geli_boot_args +{ + uint32_t size; + char gelipw[256]; +}; + #endif /*__ASSEMBLER__*/ #endif /* !_BOOT_I386_ARGS_H_ */ Modified: head/sys/boot/i386/common/cons.c ============================================================================== --- head/sys/boot/i386/common/cons.c Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/common/cons.c Wed Mar 16 23:12:19 2016 (r296963) @@ -97,6 +97,13 @@ xgetc(int fn) } int +getchar(void) +{ + + return (xgetc(0)); +} + +int keyhit(unsigned int secs) { uint32_t t0, t1; Modified: head/sys/boot/i386/common/drv.c ============================================================================== --- head/sys/boot/i386/common/drv.c Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/common/drv.c Wed Mar 16 23:12:19 2016 (r296963) @@ -29,7 +29,6 @@ __FBSDID("$FreeBSD$"); #include "xreadorg.h" #endif -#ifdef GPT static struct edd_params params; uint64_t @@ -50,7 +49,6 @@ drvsize(struct dsk *dskp) } return (params.sectors); } -#endif /* GPT */ #ifndef USE_XREAD static struct edd_packet packet; Modified: head/sys/boot/i386/common/drv.h ============================================================================== --- head/sys/boot/i386/common/drv.h Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/common/drv.h Wed Mar 16 23:12:19 2016 (r296963) @@ -42,7 +42,7 @@ struct dsk { int drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); #ifdef GPT int drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk); -uint64_t drvsize(struct dsk *dskp); #endif /* GPT */ +uint64_t drvsize(struct dsk *dskp); #endif /* !_DRV_H_ */ Modified: head/sys/boot/i386/gptboot/Makefile ============================================================================== --- head/sys/boot/i386/gptboot/Makefile Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/gptboot/Makefile Wed Mar 16 23:12:19 2016 (r296963) @@ -39,6 +39,14 @@ CFLAGS= -DBOOTPROG=\"gptboot\" \ CFLAGS.gcc+= --param max-inline-insns-single=100 +.if !defined(LOADER_NO_GELI_SUPPORT) +CFLAGS+= -DLOADER_GELI_SUPPORT +CFLAGS+= -I${.CURDIR}/../../geli +LIBGELIBOOT= ${.OBJDIR}/../../geli/libgeliboot.a +.PATH: ${.CURDIR}/../../../opencrypto +OPENCRYPTO_XTS= xform_aes_xts.o +.endif + LD_FLAGS=-static -N --gc-sections LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a @@ -60,14 +68,14 @@ gptldr.bin: gptldr.out gptldr.out: gptldr.o ${LD} ${LD_FLAGS} -e start -Ttext ${ORG1} -o ${.TARGET} gptldr.o -CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o gpt.o crc32.o drv.o \ - cons.o util.o +CLEANFILES+= gptboot.bin gptboot.out gptboot.o sio.o crc32.o drv.o \ + cons.o util.o ${OPENCRYPTO_XTS} gptboot.bin: gptboot.out ${OBJCOPY} -S -O binary gptboot.out ${.TARGET} -gptboot.out: ${BTXCRT} gptboot.o sio.o gpt.o crc32.o drv.o cons.o util.o - ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} +gptboot.out: ${BTXCRT} gptboot.o sio.o crc32.o drv.o cons.o util.o ${OPENCRYPTO_XTS} + ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} ${LIBSTAND} ${LIBGELIBOOT} gptboot.o: ${.CURDIR}/../../common/ufsread.c Modified: head/sys/boot/i386/gptboot/gptboot.c ============================================================================== --- head/sys/boot/i386/gptboot/gptboot.c Wed Mar 16 23:06:34 2016 (r296962) +++ head/sys/boot/i386/gptboot/gptboot.c Wed Mar 16 23:12:19 2016 (r296963) @@ -23,6 +23,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -31,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include "bootargs.h" #include "lib.h" #include "rbx.h" #include "drv.h" @@ -82,14 +84,60 @@ static struct dsk dsk; static char kname[1024]; static int comspeed = SIOSPD; static struct bootinfo bootinfo; +static struct geli_boot_args geliargs; + +static vm_offset_t high_heap_base; +static uint32_t bios_basemem, bios_extmem, high_heap_size; + +static struct bios_smap smap; + +/* + * The minimum amount of memory to reserve in bios_extmem for the heap. + */ +#define HEAP_MIN (3 * 1024 * 1024) + +static char *heap_next; +static char *heap_end; void exit(int); static void load(void); static int parse(char *, int *); static int dskread(void *, daddr_t, unsigned); -static uint32_t memsize(void); +void *malloc(size_t n); +void free(void *ptr); +#ifdef LOADER_GELI_SUPPORT +static int vdev_read(void *vdev __unused, void *priv, off_t off, void *buf, + size_t bytes); +#endif + +void * +malloc(size_t n) +{ + char *p = heap_next; + if (p + n > heap_end) { + printf("malloc failure\n"); + for (;;) + ; + /* NOTREACHED */ + return (0); + } + heap_next += n; + return (p); +} + +void +free(void *ptr) +{ + + return; +} #include "ufsread.c" +#include "gpt.c" +#ifdef LOADER_GELI_SUPPORT +#include "geliboot.c" +static char gelipw[GELI_PW_MAXLEN]; +#endif static inline int xfsread(ufs_ino_t inode, void *buf, size_t nbyte) @@ -102,14 +150,90 @@ xfsread(ufs_ino_t inode, void *buf, size return (0); } -static inline uint32_t -memsize(void) +static void +bios_getmem(void) { + uint64_t size; - v86.addr = MEM_EXT; + /* Parse system memory map */ + v86.ebx = 0; + do { + v86.ctl = V86_FLAGS; + v86.addr = MEM_EXT; /* int 0x15 function 0xe820*/ + v86.eax = 0xe820; + v86.ecx = sizeof(struct bios_smap); + v86.edx = SMAP_SIG; + v86.es = VTOPSEG(&smap); + v86.edi = VTOPOFF(&smap); + v86int(); + if ((v86.efl & 1) || (v86.eax != SMAP_SIG)) + break; + /* look for a low-memory segment that's large enough */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0) && + (smap.length >= (512 * 1024))) + bios_basemem = smap.length; + /* look for the first segment in 'extended' memory */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base == 0x100000)) { + bios_extmem = smap.length; + } + + /* + * Look for the largest segment in 'extended' memory beyond + * 1MB but below 4GB. + */ + if ((smap.type == SMAP_TYPE_MEMORY) && (smap.base > 0x100000) && + (smap.base < 0x100000000ull)) { + size = smap.length; + + /* + * If this segment crosses the 4GB boundary, truncate it. + */ + if (smap.base + size > 0x100000000ull) + size = 0x100000000ull - smap.base; + + if (size > high_heap_size) { + high_heap_size = size; + high_heap_base = smap.base; + } + } + } while (v86.ebx != 0); + + /* Fall back to the old compatibility function for base memory */ + if (bios_basemem == 0) { + v86.ctl = 0; + v86.addr = 0x12; /* int 0x12 */ + v86int(); + + bios_basemem = (v86.eax & 0xffff) * 1024; + } + + /* Fall back through several compatibility functions for extended memory */ + if (bios_extmem == 0) { + v86.ctl = V86_FLAGS; + v86.addr = 0x15; /* int 0x15 function 0xe801*/ + v86.eax = 0xe801; + v86int(); + if (!(v86.efl & 1)) { + bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024; + } + } + if (bios_extmem == 0) { + v86.ctl = 0; + v86.addr = 0x15; /* int 0x15 function 0x88*/ v86.eax = 0x8800; v86int(); - return (v86.eax); + bios_extmem = (v86.eax & 0xffff) * 1024; + } + + /* + * If we have extended memory and did not find a suitable heap + * region in the SMAP, use the last 3MB of 'extended' memory as a + * high heap candidate. + */ + if (bios_extmem >= HEAP_MIN && high_heap_size < HEAP_MIN) { + high_heap_size = HEAP_MIN; + high_heap_base = bios_extmem + 0x100000 - HEAP_MIN; + } } static int @@ -124,6 +248,16 @@ gptinit(void) printf("%s: no UFS partition was found\n", BOOTPROG); return (-1); } +#ifdef LOADER_GELI_SUPPORT + if (geli_taste(vdev_read, &dsk, (gpttable[curent].ent_lba_end - + gpttable[curent].ent_lba_start)) == 0) { + if (geli_passphrase(&gelipw, dsk.unit, 'p', curent + 1, &dsk) != 0) { + printf("%s: unable to decrypt GELI key\n", BOOTPROG); + return (-1); + } + } +#endif + dsk_meta = 0; return (0); } @@ -137,6 +271,17 @@ main(void) ufs_ino_t ino; dmadat = (void *)(roundup2(__base + (int32_t)&_end, 0x10000) - __base); + + bios_getmem(); + + if (high_heap_size > 0) { + heap_end = PTOV(high_heap_base + high_heap_size); + heap_next = PTOV(high_heap_base); + } else { + heap_next = (char *)dmadat + sizeof(*dmadat); + heap_end = (char *)PTOV(bios_basemem); + } + v86.ctl = V86_FLAGS; v86.efl = PSL_RESERVED_DEFAULT | PSL_I; dsk.drive = *(uint8_t *)PTOV(ARGS); @@ -146,10 +291,14 @@ main(void) dsk.start = 0; bootinfo.bi_version = BOOTINFO_VERSION; bootinfo.bi_size = sizeof(bootinfo); - bootinfo.bi_basemem = 0; /* XXX will be filled by loader or kernel */ - bootinfo.bi_extmem = memsize(); + bootinfo.bi_basemem = bios_basemem / 1024; + bootinfo.bi_extmem = bios_extmem / 1024; bootinfo.bi_memsizes_valid++; + bootinfo.bi_bios_dev = dsk.drive; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Wed Mar 16 23:42:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3F19AD36C1; Wed, 16 Mar 2016 23:42:58 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D37176D; Wed, 16 Mar 2016 23:42:58 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GNgvAm067555; Wed, 16 Mar 2016 23:42:57 GMT (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GNgvnI067554; Wed, 16 Mar 2016 23:42:57 GMT (envelope-from obrien@FreeBSD.org) Message-Id: <201603162342.u2GNgvnI067554@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: obrien set sender to obrien@FreeBSD.org using -f From: "David E. O'Brien" Date: Wed, 16 Mar 2016 23:42:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296966 - head/contrib/libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 23:42:58 -0000 Author: obrien Date: Wed Mar 16 23:42:57 2016 New Revision: 296966 URL: https://svnweb.freebsd.org/changeset/base/296966 Log: Block the r296965 vendor/Juniper/libxo cleanup (to match the release tarball) from being merged in -- backing out FreeBSD localizations. Modified: Directory Properties: head/contrib/libxo/ (props changed) From owner-svn-src-head@freebsd.org Wed Mar 16 23:50:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96941AD386F; Wed, 16 Mar 2016 23:50:42 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 58B1B997; Wed, 16 Mar 2016 23:50:42 +0000 (UTC) (envelope-from phil@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GNofv0068722; Wed, 16 Mar 2016 23:50:41 GMT (envelope-from phil@FreeBSD.org) Received: (from phil@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GNofuL068498; Wed, 16 Mar 2016 23:50:41 GMT (envelope-from phil@FreeBSD.org) Message-Id: <201603162350.u2GNofuL068498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: phil set sender to phil@FreeBSD.org using -f From: Phil Shafer Date: Wed, 16 Mar 2016 23:50:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296967 - in head: contrib/libxo/libxo lib/libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 23:50:42 -0000 Author: phil Date: Wed Mar 16 23:50:41 2016 New Revision: 296967 URL: https://svnweb.freebsd.org/changeset/base/296967 Log: Move generated file from contrib to build directory. Reviewed by: obrien Approved by: sjg Added: head/lib/libxo/xo_config.h - copied unchanged from r296966, head/contrib/libxo/libxo/xo_config.h Deleted: head/contrib/libxo/libxo/xo_config.h Modified: head/lib/libxo/Makefile Modified: head/lib/libxo/Makefile ============================================================================== --- head/lib/libxo/Makefile Wed Mar 16 23:42:57 2016 (r296966) +++ head/lib/libxo/Makefile Wed Mar 16 23:50:41 2016 (r296967) @@ -13,7 +13,7 @@ SHLIB_MAJOR=0 SRCS= libxo.c xo_encoder.c xo_syslog.c -CFLAGS+=-I${LIBXOSRC}/libxo +CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" INCS= xo.h xo_encoder.h Copied: head/lib/libxo/xo_config.h (from r296966, head/contrib/libxo/libxo/xo_config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libxo/xo_config.h Wed Mar 16 23:50:41 2016 (r296967, copy of r296966, head/contrib/libxo/libxo/xo_config.h) @@ -0,0 +1,247 @@ +/* libxo/xo_config.h. Generated from xo_config.h.in by configure. */ +/* libxo/xo_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +/* #undef CRAY_STACKSEG_END */ + +/* Define to 1 if using `alloca.c'. */ +/* #undef C_ALLOCA */ + +/* Define to 1 if you have `alloca', as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +/* #undef HAVE_ALLOCA_H */ + +/* Define to 1 if you have the `asprintf' function. */ +#define HAVE_ASPRINTF 1 + +/* Define to 1 if you have the `bzero' function. */ +#define HAVE_BZERO 1 + +/* Define to 1 if you have the `ctime' function. */ +#define HAVE_CTIME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_CTYPE_H 1 + +/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you + don't. */ +#define HAVE_DECL___ISTHREADED 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_DLFCN_H 1 + +/* Define to 1 if you have the `dlfunc' function. */ +#define HAVE_DLFUNC 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_ERRNO_H 1 + +/* Define to 1 if you have the `fdopen' function. */ +#define HAVE_FDOPEN 1 + +/* Define to 1 if you have the `flock' function. */ +#define HAVE_FLOCK 1 + +/* Define to 1 if you have the `getpass' function. */ +#define HAVE_GETPASS 1 + +/* Define to 1 if you have the `getprogname' function. */ +#define HAVE_GETPROGNAME 1 + +/* Define to 1 if you have the `getrusage' function. */ +#define HAVE_GETRUSAGE 1 + +/* gettext(3) */ +/* #undef HAVE_GETTEXT */ + +/* Define to 1 if you have the `gettimeofday' function. */ +#define HAVE_GETTIMEOFDAY 1 + +/* humanize_number(3) */ +#define HAVE_HUMANIZE_NUMBER 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#define HAVE_LIBCRYPTO 1 + +/* Define to 1 if you have the `m' library (-lm). */ +#define HAVE_LIBM 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_LIBUTIL_H 1 + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#define HAVE_MALLOC 1 + +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_MEMORY_H 1 + +/* Support printflike */ +/* #undef HAVE_PRINTFLIKE */ + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#define HAVE_REALLOC 1 + +/* Define to 1 if you have the `srand' function. */ +#define HAVE_SRAND 1 + +/* Define to 1 if you have the `sranddev' function. */ +#define HAVE_SRANDDEV 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDIO_EXT_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_STDIO_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_STDTIME_TZFILE_H */ + +/* Define to 1 if you have the `strchr' function. */ +#define HAVE_STRCHR 1 + +/* Define to 1 if you have the `strcspn' function. */ +#define HAVE_STRCSPN 1 + +/* Define to 1 if you have the `strerror' function. */ +#define HAVE_STRERROR 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the `strlcpy' function. */ +#define HAVE_STRLCPY 1 + +/* Define to 1 if you have the `strspn' function. */ +#define HAVE_STRSPN 1 + +/* Have struct sockaddr_un.sun_len */ +#define HAVE_SUN_LEN 1 + +/* Define to 1 if you have the `sysctlbyname' function. */ +#define HAVE_SYSCTLBYNAME 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_SYSCTL_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_THREADS_H 1 + +/* thread-local setting */ +#define HAVE_THREAD_LOCAL THREAD_LOCAL_before + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_TZFILE_H */ + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__flbf' function. */ +/* #undef HAVE___FLBF */ + +/* Enable debugging */ +/* #undef LIBXO_DEBUG */ + +/* Enable text-only rendering */ +/* #undef LIBXO_TEXT_ONLY */ + +/* Version number as dotted value */ +#define LIBXO_VERSION "0.4.3" + +/* Version number extra information */ +#define LIBXO_VERSION_EXTRA "" + +/* Version number as a number */ +#define LIBXO_VERSION_NUMBER 4003 + +/* Version number as string */ +#define LIBXO_VERSION_STRING "4003" + +/* Enable local wcwidth implementation */ +#define LIBXO_WCWIDTH 1 + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Name of package */ +#define PACKAGE "libxo" + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "phil@juniper.net" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "libxo" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "libxo 0.4.3" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "libxo" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "0.4.3" + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +/* #undef STACK_DIRECTION */ + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Version number of package */ +#define VERSION "0.4.3" + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +/* #undef malloc */ + +/* Define to rpl_realloc if the replacement function should be used. */ +/* #undef realloc */ + +/* Define to `unsigned int' if does not define. */ +/* #undef size_t */ From owner-svn-src-head@freebsd.org Wed Mar 16 23:59:30 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38E28AD3D1D; Wed, 16 Mar 2016 23:59:30 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 015F1E82; Wed, 16 Mar 2016 23:59:29 +0000 (UTC) (envelope-from obrien@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2GNxT4O070813; Wed, 16 Mar 2016 23:59:29 GMT (envelope-from obrien@FreeBSD.org) Received: (from obrien@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2GNxT6T070811; Wed, 16 Mar 2016 23:59:29 GMT (envelope-from obrien@FreeBSD.org) Message-Id: <201603162359.u2GNxT6T070811@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: obrien set sender to obrien@FreeBSD.org using -f From: "David E. O'Brien" Date: Wed, 16 Mar 2016 23:59:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296968 - in head/contrib/libxo: . bin build libxo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Mar 2016 23:59:30 -0000 Author: obrien Date: Wed Mar 16 23:59:29 2016 New Revision: 296968 URL: https://svnweb.freebsd.org/changeset/base/296968 Log: Bring down 0.4.5 vendor files and other catchups with the distribution tarball. Reviewed by: phil Added: - copied unchanged from r296967, vendor/Juniper/libxo/dist/libxo/xo_config.h.in Directory Properties: head/contrib/libxo/libxo/xo_config.h.in (props changed) Deleted: head/contrib/libxo/bin/ head/contrib/libxo/build/ Modified: head/contrib/libxo/install-sh Modified: head/contrib/libxo/install-sh ============================================================================== --- head/contrib/libxo/install-sh Wed Mar 16 23:50:41 2016 (r296967) +++ head/contrib/libxo/install-sh Wed Mar 16 23:59:29 2016 (r296968) @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -208,6 +204,15 @@ if test $# -eq 0; then fi if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + +if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -269,41 +274,15 @@ do # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi @@ -314,74 +293,74 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +370,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue + test X"$d" = X && continue - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -472,15 +449,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +467,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 Copied: head/contrib/libxo/libxo/xo_config.h.in (from r296967, vendor/Juniper/libxo/dist/libxo/xo_config.h.in) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libxo/libxo/xo_config.h.in Wed Mar 16 23:59:29 2016 (r296968, copy of r296967, vendor/Juniper/libxo/dist/libxo/xo_config.h.in) @@ -0,0 +1,246 @@ +/* libxo/xo_config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP + systems. This function is required for `alloca.c' support on those systems. + */ +#undef CRAY_STACKSEG_END + +/* Define to 1 if using `alloca.c'. */ +#undef C_ALLOCA + +/* Define to 1 if you have `alloca', as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define to 1 if you have and it should be used (not on Ultrix). + */ +#undef HAVE_ALLOCA_H + +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + +/* Define to 1 if you have the `bzero' function. */ +#undef HAVE_BZERO + +/* Define to 1 if you have the `ctime' function. */ +#undef HAVE_CTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the declaration of `__isthreaded', and to 0 if you + don't. */ +#undef HAVE_DECL___ISTHREADED + +/* Define to 1 if you have the header file. */ +#undef HAVE_DLFCN_H + +/* Define to 1 if you have the `dlfunc' function. */ +#undef HAVE_DLFUNC + +/* Define to 1 if you have the header file. */ +#undef HAVE_ERRNO_H + +/* Define to 1 if you have the `fdopen' function. */ +#undef HAVE_FDOPEN + +/* Define to 1 if you have the `flock' function. */ +#undef HAVE_FLOCK + +/* Define to 1 if you have the `getpass' function. */ +#undef HAVE_GETPASS + +/* Define to 1 if you have the `getprogname' function. */ +#undef HAVE_GETPROGNAME + +/* Define to 1 if you have the `getrusage' function. */ +#undef HAVE_GETRUSAGE + +/* gettext(3) */ +#undef HAVE_GETTEXT + +/* Define to 1 if you have the `gettimeofday' function. */ +#undef HAVE_GETTIMEOFDAY + +/* humanize_number(3) */ +#undef HAVE_HUMANIZE_NUMBER + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the `crypto' library (-lcrypto). */ +#undef HAVE_LIBCRYPTO + +/* Define to 1 if you have the `m' library (-lm). */ +#undef HAVE_LIBM + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBUTIL_H + +/* Define to 1 if your system has a GNU libc compatible `malloc' function, and + to 0 otherwise. */ +#undef HAVE_MALLOC + +/* Define to 1 if you have the `memmove' function. */ +#undef HAVE_MEMMOVE + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Support printflike */ +#undef HAVE_PRINTFLIKE + +/* Define to 1 if your system has a GNU libc compatible `realloc' function, + and to 0 otherwise. */ +#undef HAVE_REALLOC + +/* Define to 1 if you have the `srand' function. */ +#undef HAVE_SRAND + +/* Define to 1 if you have the `sranddev' function. */ +#undef HAVE_SRANDDEV + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_EXT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDTIME_TZFILE_H + +/* Define to 1 if you have the `strchr' function. */ +#undef HAVE_STRCHR + +/* Define to 1 if you have the `strcspn' function. */ +#undef HAVE_STRCSPN + +/* Define to 1 if you have the `strerror' function. */ +#undef HAVE_STRERROR + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the `strlcpy' function. */ +#undef HAVE_STRLCPY + +/* Define to 1 if you have the `strspn' function. */ +#undef HAVE_STRSPN + +/* Have struct sockaddr_un.sun_len */ +#undef HAVE_SUN_LEN + +/* Define to 1 if you have the `sysctlbyname' function. */ +#undef HAVE_SYSCTLBYNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SYSCTL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_THREADS_H + +/* thread-local setting */ +#undef HAVE_THREAD_LOCAL + +/* Define to 1 if you have the header file. */ +#undef HAVE_TZFILE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `__flbf' function. */ +#undef HAVE___FLBF + +/* Enable debugging */ +#undef LIBXO_DEBUG + +/* Enable text-only rendering */ +#undef LIBXO_TEXT_ONLY + +/* Version number as dotted value */ +#undef LIBXO_VERSION + +/* Version number extra information */ +#undef LIBXO_VERSION_EXTRA + +/* Version number as a number */ +#undef LIBXO_VERSION_NUMBER + +/* Version number as string */ +#undef LIBXO_VERSION_STRING + +/* Enable local wcwidth implementation */ +#undef LIBXO_WCWIDTH + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#undef LT_OBJDIR + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the home page for this package. */ +#undef PACKAGE_URL + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at runtime. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ +#undef STACK_DIRECTION + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +#undef inline +#endif + +/* Define to rpl_malloc if the replacement function should be used. */ +#undef malloc + +/* Define to rpl_realloc if the replacement function should be used. */ +#undef realloc + +/* Define to `unsigned int' if does not define. */ +#undef size_t From owner-svn-src-head@freebsd.org Thu Mar 17 00:37:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85ADDAD2D89; Thu, 17 Mar 2016 00:37:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 52B025E4; Thu, 17 Mar 2016 00:37:05 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H0b4ZQ082850; Thu, 17 Mar 2016 00:37:04 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H0b4Rb082849; Thu, 17 Mar 2016 00:37:04 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201603170037.u2H0b4Rb082849@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 17 Mar 2016 00:37:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296970 - head/lib/libxo/tests X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 00:37:05 -0000 Author: sjg Date: Thu Mar 17 00:37:04 2016 New Revision: 296970 URL: https://svnweb.freebsd.org/changeset/base/296970 Log: We need libutil and make it feasible to at least build the tests in situ Modified: head/lib/libxo/tests/Makefile Modified: head/lib/libxo/tests/Makefile ============================================================================== --- head/lib/libxo/tests/Makefile Thu Mar 17 00:32:29 2016 (r296969) +++ head/lib/libxo/tests/Makefile Thu Mar 17 00:37:04 2016 (r296970) @@ -242,8 +242,14 @@ PROGS+= test_11 CFLAGS+= -I${LIBXOSRC}/libxo -LIBADD= xo +LIBADD= xo util SUBDIR+= encoder +.if ${MACHINE} == "host" +# make it easy to test without install +TESTSDIR= ${.OBJDIR} +CFLAGS+= -I${.CURDIR:H} +.endif + .include From owner-svn-src-head@freebsd.org Thu Mar 17 01:05:54 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D9EFDAD36E8; Thu, 17 Mar 2016 01:05:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9978E9FB; Thu, 17 Mar 2016 01:05:54 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H15rJY092022; Thu, 17 Mar 2016 01:05:53 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H15rck092019; Thu, 17 Mar 2016 01:05:53 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201603170105.u2H15rck092019@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Thu, 17 Mar 2016 01:05:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296973 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 01:05:55 -0000 Author: cem Date: Thu Mar 17 01:05:53 2016 New Revision: 296973 URL: https://svnweb.freebsd.org/changeset/base/296973 Log: fail(9): Only gather/print stacks if STACK is enabled This is a follow-up fix to the earlier r296927. Reported by: bz Sponsored by: EMC / Isilon Storage Division Modified: head/sys/kern/kern_fail.c head/sys/kern/subr_sleepqueue.c head/sys/sys/sleepqueue.h Modified: head/sys/kern/kern_fail.c ============================================================================== --- head/sys/kern/kern_fail.c Thu Mar 17 01:02:34 2016 (r296972) +++ head/sys/kern/kern_fail.c Thu Mar 17 01:05:53 2016 (r296973) @@ -52,6 +52,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_stack.h" + #include #include #include @@ -708,6 +710,7 @@ fail_point_get(struct fail_point *fp, st fp_free(fp_entry_cpy); if (verbose) { +#ifdef STACK /* Print number of sleeping threads. queue=0 is the argument * used by msleep when sending our threads to sleep. */ sbuf_printf(sb, "\nsleeping_thread_stacks = {\n"); @@ -715,14 +718,17 @@ fail_point_get(struct fail_point *fp, st &cnt_sleeping); sbuf_printf(sb, "},\n"); +#endif sbuf_printf(sb, "sleeping_thread_count = %d,\n", cnt_sleeping); +#ifdef STACK sbuf_printf(sb, "paused_thread_stacks = {\n"); sleepq_sbuf_print_stacks(sb, FP_PAUSE_CHANNEL(fp), 0, &cnt_sleeping); sbuf_printf(sb, "},\n"); +#endif sbuf_printf(sb, "paused_thread_count = %d\n", cnt_sleeping); } Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Thu Mar 17 01:02:34 2016 (r296972) +++ head/sys/kern/subr_sleepqueue.c Thu Mar 17 01:05:53 2016 (r296973) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include "opt_sleepqueue_profiling.h" #include "opt_ddb.h" #include "opt_sched.h" +#include "opt_stack.h" #include #include @@ -1042,6 +1043,7 @@ sleepq_abort(struct thread *td, int intr * printed. Typically, this will equal the number of threads sleeping on the * queue, but may be less if sb overflowed before all stacks were printed. */ +#ifdef STACK int sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, int queue, int *count_stacks_printed) @@ -1149,6 +1151,7 @@ loop_end: return (error); } +#endif #ifdef SLEEPQUEUE_PROFILING #define SLEEPQ_PROF_LOCATIONS 1024 Modified: head/sys/sys/sleepqueue.h ============================================================================== --- head/sys/sys/sleepqueue.h Thu Mar 17 01:02:34 2016 (r296972) +++ head/sys/sys/sleepqueue.h Thu Mar 17 01:05:53 2016 (r296973) @@ -107,9 +107,11 @@ int sleepq_type(void *wchan); void sleepq_wait(void *wchan, int pri); int sleepq_wait_sig(void *wchan, int pri); -#include +#ifdef STACK +struct sbuf; int sleepq_sbuf_print_stacks(struct sbuf *sb, void *wchan, int queue, int *count_stacks_printed); +#endif #endif /* _KERNEL */ #endif /* !_SYS_SLEEPQUEUE_H_ */ From owner-svn-src-head@freebsd.org Thu Mar 17 01:06:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C03C7AD3735; Thu, 17 Mar 2016 01:06:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yw0-f170.google.com (mail-yw0-f170.google.com [209.85.161.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 8A4D1B60; Thu, 17 Mar 2016 01:06:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yw0-f170.google.com with SMTP id g3so82953920ywa.3; Wed, 16 Mar 2016 18:06:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc; bh=opH0VUSBu/3r4iRhsZIiLWKsPMr314tQLW0/xCacQ5E=; b=TpRRcOHQiP6XWIxRwKIrnXOiLVymLgfpwr5GO3PVTnT+o5CJtiOuKCq5PzQAsS/x9V FJBaUdnXz4uKlGSQ1jnn6/Rm5a37o+Rh8eFhMrEcafIoQfGdfssvWxaII42uzZZ2sc12 sh0vHPjYOaig3upptJPVGrTz43Onu0CGGo9+Ynjt0P3xXIuPp4/NoxMSvKpm4OEdKFi2 wdhklmXpL2kQfrUs4LhbOsQRnvbDs1kTYij/WqmitWr/1U02cQVhrvYCn9sqn8f8dm/c iRt8csxnp8BM0ZtZ3fkUBt8qDdF09YvDaNmqqrBSFBxnkQR5XyWS+9MXepQAy7sXlX50 9lMA== X-Gm-Message-State: AD7BkJJuOCI6/YBGld3iTHVALWNqeanP6xxtQj14Iy0YC9xyMSjQVwNW3Xzv+mgZLHHi6w== X-Received: by 10.13.214.77 with SMTP id y74mr2876935ywd.217.1458176783174; Wed, 16 Mar 2016 18:06:23 -0700 (PDT) Received: from mail-yw0-f181.google.com (mail-yw0-f181.google.com. [209.85.161.181]) by smtp.gmail.com with ESMTPSA id l128sm3678748ywd.5.2016.03.16.18.06.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Mar 2016 18:06:23 -0700 (PDT) Received: by mail-yw0-f181.google.com with SMTP id h129so82934969ywb.1; Wed, 16 Mar 2016 18:06:22 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.31.67 with SMTP id f64mr2893647ywf.94.1458176782520; Wed, 16 Mar 2016 18:06:22 -0700 (PDT) Reply-To: cem@FreeBSD.org Received: by 10.37.115.134 with HTTP; Wed, 16 Mar 2016 18:06:22 -0700 (PDT) In-Reply-To: References: <201603160422.u2G4MWg1012528@repo.freebsd.org> Date: Wed, 16 Mar 2016 18:06:22 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r296927 - in head: share/man/man9 sys/kern sys/sys From: Conrad Meyer To: "Bjoern A. Zeeb" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 01:06:24 -0000 Fixed in r296973. On Wed, Mar 16, 2016 at 3:02 PM, Bjoern A. Zeeb wrote: > On Wed, 16 Mar 2016, Conrad E. Meyer wrote: > >> Author: cem >> Date: Wed Mar 16 04:22:32 2016 >> New Revision: 296927 >> URL: https://svnweb.freebsd.org/changeset/base/296927 >> >> Log: >> fail(9): Upstreaming some fail point enhancements >> >> This is several year's worth of fail point upgrades done at EMC Isilon. >> They >> are interdependent enough that it makes sense to put a single diff up for >> them. >> Primarily, we added: >> >> - Changing all mainline execution paths to be lockless, which lets us use >> fail >> points in more sleep-sensitive areas, and allows more parallel >> execution >> - A number of additional commands, including 'pause' that lets us do some >> interesting deterministic repros of race conditions >> - The ability to dump the stacks of all threads sleeping on a fail point >> - A number of other API changes to allow marking up the fail point's >> context in >> the code, and firing callbacks before and after execution >> - A man page update >> >> Submitted by: Matthew Bryan >> Reviewed by: cem (earlier version), jhb, kib, pho >> With feedback from: bdrewery >> Sponsored by: EMC / Isilon Storage Division >> Differential Revision: https://reviews.freebsd.org/D5427 >> >> Modified: >> head/share/man/man9/fail.9 >> head/sys/kern/kern_fail.c >> head/sys/kern/subr_sleepqueue.c >> head/sys/sys/fail.h >> head/sys/sys/sleepqueue.h > > > This seems to have broken a few kernel configs (just one example); > > linking kernel.full > subr_sleepqueue.o: In function `sleepq_sbuf_print_stacks': > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): undefined > reference to `stack_create' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x448): > relocation truncated to fit: R_MIPS_26 against `stack_create' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): undefined > reference to `stack_save_td' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x504): > relocation truncated to fit: R_MIPS_26 against `stack_save_td' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): undefined > reference to `stack_sbuf_print' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x598): > relocation truncated to fit: R_MIPS_26 against `stack_sbuf_print' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): undefined > reference to `stack_destroy' > /scratch/tmp/bz/head.svn/sys/kern/subr_sleepqueue.c:(.text+0x5f0): > relocation truncated to fit: R_MIPS_26 against `stack_destroy' > --- kernel.full --- > *** [kernel.full] Error code 1 > > bmake[5]: stopped in > /storage/head/obj/mips.mipsn32/scratch/tmp/bz/head.svn/sys/XLPN32 From owner-svn-src-head@freebsd.org Thu Mar 17 01:09:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F130AAD37DD; Thu, 17 Mar 2016 01:09: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 C1097D1C; Thu, 17 Mar 2016 01:09: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 u2H19LOu092176; Thu, 17 Mar 2016 01:09:21 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H19L23092175; Thu, 17 Mar 2016 01:09:21 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603170109.u2H19L23092175@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 17 Mar 2016 01:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296974 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 01:09:23 -0000 Author: adrian Date: Thu Mar 17 01:09:21 2016 New Revision: 296974 URL: https://svnweb.freebsd.org/changeset/base/296974 Log: [net80211] Add some more missing IEs. There are a /lot/ more missing; I'll chase these down over time. Obtained from: 802.11-2012 standard Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Thu Mar 17 01:05:53 2016 (r296973) +++ head/sys/net80211/ieee80211.h Thu Mar 17 01:09:21 2016 (r296974) @@ -710,6 +710,8 @@ enum { IEEE80211_ELEMID_IBSSPARMS = 6, IEEE80211_ELEMID_COUNTRY = 7, IEEE80211_ELEMID_BSSLOAD = 11, + IEEE80211_ELEMID_TSPEC = 13, + IEEE80211_ELEMID_TCLAS = 14, IEEE80211_ELEMID_CHALLENGE = 16, /* 17-31 reserved for challenge text extension */ IEEE80211_ELEMID_PWRCNSTR = 32, @@ -729,6 +731,17 @@ enum { IEEE80211_ELEMID_XRATES = 50, IEEE80211_ELEMID_APCHANREP = 51, IEEE80211_ELEMID_HTINFO = 61, + IEEE80211_ELEMID_SECCHAN_OFFSET = 62, + IEEE80211_ELEMID_RRM_ENACAPS = 70, + IEEE80211_ELEMID_MULTIBSSID = 71, + IEEE80211_ELEMID_COEX_2040 = 72, + IEEE80211_ELEMID_INTOL_CHN_REPORT = 73, + IEEE80211_ELEMID_OVERLAP_BSS_SCAN_PARAM = 74, + IEEE80211_ELEMID_TSF_REQ = 91, + IEEE80211_ELEMID_TSF_RESP = 92, + IEEE80211_ELEMID_WNM_SLEEP_MODE = 93, + IEEE80211_ELEMID_TIM_BCAST_REQ = 94, + IEEE80211_ELEMID_TIM_BCAST_RESP = 95, IEEE80211_ELEMID_TPC = 150, IEEE80211_ELEMID_CCKM = 156, IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ From owner-svn-src-head@freebsd.org Thu Mar 17 01:15:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4928AD3A1D; Thu, 17 Mar 2016 01:15:17 +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 910211AA; Thu, 17 Mar 2016 01:15:17 +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 u2H1FGNa095051; Thu, 17 Mar 2016 01:15:16 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H1FGXB095049; Thu, 17 Mar 2016 01:15:16 GMT (envelope-from np@FreeBSD.org) Message-Id: <201603170115.u2H1FGXB095049@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Thu, 17 Mar 2016 01:15:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296975 - in head/sys/dev/cxgbe: . common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 01:15:17 -0000 Author: np Date: Thu Mar 17 01:15:16 2016 New Revision: 296975 URL: https://svnweb.freebsd.org/changeset/base/296975 Log: cxgbe(4): Tidy up PAUSE frame accounting. Figure out if the chip is counting PAUSE frames in the "normal" stats and take them out if it is. This fixes a bug in the tx stats because the default hardware behavior is different for Tx and Rx but the driver was treating both the same way. The result was that OPACKETS, OBYTES, and OMCASTS were under-reported (if tx_pause > 0) before this change. Note that the mac_stats sysctl still gives you the raw value of these statistics straight from the device registers. Modified: head/sys/dev/cxgbe/common/t4_hw.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- head/sys/dev/cxgbe/common/t4_hw.c Thu Mar 17 01:09:21 2016 (r296974) +++ head/sys/dev/cxgbe/common/t4_hw.c Thu Mar 17 01:15:16 2016 (r296975) @@ -5615,6 +5615,7 @@ void t4_get_port_stats_offset(struct ada void t4_get_port_stats(struct adapter *adap, int idx, struct port_stats *p) { u32 bgmap = t4_get_mps_bg_map(adap, idx); + u32 stat_ctl; #define GET_STAT(name) \ t4_read_reg64(adap, \ @@ -5622,6 +5623,8 @@ void t4_get_port_stats(struct adapter *a T5_PORT_REG(idx, A_MPS_PORT_STAT_##name##_L))) #define GET_STAT_COM(name) t4_read_reg64(adap, A_MPS_STAT_##name##_L) + stat_ctl = t4_read_reg(adap, A_MPS_STAT_CTL); + p->tx_pause = GET_STAT(TX_PORT_PAUSE); p->tx_octets = GET_STAT(TX_PORT_BYTES); p->tx_frames = GET_STAT(TX_PORT_FRAMES); @@ -5646,6 +5649,12 @@ void t4_get_port_stats(struct adapter *a p->tx_ppp6 = GET_STAT(TX_PORT_PPP6); p->tx_ppp7 = GET_STAT(TX_PORT_PPP7); + if (stat_ctl & F_COUNTPAUSESTATTX) { + p->tx_frames -= p->tx_pause; + p->tx_octets -= p->tx_pause * 64; + p->tx_mcast_frames -= p->tx_pause; + } + p->rx_pause = GET_STAT(RX_PORT_PAUSE); p->rx_octets = GET_STAT(RX_PORT_BYTES); p->rx_frames = GET_STAT(RX_PORT_FRAMES); @@ -5674,6 +5683,12 @@ void t4_get_port_stats(struct adapter *a p->rx_ppp6 = GET_STAT(RX_PORT_PPP6); p->rx_ppp7 = GET_STAT(RX_PORT_PPP7); + if (stat_ctl & F_COUNTPAUSESTATRX) { + p->rx_frames -= p->rx_pause; + p->rx_octets -= p->rx_pause * 64; + p->rx_mcast_frames -= p->rx_pause; + } + p->rx_ovflow0 = (bgmap & 1) ? GET_STAT_COM(RX_BG_0_MAC_DROP_FRAME) : 0; p->rx_ovflow1 = (bgmap & 2) ? GET_STAT_COM(RX_BG_1_MAC_DROP_FRAME) : 0; p->rx_ovflow2 = (bgmap & 4) ? GET_STAT_COM(RX_BG_2_MAC_DROP_FRAME) : 0; Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Thu Mar 17 01:09:21 2016 (r296974) +++ head/sys/dev/cxgbe/t4_main.c Thu Mar 17 01:15:16 2016 (r296975) @@ -1732,29 +1732,29 @@ cxgbe_get_counter(struct ifnet *ifp, ift switch (c) { case IFCOUNTER_IPACKETS: - return (s->rx_frames - s->rx_pause); + return (s->rx_frames); case IFCOUNTER_IERRORS: return (s->rx_jabber + s->rx_runt + s->rx_too_long + s->rx_fcs_err + s->rx_len_err); case IFCOUNTER_OPACKETS: - return (s->tx_frames - s->tx_pause); + return (s->tx_frames); case IFCOUNTER_OERRORS: return (s->tx_error_frames); case IFCOUNTER_IBYTES: - return (s->rx_octets - s->rx_pause * 64); + return (s->rx_octets); case IFCOUNTER_OBYTES: - return (s->tx_octets - s->tx_pause * 64); + return (s->tx_octets); case IFCOUNTER_IMCASTS: - return (s->rx_mcast_frames - s->rx_pause); + return (s->rx_mcast_frames); case IFCOUNTER_OMCASTS: - return (s->tx_mcast_frames - s->tx_pause); + return (s->tx_mcast_frames); case IFCOUNTER_IQDROPS: return (s->rx_ovflow0 + s->rx_ovflow1 + s->rx_ovflow2 + From owner-svn-src-head@freebsd.org Thu Mar 17 02:47:05 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C41D9AD35AE; Thu, 17 Mar 2016 02:47:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9A8CBDF6; Thu, 17 Mar 2016 02:47:05 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: by mail-io0-x22c.google.com with SMTP id g203so83128357iof.2; Wed, 16 Mar 2016 19:47:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=l1fUGhMCJKNQ+jzew6AELhfimQeLK1p3S3/VL30/fy4=; b=uESUNU12tuUCDyeSUgizNGZKTq/xVQnoeqfsq6e6nEJ/LXUcnctKoACsQe0mIgRWky NPi+cz1VYxbLs613c4dbuecTT0gDlJo/ml9SO8t7WRk9CVA8H3z9EjK52ummp+hWJLLt b+L0aBkKIkU61juDYLcMw5KOSm2Zt93u2E7ijkmsUaUYYKWX21AuoW7rdoPuwspP/AUj jFbyLa0TS5KBhaA24+5hiC8AfWmae2yOOxnPpZBEjD0uXfq1RGUQvbNffKp8WOzYp4+A YUdzUXZ7fnHtLQCpcDY1UCL7Zkwah6c4KKFuyF4nLo7LyJ8HkGZ/IO22aukGxsaHrRLc 2nHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=l1fUGhMCJKNQ+jzew6AELhfimQeLK1p3S3/VL30/fy4=; b=Li3VM6HuOIMT54TN5xv6HXz1WHrq1tD2c3gX47hZYeyJQYHCmEhkeb8aq1EDj+r4RI qfxf2vS3e0PVHXXoAyLeeJI2EOXlPTKTC4EJjityPh/VzjUrX35YaHr1c/oMAlkbMkry IkhpR64bcvpkkd8pepenzz3tLITkCzs0IlKahPZOtiUiSQd16YVgN8yPbzxf06BjDETe rU1vrEmaiQTdlkqYl8PygFjD7x/2kqR8jdjPKsvz+Kv7IFZHPEk34qcZkuS51HBfM3Jf 7xXXKE9iKuBueH11lstWEdKtjd2TAvWXtOTwDASD56H/5LdNq9nOaxozSVTjSFAZHkDW aALg== X-Gm-Message-State: AD7BkJIATFwEKo4Q5UjkPdMSVFvj4vEFwEkXS3sv/LSkP3X67yq6jrj8VINks8R7MdIvkw== X-Received: by 10.107.11.90 with SMTP id v87mr7867955ioi.184.1458182824936; Wed, 16 Mar 2016 19:47:04 -0700 (PDT) Received: from [100.240.141.215] ([172.56.8.169]) by smtp.gmail.com with ESMTPSA id x3sm2875789igl.11.2016.03.16.19.47.03 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 16 Mar 2016 19:47:03 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: svn commit: r296970 - head/lib/libxo/tests From: NGie Cooper X-Mailer: iPhone Mail (13D20) In-Reply-To: <201603170037.u2H0b4Rb082849@repo.freebsd.org> Date: Wed, 16 Mar 2016 19:47:02 -0700 Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <984878F0-9CE9-442D-8F7F-40C5365052AA@gmail.com> References: <201603170037.u2H0b4Rb082849@repo.freebsd.org> To: "Simon J. Gerraty" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 02:47:05 -0000 > On Mar 16, 2016, at 17:37, Simon J. Gerraty wrote: >=20 > Author: sjg > Date: Thu Mar 17 00:37:04 2016 > New Revision: 296970 > URL: https://svnweb.freebsd.org/changeset/base/296970 >=20 > Log: > We need libutil >=20 > and make it feasible to at least build the tests in situ >=20 > Modified: > head/lib/libxo/tests/Makefile >=20 > Modified: head/lib/libxo/tests/Makefile > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D > --- head/lib/libxo/tests/Makefile Thu Mar 17 00:32:29 2016 (r296969)= > +++ head/lib/libxo/tests/Makefile Thu Mar 17 00:37:04 2016 (r296970)= > @@ -242,8 +242,14 @@ PROGS+=3D test_11 >=20 > CFLAGS+=3D -I${LIBXOSRC}/libxo >=20 > -LIBADD=3D xo > +LIBADD=3D xo util=20 >=20 > SUBDIR+=3D encoder >=20 > +.if ${MACHINE} =3D=3D "host" > +# make it easy to test without install > +TESTSDIR=3D ${.OBJDIR} > +CFLAGS+=3D -I${.CURDIR:H} > +.endif > + > .include This commit seems unnecessary -- have you tried make check yet? Thanks, -Ngie= From owner-svn-src-head@freebsd.org Thu Mar 17 04:05:04 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2A567AD3E48; Thu, 17 Mar 2016 04:05:04 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0117.outbound.protection.outlook.com [157.56.111.117]) (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 62687A96; Thu, 17 Mar 2016 04:05:02 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=Kf2JcbjN9sWjW7srI7cCabNXNaEO/KbXdUW46W0GKdk=; b=Jg8SBQ0kCeUOESu6ytqQUeD3qzahDsx4c1ZykXnT/nK03hgkxkMt9lHGqfyAQwY2tbp/0Z3VOapzc5FjFYQSw1c60+xiC5grA0WzyXYjPCG3aYvijupczhgvtdj8bD6KqpkrtiuwYbqDD2q0sjMHh8SawUCU3UcDyRNkWgcn6f0= Received: from BY1PR0501CA0017.namprd05.prod.outlook.com (10.162.139.27) by SN1PR0501MB2125.namprd05.prod.outlook.com (10.163.228.152) with Microsoft SMTP Server (TLS) id 15.1.434.16; Thu, 17 Mar 2016 04:05:00 +0000 Received: from BN1BFFO11FD018.protection.gbl (2a01:111:f400:7c10::1:194) by BY1PR0501CA0017.outlook.office365.com (2a01:111:e400:4821::27) with Microsoft SMTP Server (TLS) id 15.1.443.12 via Frontend Transport; Thu, 17 Mar 2016 04:05:00 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BN1BFFO11FD018.mail.protection.outlook.com (10.58.144.81) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Thu, 17 Mar 2016 04:04:59 +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; Wed, 16 Mar 2016 21:04:58 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2H44vD69950; Wed, 16 Mar 2016 21:04:57 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id AF9CD385508; Wed, 16 Mar 2016 21:04:57 -0700 (PDT) To: NGie Cooper CC: , , , Subject: Re: svn commit: r296970 - head/lib/libxo/tests In-Reply-To: <984878F0-9CE9-442D-8F7F-40C5365052AA@gmail.com> References: <201603170037.u2H0b4Rb082849@repo.freebsd.org> <984878F0-9CE9-442D-8F7F-40C5365052AA@gmail.com> Comments: In-reply-to: NGie Cooper message dated "Wed, 16 Mar 2016 19:47:02 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <85788.1458187497.1@kaos.jnpr.net> Date: Wed, 16 Mar 2016 21:04:57 -0700 Message-ID: <85789.1458187497@kaos.jnpr.net> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:66.129.239.19; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(199003)(24454002)(52314003)(189002)(50466002)(5003600100002)(81166005)(4001430100002)(87936001)(50986999)(86362001)(76176999)(19580395003)(19580405001)(97756001)(76506005)(106466001)(53416004)(117636001)(47776003)(2906002)(6806005)(46406003)(1411001)(105596002)(4326007)(5008740100001)(92566002)(11100500001)(110136002)(1220700001)(189998001)(1096002)(23726003)(77096005)(2950100001)(586003)(107886002)(50226001)(2810700001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR0501MB2125; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD018; 1:jGAlsi4qRhE4hmxA442GZLdsP5zTT3I/GiES++tJIS2YHscrMYghMT3JNlchz1no3pjI3fMgNFvKtO9Jii6vAVnxrsQJBZ9k7ZcM1PAKWhyWZuUyL1az8wYula1ofAhYfA+5bmAA0QandI0BtjQ2iswjf1eJBnB+8uhc7zRz4LEP8aL46mr+/5XBdW/79KI0hBqnVuV/4oSIDk7l65gCpao0Sez+rMxUgeD24yLuPvs7FW7kfmkFhfj7tnhji/m0jgOMOrsO6Cf0mOTGdEjBcc8P1ME/Zby7Ah8QNVYxvUvL/scRvYzYyw5dqUFn+D7KX3W1H0ANfCiVKuS4wXYqldiPV0fqczNOqZeETD7Lsu5yw9nbM2fVpgS5hHimOqDXT7c8usQAD88VqxN9/PjwwDrRnvjZ6jZ3HSbvu1Rfe22hC5826KP2vO7hZU9494XnU6GnXIfnqYUYmyPMhQLcWSdftpyDOhS/fW8TgScKFX4= X-MS-Office365-Filtering-Correlation-Id: 4ff06d02-6d19-413b-0e1a-08d34e194f2b X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2125; 2:yF4l+XEHs8iF8erXAq36Quv3SXKBhVJJzWH+hutNisGfqMw9/cQvKIDTcexNuonvqX1pMO40/vk2U0R5Mq3EV7QtuJfE0JcZrhrO/aJ9GsmI5TixdIOMJHjTXbkTCr2+jvqB92s5odD1EXx9YgZov3YQZ2ebfuPwlzaxptakIpakbKOlcBmwwjjYEl2ZI3mE; 3:hqreuCQLRSfaWEL4hg0f7cT4k/l2vXgRKJtYJDk82XlLa3hjZ+hwc90IpSDocwWY/WIWYcGloO0m0Ug6XLsnFAbDrhVWVDOW2X4doEu8uGpn8W9pjUvDv8na7JP1FO86p9VTUHcwUwf5xZuKGe3T3QmWUltvc8Yu+ASezxwOPkwGLHdyxWbVYo4J2ee+3RcDy7KqK5WunXI2XLScW4ijZPeVg9K/tQFg692U0NOGztM=; 25:Cg3p4SnpESVcl/5pm+DFMbjU6jUkWj3VCDPtLwYjzeRzJfxS5tS14pcqN2rHlKrQ++A/ITnfR5W/iCtpYBCu9CFuPXAr3/MseezC/wvqASLfN4TGv1lfr4L9tSAKDLEFi0M9YZ4M90ZwiHvU31r5W5UzCYNi6/fgz9J779qp4E7cqSRCY1xKOPZ79W+Q/zbUFj1weJyqFGNcBJ9Z3TfPTlYp4YzcctonCfpiGR9/hn0/FHnU1DbceamodsJCYYXieJEQ8TpaPrz7NNm2E9urSab9W3uUgfot/d2rq1DvPcjpOOI/IOtLwsQaWcgh7tb3AaMfJ9HiggxmeQwpXxhegA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SN1PR0501MB2125; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2125; 20:WZK/2RjdDad60s6pRTH7x9Pz64K8lPUEtytHT7Eiwxj0l/oiEbtHAcV7g/5o7gyp83cDSvUXPCjclRnU2DnB8yNQ2X0YRIRGJ14sjUx9UwWIjuGlwhTByEdOMsbB0xwBbIr5T2/uQ3nClEs0J5Hw8YA6DIlrViRLLlDdBuAoNQPukchz6aaNXW/GfZCLo8eBTrUQ1L5FlDYtlh4EcODHJsp5aMc5RYNRLWtrm77QBLtYZpqbuJ8ctPcx5W3sm1ds2BamFo9a8FqiAyyarJ0x2LTTN+k5IOk7QP5dfojO09MuEjpN7irwezbY1LvUknvzic4T2nzVth9/Yk1TvthNtoKxGgo9RvUxfx7svqXi8wLyxxkYcfC1WyPGxXUBaJ+vpOzZE2WR8KildiUYEzEizXcVocs2vaAVQYBt3xpdb1k2xGTenxbidyhhTqQ+5qaQfYlOu5p8VCo/FZrm/DAKZtgUp2s2aYxU0wdQnUjeqHMtqcQbNgR7lnU76sGG1lN4 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13017025)(13015025)(5005006)(13023025)(13024025)(13018025)(8121501046)(3002001)(10201501046); SRVR:SN1PR0501MB2125; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0501MB2125; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2125; 4:jJCjWBDl3+Iven11hof5gLFy2mOURDrQHG/RT2EUKdtKB8NjA8qfPIOKtFSstYeOPJPhfKYG9xGuzxFMuFHjNC4BsyMifE4/T36AZmr/+pdgS+6RVbtyd5uz5aw9lllfO7fBZ4jgQp3+YDJ+xhjuQ00E6XY7vAZflWsC6hxlNvf/oRsVmxTuoQJNQKmcLDpNfDrkIuI6fRQfmccCwDrYmF7IBrfzviGUr4PUHYuNNm2S2OaLIxt7DrPtZHAffjcQG+zSEm50wnKAkZliQdPuOKh2lCowpftGp0373mkk/E0uScj+9HHXecRDa1tww4B3ar8lPO5iclYszDbW6kvrjis1HbzyCwx/Uf/i19Amk05lzsMcJNUYhJVtNDfrCpVRbptVq5GZTgR82Ev9/UbalbSKQ5TLMkAV1XAcLYvdMKhmS4YjKBhUb6zcnLb3xZh2M/pqANSm5xn7eYPNWF2lvA== X-Forefront-PRVS: 0884AAA693 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0501MB2125; 23:/W1CQAQruRhmhh1l44UGzl3TOJzwu4tasekhmY/?= =?us-ascii?Q?CjM293NBJGgyBsXDLuIJ6s6Zjpj8I6Pym3Rv1ZTEaiCuSwenIzpQeg3O99Dd?= =?us-ascii?Q?TiH1x0GhedB463wvXkFja20cBpzwKAbn+CHigYNch3GuylHmp0fZxvAB8RZ/?= =?us-ascii?Q?02HEcD1YayvpN1KTCNye+N1B4f/OCsc3z2pOL4Vs4wJuIAIDo6d1h3ZsQIL9?= =?us-ascii?Q?MAZfBeE7kgRyVOJKhLartPY1ykZ9b0NB33oZllkmsxH54Q6HW4heDoQ/p3cg?= =?us-ascii?Q?J2lYe6w8Qfz6jvFRMC2/Yvmbgzr4W8xnbYGreU/lHChoazH7Gc3aETkPSl37?= =?us-ascii?Q?VEYvElKTg1qjO3TN+NwjJswSluA58ubog5zFGc40vNuWx60DdT8oB99x7sEw?= =?us-ascii?Q?n755edd+RrmjGsoPENIpI6tK0yym+GyCQI8bN40wuFXj89cDDvL1Xc8dAno0?= =?us-ascii?Q?FUs9ncebUAT6L27YKyhjFEWyy/USR8dJ3scWFHcyQx+nhmP04fHOcKLSAuMC?= =?us-ascii?Q?IfDY1cwSX5yyZJHt0qAN8FCO7OPs9tMALqkPhDvlZA5iBD6eYo0cHnX6OmZq?= =?us-ascii?Q?k7/ODZgTKt3Efgqg/b3Y/T238BDgBwmb8FhiW8yzql8VuaV3+txWexpmAWNc?= =?us-ascii?Q?+vzkZQ38YaugW6DJWkIifRsNtjB4G9d7rctFLW3L+DCMdsQdBMwX/ZOCzIdH?= =?us-ascii?Q?RK1fcY9+YANKe29QWxEva6uD7vPtwRFUosjdVIhbktFuYFxFlUUcsA9cjPfq?= =?us-ascii?Q?OS4dCnMFY/jlAFGi4AeCSAWXKy7zA0UwmcbAmv+b1jwJCYhf12BQxXVE6QX9?= =?us-ascii?Q?KQ8CsUj37pj4BcFA4y6K37xzTIjFORjjGpuNxZ3Doa+lgA+AtDbrqAuprz3w?= =?us-ascii?Q?m97PHHBG9Ut+itRWUmxkIqsoH9NEoatqqHhBm7pHe5QxfV0YnkPfJeiekhxE?= =?us-ascii?Q?Qw+tbxKpORXnN46t8OJnbDT8V8r61rYGHLPvDg4/fKgW+fZXHzdHJeL40Vjk?= =?us-ascii?Q?PqytYzt5L0Jm92Z03QG+62cPO/elyfDW8VqF8+Cd/2tiIbcbc4cw3WbU0bJd?= =?us-ascii?Q?TnfZOOaiiXxK5jqhOPkq6f5efHV+Qcx4bsOnjcYDbLdyAUqhbykS7RAwaXyc?= =?us-ascii?Q?opEJSabX5lng=3D?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0501MB2125; 5:bR297MuZlRrZiibjNtTKRTegK2FOlCKlxN9N3XUgY8HHAkPpSBO3m42eNZzhV2jZSNVc8QOQlxyelPJGmY+qyWTp5HY+KnYG1DLMXQLmeq6JQRh4bhb3G+e8+hGmN9KUdMjYUKGLnv/LlZRn5XWMYQ==; 24:9cAjOrHPlBbjNSZE20A8wRELUISsJOriJmapJTz/kBd8oh0OUcV5ONQMblAGZzLxBwGy6T3cjHm6OA7/8nRJoo5g9X37lLMhL/XUUyEU1Uo= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2016 04:04:59.5154 (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: SN1PR0501MB2125 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:05:04 -0000 NGie Cooper wrote: > > SUBDIR+= encoder > > > > +.if ${MACHINE} == "host" > > +# make it easy to test without install > > +TESTSDIR= ${.OBJDIR} > > +CFLAGS+= -I${.CURDIR:H} > > +.endif > > + > > .include > > This commit seems unnecessary -- have you tried make check yet? That appears to require installing things before you test that they work - seems a bit backwards? Note the above is only relevant when building with DIRDEPS. Where we want to be able to build and run relevant tests as part of the build as we go - when MACHINE = "host" that is. Phil wants to fix this so that it runs all his test suite properly and also need to arrange to auto-update the makefile here as new tests are added to the distribution. Probably need somthing like bmake's after-import target. Anyway, being able to have this work in context of DIRDEPS_BUILD will help (I haven't added the MK_TESTS hooks yet). From owner-svn-src-head@freebsd.org Thu Mar 17 04:09:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB67CAD3FB8; Thu, 17 Mar 2016 04:09:14 +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 9C8A9D3C; Thu, 17 Mar 2016 04:09:14 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 95A2612FE; Thu, 17 Mar 2016 04:09:14 +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 4F1721F915; Thu, 17 Mar 2016 04:09:14 +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 gb0FYueQPDH8; Thu, 17 Mar 2016 04:09:12 +0000 (UTC) Subject: Re: svn commit: r296967 - in head: contrib/libxo/libxo lib/libxo DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com AB56E1F90F To: Phil Shafer , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201603162350.u2GNofuL068498@repo.freebsd.org> From: Bryan Drewery Organization: FreeBSD Message-ID: <56EA2DD7.10204@FreeBSD.org> Date: Wed, 16 Mar 2016 21:08:55 -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: <201603162350.u2GNofuL068498@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:09:14 -0000 On 3/16/16 4:50 PM, Phil Shafer wrote: > Author: phil > Date: Wed Mar 16 23:50:41 2016 > New Revision: 296967 > URL: https://svnweb.freebsd.org/changeset/base/296967 > > Log: > Move generated file from contrib to build directory. > > Reviewed by: obrien > Approved by: sjg > > Added: > head/lib/libxo/xo_config.h > - copied unchanged from r296966, head/contrib/libxo/libxo/xo_config.h > Deleted: > head/contrib/libxo/libxo/xo_config.h > Modified: > head/lib/libxo/Makefile > > Modified: head/lib/libxo/Makefile > ============================================================================== > --- head/lib/libxo/Makefile Wed Mar 16 23:42:57 2016 (r296966) > +++ head/lib/libxo/Makefile Wed Mar 16 23:50:41 2016 (r296967) > @@ -13,7 +13,7 @@ SHLIB_MAJOR=0 > > SRCS= libxo.c xo_encoder.c xo_syslog.c > > -CFLAGS+=-I${LIBXOSRC}/libxo > +CFLAGS+=-I${LIBXOSRC}/libxo -I${.CURDIR} > CFLAGS+=-DXO_ENCODERDIR=\"/usr/lib/libxo/encoder\" > > INCS= xo.h xo_encoder.h This breaks the build for usr.bin/xo and lib/libxo/tests. https://lists.freebsd.org/pipermail/freebsd-current/2016-March/060181.html -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Thu Mar 17 04:12:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AB151AD21FB; Thu, 17 Mar 2016 04:12:11 +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 9AF7210F; Thu, 17 Mar 2016 04:12:11 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [IPv6:::1]) by freefall.freebsd.org (Postfix) with ESMTP id 947471459; Thu, 17 Mar 2016 04:12:11 +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 5371F1F923; Thu, 17 Mar 2016 04:12:11 +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 EH8g-12kgqS6; Thu, 17 Mar 2016 04:12:04 +0000 (UTC) Subject: Re: svn commit: r296970 - head/lib/libxo/tests DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 395751F91D To: "Simon J. Gerraty" , NGie Cooper References: <201603170037.u2H0b4Rb082849@repo.freebsd.org> <984878F0-9CE9-442D-8F7F-40C5365052AA@gmail.com> <85789.1458187497@kaos.jnpr.net> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Bryan Drewery Organization: FreeBSD Message-ID: <56EA2E93.2020406@FreeBSD.org> Date: Wed, 16 Mar 2016 21:12:03 -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: <85789.1458187497@kaos.jnpr.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:12:11 -0000 On 3/16/16 9:04 PM, Simon J. Gerraty wrote: > NGie Cooper wrote: >>> SUBDIR+= encoder >>> >>> +.if ${MACHINE} == "host" >>> +# make it easy to test without install >>> +TESTSDIR= ${.OBJDIR} >>> +CFLAGS+= -I${.CURDIR:H} >>> +.endif >>> + >>> .include >> >> This commit seems unnecessary -- have you tried make check yet? > > That appears to require installing things before you test that they > work - seems a bit backwards? > > Note the above is only relevant when building with DIRDEPS. > Where we want to be able to build and run relevant tests as part of the > build as we go - when MACHINE = "host" that is. > > Phil wants to fix this so that it runs all his test suite properly and > also need to arrange to auto-update the makefile here as new tests are > added to the distribution. > Probably need somthing like bmake's after-import target. > > Anyway, being able to have this work in context of DIRDEPS_BUILD will > help (I haven't added the MK_TESTS hooks yet). > > Btw I recently hooked up MK_TESTS to DIRDEPS_BUILD and added them all (at the time) to targets/. -- Regards, Bryan Drewery From owner-svn-src-head@freebsd.org Thu Mar 17 04:21:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1502CAD2516; Thu, 17 Mar 2016 04:21:59 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DA483803; Thu, 17 Mar 2016 04:21:58 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H4Lwqf050768; Thu, 17 Mar 2016 04:21:58 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H4Lv8S050766; Thu, 17 Mar 2016 04:21:57 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201603170421.u2H4Lv8S050766@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Thu, 17 Mar 2016 04:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296979 - in head: lib/libxo/tests usr.bin/xo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:21:59 -0000 Author: sjg Date: Thu Mar 17 04:21:57 2016 New Revision: 296979 URL: https://svnweb.freebsd.org/changeset/base/296979 Log: xo_config.h no longer in contrib, so -I's needed PR: /homes/sjg/commit-logs/freebsd/libxo/xo_config.diff Reviewed by: jkim Modified: head/lib/libxo/tests/Makefile head/usr.bin/xo/Makefile Modified: head/lib/libxo/tests/Makefile ============================================================================== --- head/lib/libxo/tests/Makefile Thu Mar 17 03:57:39 2016 (r296978) +++ head/lib/libxo/tests/Makefile Thu Mar 17 04:21:57 2016 (r296979) @@ -240,7 +240,7 @@ PROGS+= test_09 PROGS+= test_10 PROGS+= test_11 -CFLAGS+= -I${LIBXOSRC}/libxo +CFLAGS+= -I${LIBXOSRC}/libxo -I${.CURDIR:H} LIBADD= xo util @@ -249,7 +249,6 @@ SUBDIR+= encoder .if ${MACHINE} == "host" # make it easy to test without install TESTSDIR= ${.OBJDIR} -CFLAGS+= -I${.CURDIR:H} .endif .include Modified: head/usr.bin/xo/Makefile ============================================================================== --- head/usr.bin/xo/Makefile Thu Mar 17 03:57:39 2016 (r296978) +++ head/usr.bin/xo/Makefile Thu Mar 17 04:21:57 2016 (r296979) @@ -12,7 +12,10 @@ MAN= xo.1 # XXX For xoversion.h CFLAGS+=-I${LIBXOSRC}/libxo -LIBADD= xo +# XXX For xo_config.h +CFLAGS+=-I${SRCTOP}/lib/libxo + +LIBADD= xo util .if ${MK_TESTS} != "no" SUBDIR+= tests From owner-svn-src-head@freebsd.org Thu Mar 17 04:29:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35439AD277C; Thu, 17 Mar 2016 04:29:51 +0000 (UTC) (envelope-from delphij@gmail.com) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F2F78B8B; Thu, 17 Mar 2016 04:29:50 +0000 (UTC) (envelope-from delphij@gmail.com) Received: by mail-ig0-x22c.google.com with SMTP id kc10so2772100igb.0; Wed, 16 Mar 2016 21:29:50 -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=gJias83QCcII5JVFAZ0UeJUTgkM/cXjzpUJ/dq37cr8=; b=jOouTyzPBkG0K7yC+dZTb3LCGK9dIuYjk3PrmLLq1C/1Dza+PuSEPa+gi+IR9rqzph T8P7TW10Bn32W9/YWP5ZzxUavASNY28mIrdwkhZ/lg6PmS3ZolP7tEOPQJicaBSjbs07 P46y2axJ/Zg5RQFWKRyJvcZdNi6MNXIHcYXj4VRfuUL/kCilLvBs1BGbElMS9sMtcM1l r+q1H+5E/8Knfo2V0lFIIRRT/NerwvFIEvBnA0ADriR9fC1DLapJhK41PM4v0f3CkYiU sCkmSWBEFIOprMw/ixJHixYIurkj2P6PzLH9FTnIGzm+d2O210QgGzCWnpzRcm+Jov1c QMyQ== 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=gJias83QCcII5JVFAZ0UeJUTgkM/cXjzpUJ/dq37cr8=; b=Hh18Kn6DV871LFf4BDcylmU91YO3HxyBwmCsmh4pi8WdMA/b2XPU1P/yFa2k4rIBVH /6Gn2i9jYBWYaHq9rtvOif1Tz91dytGbtPwoaXTaW7fURxtjxVSuWEnp6qWh/NbZWyM1 SbKyENp3No+MP9/coDXcoH6WCMqAA+m6vrmf1CzkfAoMi6VP60XHYav8NbHxmdrk5UZq n0Jtv/VIj7vTi8legq94gB9Mg59wM1jcIh8zAygKRP1doZ9KIkhyTGqYDQh20w+GB/JA pyNQoD6qiIPPtn3ddxMLDQ9LFaV2htxGQIEb9kNmdj9SeNvuUtiPJeiLwPUkr9DM2t4t Xz8g== X-Gm-Message-State: AD7BkJJXzpqcFUo2evTg5qFFOyonsD05a1GTlRgneljoNcTYAzddVPHw4EREyrRsy+7j93I4xnpieSX+Gv9DHQ== MIME-Version: 1.0 X-Received: by 10.50.160.41 with SMTP id xh9mr2871827igb.91.1458188990242; Wed, 16 Mar 2016 21:29:50 -0700 (PDT) Received: by 10.36.54.207 with HTTP; Wed, 16 Mar 2016 21:29:50 -0700 (PDT) In-Reply-To: References: <201509040014.t840ELno034811@repo.freebsd.org> Date: Wed, 16 Mar 2016 21:29:50 -0700 Message-ID: Subject: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools From: Xin LI To: Alan Somers , Sean Fagan Cc: Xin LI , "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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:29:51 -0000 +sef who created the patch... On Wed, Mar 16, 2016 at 3:40 PM, Alan Somers wrote: > > > On Thu, Sep 3, 2015 at 6:14 PM, Xin LI wrote: >> >> Author: delphij >> Date: Fri Sep 4 00:14:20 2015 >> New Revision: 287445 >> URL: https://svnweb.freebsd.org/changeset/base/287445 >> >> Log: >> Expose an interface to determine if an ACE is inherited. >> >> Submitted by: sef >> Reviewed by: trasz >> MFC after: 2 weeks >> Differential Revision: https://reviews.freebsd.org/D3540 >> >> Modified: >> head/bin/setfacl/setfacl.1 >> head/lib/libc/posix1e/acl_add_flag_np.3 >> head/lib/libc/posix1e/acl_support_nfs4.c >> head/share/man/man9/acl.9 >> head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c >> head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h >> head/sys/kern/subr_acl_nfs4.c >> head/sys/sys/acl.h >> head/tools/regression/acltools/tools-crossfs.test >> head/tools/regression/acltools/tools-nfs4-psarc.test >> head/tools/regression/acltools/tools-nfs4-trivial.test >> head/tools/regression/acltools/tools-nfs4.test > > > ... > >> >> Modified: head/sys/sys/acl.h >> >> ============================================================================== >> --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) >> +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) >> @@ -249,11 +249,12 @@ typedef void *acl_t; >> #define ACL_ENTRY_INHERIT_ONLY 0x0008 >> #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 >> #define ACL_ENTRY_FAILED_ACCESS 0x0020 >> +#define ACL_ENTRY_INHERITED 0x0080 >> >> #define ACL_FLAGS_BITS (ACL_ENTRY_FILE_INHERIT | >> \ >> ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | \ >> ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ >> - ACL_ENTRY_FAILED_ACCESS) >> + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) >> >> /* >> * Undefined value in ae_id field. ae_id should be set to this value > > > Out of curiosity, why did you choose 0x0080 for ACL_ENTRY_INHERITED instead > of 0x0040 ? > -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@freebsd.org Thu Mar 17 04:37:24 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3944AAD2A59 for ; Thu, 17 Mar 2016 04:37:24 +0000 (UTC) (envelope-from sef@ixsystems.com) Received: from barracuda.ixsystems.com (barracuda.ixsystems.com [12.229.62.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.ixsystems.com", Issuer "Go Daddy Secure Certificate Authority - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 132D1F31 for ; Thu, 17 Mar 2016 04:37:23 +0000 (UTC) (envelope-from sef@ixsystems.com) X-ASG-Debug-ID: 1458189442-08ca04178819bd70001-SDoC61 Received: from zimbra.ixsystems.com ([10.246.0.20]) by barracuda.ixsystems.com with ESMTP id ADSRLfCPpqjfJv63 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 21:37:22 -0700 (PDT) X-Barracuda-Envelope-From: sef@ixsystems.com X-Barracuda-RBL-Trusted-Forwarder: 10.246.0.20 X-ASG-Whitelist: Client Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 70776C07E5E; Wed, 16 Mar 2016 21:37:22 -0700 (PDT) Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id G2hYycJrqbsY; Wed, 16 Mar 2016 21:37:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id D8B11C07EB3; Wed, 16 Mar 2016 21:37:21 -0700 (PDT) X-Virus-Scanned: amavisd-new at ixsystems.com Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id XqUNX251xQOX; Wed, 16 Mar 2016 21:37:21 -0700 (PDT) Received: from [192.168.0.115] (173-164-180-199-SFBA.hfc.comcastbusiness.net [173.164.180.199]) by zimbra.ixsystems.com (Postfix) with ESMTPSA id 9C8F5C07E5E; Wed, 16 Mar 2016 21:37:21 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools From: Sean Fagan X-ASG-Orig-Subj: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools In-Reply-To: Date: Wed, 16 Mar 2016 21:37:21 -0700 Cc: Alan Somers , Xin LI , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <201509040014.t840ELno034811@repo.freebsd.org> To: Xin LI X-Mailer: Apple Mail (2.3112) X-Barracuda-Connect: UNKNOWN[10.246.0.20] X-Barracuda-Start-Time: 1458189442 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://10.246.0.26:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ixsystems.com X-Barracuda-BRTS-Status: 1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:37:24 -0000 As I recall, from ZFS, but I=E2=80=99m not positive. Either that, or = something else was using 0x40. Sean. > On Mar 16, 2016, at 9:29 PM, Xin LI wrote: >=20 > +sef who created the patch... >=20 > On Wed, Mar 16, 2016 at 3:40 PM, Alan Somers = wrote: >>=20 >>=20 >> On Thu, Sep 3, 2015 at 6:14 PM, Xin LI wrote: >>>=20 >>> Author: delphij >>> Date: Fri Sep 4 00:14:20 2015 >>> New Revision: 287445 >>> URL: https://svnweb.freebsd.org/changeset/base/287445 >>>=20 >>> Log: >>> Expose an interface to determine if an ACE is inherited. >>>=20 >>> Submitted by: sef >>> Reviewed by: trasz >>> MFC after: 2 weeks >>> Differential Revision: https://reviews.freebsd.org/D3540 >>>=20 >>> Modified: >>> head/bin/setfacl/setfacl.1 >>> head/lib/libc/posix1e/acl_add_flag_np.3 >>> head/lib/libc/posix1e/acl_support_nfs4.c >>> head/share/man/man9/acl.9 >>> head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c >>> head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h >>> head/sys/kern/subr_acl_nfs4.c >>> head/sys/sys/acl.h >>> head/tools/regression/acltools/tools-crossfs.test >>> head/tools/regression/acltools/tools-nfs4-psarc.test >>> head/tools/regression/acltools/tools-nfs4-trivial.test >>> head/tools/regression/acltools/tools-nfs4.test >>=20 >>=20 >> ... >>=20 >>>=20 >>> Modified: head/sys/sys/acl.h >>>=20 >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D >>> --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) >>> +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) >>> @@ -249,11 +249,12 @@ typedef void *acl_t; >>> #define ACL_ENTRY_INHERIT_ONLY 0x0008 >>> #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 >>> #define ACL_ENTRY_FAILED_ACCESS 0x0020 >>> +#define ACL_ENTRY_INHERITED 0x0080 >>>=20 >>> #define ACL_FLAGS_BITS = (ACL_ENTRY_FILE_INHERIT | >>> \ >>> ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | \ >>> ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ >>> - ACL_ENTRY_FAILED_ACCESS) >>> + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) >>>=20 >>> /* >>> * Undefined value in ae_id field. ae_id should be set to this = value >>=20 >>=20 >> Out of curiosity, why did you choose 0x0080 for ACL_ENTRY_INHERITED = instead >> of 0x0040 ? >>=20 >=20 >=20 >=20 > --=20 > Xin LI https://www.delphij.net/ > FreeBSD - The Power to Serve! Live free or die From owner-svn-src-head@freebsd.org Thu Mar 17 04:46:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 50685AD2D74; Thu, 17 Mar 2016 04:46:19 +0000 (UTC) (envelope-from sjg@juniper.net) Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0135.outbound.protection.outlook.com [207.46.100.135]) (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 8F5CA6BE; Thu, 17 Mar 2016 04:46:17 +0000 (UTC) (envelope-from sjg@juniper.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=junipernetworks.onmicrosoft.com; s=selector1-juniper-net; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+dG63z3XjCsiRtBAOSn7K0CpKWWwN/9/O06r3w9uqOE=; b=blq/bc+veSjiT3Wj5vPwPm2ALhiMnyPyIGL+Q+HDK8oX61dV59u6YyhYRfNMIa29PqQRNQgZKzSQHftV01iuhFHndbd8SDUayBk9xyvu5iK6Mjq1lvBch9F16qfEa8+y2PdI1FnCSkojUN8bb2L4/o7SZRM5vV0JDx/kWvaDO3s= Received: from SN1PR0501CA0016.namprd05.prod.outlook.com (10.163.126.154) by CY1PR0501MB1161.namprd05.prod.outlook.com (10.160.144.155) with Microsoft SMTP Server (TLS) id 15.1.434.16; Thu, 17 Mar 2016 04:30:43 +0000 Received: from BL2FFO11FD027.protection.gbl (2a01:111:f400:7c09::180) by SN1PR0501CA0016.outlook.office365.com (2a01:111:e400:52fe::26) with Microsoft SMTP Server (TLS) id 15.1.443.12 via Frontend Transport; Thu, 17 Mar 2016 04:30:42 +0000 Authentication-Results: spf=softfail (sender IP is 66.129.239.19) smtp.mailfrom=juniper.net; freebsd.org; dkim=none (message not signed) header.d=none;freebsd.org; dmarc=none action=none header.from=juniper.net; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning juniper.net discourages use of 66.129.239.19 as permitted sender) Received: from p-emfe01b-sac.jnpr.net (66.129.239.19) by BL2FFO11FD027.mail.protection.outlook.com (10.173.161.106) with Microsoft SMTP Server (TLS) id 15.1.434.11 via Frontend Transport; Thu, 17 Mar 2016 04:30:41 +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; Wed, 16 Mar 2016 21:30:40 -0700 Received: from kaos.jnpr.net (kaos.jnpr.net [172.21.16.84]) by magenta.juniper.net (8.11.3/8.11.3) with ESMTP id u2H4UdD95809; Wed, 16 Mar 2016 21:30:39 -0700 (PDT) (envelope-from sjg@juniper.net) Received: from kaos.jnpr.net (localhost [127.0.0.1]) by kaos.jnpr.net (Postfix) with ESMTP id A5A94385532; Wed, 16 Mar 2016 21:30:39 -0700 (PDT) To: Bryan Drewery CC: NGie Cooper , , , , Subject: Re: svn commit: r296970 - head/lib/libxo/tests In-Reply-To: <56EA2E93.2020406@FreeBSD.org> References: <201603170037.u2H0b4Rb082849@repo.freebsd.org> <984878F0-9CE9-442D-8F7F-40C5365052AA@gmail.com> <85789.1458187497@kaos.jnpr.net> <56EA2E93.2020406@FreeBSD.org> Comments: In-reply-to: Bryan Drewery message dated "Wed, 16 Mar 2016 21:12:03 -0700." From: "Simon J. Gerraty" X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.5.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <86202.1458189039.1@kaos.jnpr.net> Date: Wed, 16 Mar 2016 21:30:39 -0700 Message-ID: <86203.1458189039@kaos.jnpr.net> 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)(24454002)(11100500001)(4326007)(2906002)(1096002)(87936001)(6806005)(50986999)(1220700001)(2810700001)(5008740100001)(76176999)(46406003)(86362001)(76506005)(586003)(53416004)(97756001)(106466001)(23726003)(47776003)(105596002)(81166005)(117636001)(107886002)(110136002)(189998001)(77096005)(2950100001)(93886004)(92566002)(4001430100002)(19580405001)(50226001)(50466002)(19580395003)(5003600100002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0501MB1161; H:p-emfe01b-sac.jnpr.net; FPR:; SPF:SoftFail; MLV:sfv; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD027; 1:xU6OEnUo8YT22ZQSO0x1t1aFDkYHm7rB/u7lbQpHMdKRW/ZsuFfLVWOayiTGLQfWPWDNwuC1N/QVN+rAadS+UFkwzCXH7ifDXwf4cgnA94n94qGWZzy2/5vrrhmsKxt+z0FmwPqRmqd9IHVtcy5Wd7x/xgl0UZevdB+JFuQ3MKZzh5lvqmvzdGsNVgDP8RRRNiqQnTq3nDIBXqSyw/cc/0XoKlmp/bnfNys88+al6O69QGUmWHrwojACAgGbvfe7xAjRBiCAIucLDZVmO7MdN29M1gZmjDB0+pWUVMA0S6IQh+nHc1IdWuyx0Md4T4VY1m191RWtJcdtX2F60zYUtlWm23HU7eQis7lSGFXzMmStF3rSuHKIybTcgH6pH1X3fFMRbhGZv1cr4mTVMIsWWk3DXEnl0HH3w43dz08o47N6an8rZnIZ28wsBejyFUDN X-MS-Office365-Filtering-Correlation-Id: d1a1c061-4412-414e-c9d6-08d34e1ce6b1 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1161; 2:wn9mEtmbmUOx7bGydCAjXjjfRM+lJvhgaP2+03W9ZekiPY6b4GPgn/OIXOIODUyVHbgCQb5e2LX838wsw7hdRo5RUWeFqm1sZXQ5Ce1zt9FjrfkPYefe/0p7gjxfctREa0xid4sGkHDQA9+Hj61LoHLSML2JuddOQJeyn7a7rrhWIg6Ln9nhtAHdxkbHPo6a; 3:Go3hNwcSi0Eljz0Wx+VkQz87Xp5xS5l6NVFpBETmDZ6gm9HvfCOA5CqMjrxz7InqgZf5gG7OyfZcxCp+bZpMyw42JKvDqLxq3LWxK1KZM+VrM6/fANP3zdSHkFT6VslSRhUJp9ob6kPB1pqRt19FJWQ5YlT3UkdSpNgOLrvLYlS5ckDKA9OQ9pOu66xSPWSsuzc9MeXSD3LdfLEGpyoRhIgMANPYNhdyWxFlqo5FiVU=; 25:l6J++EkHM+8JOM6SJkFhkezAtJ7H1izyIoof1YlwTjhSvPtkM1XNcr4Qvp9G88riJyHCsrLaGZ54UzmwDRPtQnKZkJphf2U6egnlAvUF3g1S1LuVMX3duSHUeW1QZLkVAcuBn8Bq0ae6TNoiCReVOS4ea1SxxpcDoU9k93ppszV+Fa7vZAcEvnXiAB/2tWVCBwc+9Wsd8jHLOWWSAlU4746w3XQ5szQv84JbF9xHE2UpnE1NKCba0S/TyEqLMqjJvd3QSeV0Sy418xUwNM3iUjGZpyq3FHn0X6LOWyAuj9XeKc4WBrt8pHy9MdvGpxRc X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0501MB1161; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1161; 20:hvfy2dzTHEToo7DRHI1JqipcPQORUdnG7DW1ZKtZ68as1gqcaOoRbGpcljcvawygvLYIeIPBOGAlw7x9nwyy+KCdeeiwEA2lR127YLORbXUB7dLTaNvhIH3pgD1rJ6Qh9WufN4hDQG8iyMXokY3MKqedSNd0sV5prnVqx+ws2r9+ZaZxQrtiZ92sEF8PNMBXOmZMG0R3yqKLC36wdtD29QrSB6C9O6DaSEUokJ73HhwZVOoTCnClUIytrvd+aZvCn98RYEfz1eEMgf9uplHDK1gTUvgafMIUGQ9/k893UC9Ff0qr9XjQaAIovU1dRUbjJw5y3x0qEZJvASp9ag2xGu1TEjBUjPzcmKJJfdcEhbHIHgvmJuyo6jbQuHA6xN4jeQXc4dVngGiVk7Sa6EIntVt5ilXxBd4WhsHKQRYcs3qjoqUNAuOxw1F0OnqhvtopwGIe8wEOWkAQ5hxNogoJm7cNu86mIsQ4FPCp2/3nUh1G3csF09OYBWtZZUjdGfh+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13015025)(13018025)(13024025)(13023025)(5005006)(13017025)(8121501046)(3002001)(10201501046); SRVR:CY1PR0501MB1161; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0501MB1161; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1161; 4:QlMo7+HPQck9WOEoECg2I2zq3hwJhGg284JqeRVQNLbcuuNS5vgguyW448ECjXVh5LEp1VMayWzN0WqbWjJbgD82OkcS/lPdYPJI268UI24dkybW2D8kWjWrbW79As71ud40Hr9Mu7JzkYyyFyMEZ4QlD85TDjm9/utX546xQUwnvHnsoIHJsjLW+iTL/X/unVG88+um76cIXfxEWPYO+XDuWQVw8MElJlTMjLqpB/uKaJge4DnjxMlLGJsCDyj8Oy42m1oGG12vbxeprdWDdMSCx80WjHdCuZKkGJ5RSYfG/QGZ+q2DL9aYnXxGEpsy4+XzWAaKMpVan6GN2hhKYO6mWySBQPcX/nj1BDkJBk3kmmd41XN3JvH3WEnAKGtYj6fieK00IPSEAcncevzH+vk5lgjFvji6N/uWCdHXR997kTR7OW8rjpbeu15/5ngR9xDECq7mLWV84Qc6P99xLw== X-Forefront-PRVS: 0884AAA693 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0501MB1161; 23:R6yFYKxtOBRFZzvoMwTrENaKNhYnr1ZSTtm6lxm?= =?us-ascii?Q?uaQgLlRlHP1zHgGZq2ITPhikzxIhQd2PaDnyU3RGGlnt//b502Wp1CBtiBMi?= =?us-ascii?Q?vNKy8SomgxNvVWJu6u2ZLk8/ubjwrZ+QZQJVoeBQdSX7UTlrONyxfp20CxsC?= =?us-ascii?Q?XdX4D082sZhJnlH64xYVJZ7jScj0MbmXFcNYqmA3hNhB+tY8cP1AQSwzR/fk?= =?us-ascii?Q?2A4zRW9OwkyhiCWXp3NsesPqVMGxFGbwu5tWbB2RI6f/ucC3xSRh/ZOASYgT?= =?us-ascii?Q?dUXvR3sWFAG72iLtNncd3ycvgwFDTjGzzzMJrRmJdykxMFQZASdVgRG/jIn7?= =?us-ascii?Q?I5VTZOo68QUxYwjS0AWk473vw1fSprOQ+oB3CtkAV/+7UcYOlT1fLLjeVz5L?= =?us-ascii?Q?3J7ffewGNkE+spsKD6JUdrD0hqyPlcuFnOLsZ6hGuHUixy3Xi2WfGnyW4ifC?= =?us-ascii?Q?nTYLi8b10abWxAlOr9kqw0LsX9X7ewUtgcveiLtEQFf7Kn2KdmtdWSacYG69?= =?us-ascii?Q?1sAuQGIW7tcsuZy+vRz8X1LIUcF5MKarCnsAJboH8sA/PZrM5aIU4JJIJF05?= =?us-ascii?Q?fcY4vhKVqyigocm5K7N+Seyyn7hiXWX+2z2KYCKUJrwWf9MmNDor6UrSzKVA?= =?us-ascii?Q?UEJS1uwF8P9+u1pUXmJ9Qnab6L3PSkoZXhgDmjiXOQTXJLSwvl7hvAxGVYqR?= =?us-ascii?Q?iVw5cthwDTTc7qOeihLP7UVKho3nqJT9b4u+N35JcReU0I2bf0Csiq33qT9r?= =?us-ascii?Q?lYI0RXcl1ZhY0ZnObhL3+sCG2jdHJclt+1RRB8ea+tpztIVlpdtkqSaO5/7H?= =?us-ascii?Q?dKMi4YKyq9qjnzFR3JtpYhWTbcsu4sbhy9TduJ1VkArwPTCXYc1VvWZrgUHP?= =?us-ascii?Q?uWxQZK9hODLAjjFnxre5dRHLEebyonip+rXGyDnik6xCHieDKNa4BaX/FoGw?= =?us-ascii?Q?YkCuH0U8c/4Ax5VmzO26K/TvPXrNPoX3Bs7p48xhgHT/Y2ofY1hUEWBl0lyf?= =?us-ascii?Q?MH4T22TR+TpyQXRdJ+pYk0GP0pW1MGJWpy8GTeO1Z01lM5N0GZWySVz4tann?= =?us-ascii?Q?xJV/SH9YLylzDlySPplhIEHIIg03eeMfWiyc5LQ94b18sSCCfEA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0501MB1161; 5:qJzzQZhm/0G0DR192jk1bQrbZqyQ18dOhMhDYAwtTLZhXhlID1PwMG34gEqwJdv14O06Wa7hi2RFlndhf+itan1D1XIVMdS79B914peYOjJaRaMQLG7iv3CozYpT/SYJiB1VOMuGHoohfuKS8N7h6g==; 24:BxvCds1ZR5j+6B2zIw3H+R/XuUJv04Wdc1ZKiqepS7CJ7/PrObY5j++t+fS6pFtzBZ46lQ/tPuKuFCedCfxcMngcoAxmaI/qOYgtSzGnnXc= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: juniper.net X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Mar 2016 04:30:41.8033 (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: CY1PR0501MB1161 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:46:19 -0000 Bryan Drewery wrote: > Btw I recently hooked up MK_TESTS to DIRDEPS_BUILD and added them all > (at the time) to targets/. Hmm how did you do that? In our build local.dirdeps.mk checks each DEP_RELDIR to see if there is a tests/Makefile.depend.host below it, and if so adds it to the dependency graph - but not to the dependencies of DEP_RELDIR - which could introduced circular dependencies. [It also has to check if ${DEP_RELDIR}/tests is listed as broken for the current host os - not all tests can run on all build hosts] Thus we build all the tests (and only the tests) relevant to what we are building. And since when building tests for "host" we run them immediately, if any fail the build fails. Hooking all the tests into a tests target is useful too of course. From owner-svn-src-head@freebsd.org Thu Mar 17 04:55:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 287C1AD3060; Thu, 17 Mar 2016 04:55:47 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ob0-x22e.google.com (mail-ob0-x22e.google.com [IPv6:2607:f8b0:4003:c01::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 D0929AAA; Thu, 17 Mar 2016 04:55:46 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ob0-x22e.google.com with SMTP id m7so72454232obh.3; Wed, 16 Mar 2016 21:55:46 -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=kA0HEdGYXEu+pu2+WIQaWW9QTNmhXK9AoifDg0OGkt0=; b=o6mRltbH0/5McGoz/1HsTDxwGiVWkVAtJFRekkYtDTCvNsMRLDF8Sqou8GfGuaF2ZF 4NGYIrVSTJqtURumSUsIFKVuSzWn5DwTHp+F4IFg6aSzVzIMjY72gzPdPKDboIdHtPVp 36/Et1ETgNmycQJ2Cl+uDnqoH2lNllWTzWEIltnNzn01PLAUWyjS9zR5BL/AG/QpxbJr aBD5wYlbUqiTlkyUf2JlkWH9YpPJRNhKRmOsmQrVhXqU0GkJ8+hP+onFTx+55JboJDJU 1PxwgVUvMIMmk4g9Yaam5Zoj0F16c1cp3JYMGCzSrPr7OcIneCqAnZmtbHrBJBdEU9SN +3JQ== 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=kA0HEdGYXEu+pu2+WIQaWW9QTNmhXK9AoifDg0OGkt0=; b=KBWYto25UgnhG35AGhEipsXZhe6QQWolJhWQSrgw38OWMWoo8sYitVAEIqHphYmL4O xkKp6kc3DQxH4cehYbSltmg+wd0bYlQEHOEXgXbsXnfiPiP25vjCwgDKRXLBI5wsV2VW 8md+6llAav87siZuWIV6PYzIZL5S6OzWPMQQjjmNJ1ClFRSoW6HkVAYXL1PZ0j01uNbK EfAIryOAs+edUwEvKqbaOjYBAKgU0WU+3DR1d8c0sVeWz0iZmQ4uiXMYwUrI0fRJdGQU veHiyd/3oYCNqyQC8dAVlfalwg4lIkrfvPkIyGKmyBJdKByRzk0Cke/WQinAKJFJR2gt Jyvw== X-Gm-Message-State: AD7BkJInQKarLrglCLZvjYDxoulujH1TClCNmZglrXiJdf1KTCcPgdg3uXBj0iIK4DLKBDIfbHFwVE4wUvjJuA== MIME-Version: 1.0 X-Received: by 10.182.66.169 with SMTP id g9mr4739304obt.49.1458190546055; Wed, 16 Mar 2016 21:55:46 -0700 (PDT) Sender: asomers@gmail.com Received: by 10.202.64.138 with HTTP; Wed, 16 Mar 2016 21:55:45 -0700 (PDT) In-Reply-To: References: <201509040014.t840ELno034811@repo.freebsd.org> Date: Wed, 16 Mar 2016 22:55:45 -0600 X-Google-Sender-Auth: e9JOjh0UpEdR7jN-9vhMJ9-P0bI Message-ID: Subject: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools From: Alan Somers To: Sean Fagan Cc: Xin LI , Xin LI , "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-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:55:47 -0000 Do you happen to know if ACL_ENTRY_INHERITED is written to disk, or does it only exist in-core? On Wed, Mar 16, 2016 at 10:37 PM, Sean Fagan wrote: > As I recall, from ZFS, but I=E2=80=99m not positive. Either that, or som= ething > else was using 0x40. > > Sean. > > On Mar 16, 2016, at 9:29 PM, Xin LI wrote: > > > > +sef who created the patch... > > > > On Wed, Mar 16, 2016 at 3:40 PM, Alan Somers > wrote: > >> > >> > >> On Thu, Sep 3, 2015 at 6:14 PM, Xin LI wrote: > >>> > >>> Author: delphij > >>> Date: Fri Sep 4 00:14:20 2015 > >>> New Revision: 287445 > >>> URL: https://svnweb.freebsd.org/changeset/base/287445 > >>> > >>> Log: > >>> Expose an interface to determine if an ACE is inherited. > >>> > >>> Submitted by: sef > >>> Reviewed by: trasz > >>> MFC after: 2 weeks > >>> Differential Revision: https://reviews.freebsd.org/D3540 > >>> > >>> Modified: > >>> head/bin/setfacl/setfacl.1 > >>> head/lib/libc/posix1e/acl_add_flag_np.3 > >>> head/lib/libc/posix1e/acl_support_nfs4.c > >>> head/share/man/man9/acl.9 > >>> head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c > >>> head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h > >>> head/sys/kern/subr_acl_nfs4.c > >>> head/sys/sys/acl.h > >>> head/tools/regression/acltools/tools-crossfs.test > >>> head/tools/regression/acltools/tools-nfs4-psarc.test > >>> head/tools/regression/acltools/tools-nfs4-trivial.test > >>> head/tools/regression/acltools/tools-nfs4.test > >> > >> > >> ... > >> > >>> > >>> Modified: head/sys/sys/acl.h > >>> > >>> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > >>> --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) > >>> +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) > >>> @@ -249,11 +249,12 @@ typedef void *acl_t; > >>> #define ACL_ENTRY_INHERIT_ONLY 0x0008 > >>> #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 > >>> #define ACL_ENTRY_FAILED_ACCESS 0x0020 > >>> +#define ACL_ENTRY_INHERITED 0x0080 > >>> > >>> #define ACL_FLAGS_BITS (ACL_ENTRY_FILE_INHERI= T > | > >>> \ > >>> ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | \ > >>> ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ > >>> - ACL_ENTRY_FAILED_ACCESS) > >>> + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) > >>> > >>> /* > >>> * Undefined value in ae_id field. ae_id should be set to this value > >> > >> > >> Out of curiosity, why did you choose 0x0080 for ACL_ENTRY_INHERITED > instead > >> of 0x0040 ? > >> > > > > > > > > -- > > Xin LI https://www.delphij.net/ > > FreeBSD - The Power to Serve! Live free or die > > From owner-svn-src-head@freebsd.org Thu Mar 17 04:58:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 177DDAD313D for ; Thu, 17 Mar 2016 04:58:09 +0000 (UTC) (envelope-from sef@ixsystems.com) Received: from barracuda.ixsystems.com (barracuda.ixsystems.com [12.229.62.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.ixsystems.com", Issuer "Go Daddy Secure Certificate Authority - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E77C0C42 for ; Thu, 17 Mar 2016 04:58:08 +0000 (UTC) (envelope-from sef@ixsystems.com) X-ASG-Debug-ID: 1458190687-08ca04178819c010001-SDoC61 Received: from zimbra.ixsystems.com ([10.246.0.20]) by barracuda.ixsystems.com with ESMTP id xpFDwAvWUGd7GyJk (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 16 Mar 2016 21:58:07 -0700 (PDT) X-Barracuda-Envelope-From: sef@ixsystems.com X-Barracuda-RBL-Trusted-Forwarder: 10.246.0.20 X-ASG-Whitelist: Client Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id CB2B0C07E34; Wed, 16 Mar 2016 21:58:07 -0700 (PDT) Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id lry0NW38JLVb; Wed, 16 Mar 2016 21:58:07 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.ixsystems.com (Postfix) with ESMTP id 522FEC07ED4; Wed, 16 Mar 2016 21:58:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at ixsystems.com Received: from zimbra.ixsystems.com ([127.0.0.1]) by localhost (zimbra.ixsystems.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id KrXRE-SuLsfu; Wed, 16 Mar 2016 21:58:07 -0700 (PDT) Received: from [192.168.0.115] (173-164-180-199-SFBA.hfc.comcastbusiness.net [173.164.180.199]) by zimbra.ixsystems.com (Postfix) with ESMTPSA id 12C32C07E34; Wed, 16 Mar 2016 21:58:07 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Subject: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools From: Sean Fagan X-ASG-Orig-Subj: Re: svn commit: r287445 - in head: bin/setfacl lib/libc/posix1e share/man/man9 sys/cddl/compat/opensolaris/kern sys/cddl/contrib/opensolaris/uts/common/sys sys/kern sys/sys tools/regression/acltools In-Reply-To: Date: Wed, 16 Mar 2016 21:58:06 -0700 Cc: Xin LI , Xin LI , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: <60D491D1-0326-4890-8D5E-622F7AAC67BD@ixsystems.com> References: <201509040014.t840ELno034811@repo.freebsd.org> To: Alan Somers X-Mailer: Apple Mail (2.3112) X-Barracuda-Connect: UNKNOWN[10.246.0.20] X-Barracuda-Start-Time: 1458190687 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://10.246.0.26:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at ixsystems.com X-Barracuda-BRTS-Status: 1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 04:58:09 -0000 It=E2=80=99s written to disk. Although that actually depends on the = filesystem. Sean. > On Mar 16, 2016, at 9:55 PM, Alan Somers wrote: >=20 > Do you happen to know if ACL_ENTRY_INHERITED is written to disk, or = does it only exist in-core? >=20 > On Wed, Mar 16, 2016 at 10:37 PM, Sean Fagan = wrote: > As I recall, from ZFS, but I=E2=80=99m not positive. Either that, or = something else was using 0x40. >=20 > Sean. > > On Mar 16, 2016, at 9:29 PM, Xin LI wrote: > > > > +sef who created the patch... > > > > On Wed, Mar 16, 2016 at 3:40 PM, Alan Somers = wrote: > >> > >> > >> On Thu, Sep 3, 2015 at 6:14 PM, Xin LI wrote: > >>> > >>> Author: delphij > >>> Date: Fri Sep 4 00:14:20 2015 > >>> New Revision: 287445 > >>> URL: https://svnweb.freebsd.org/changeset/base/287445 > >>> > >>> Log: > >>> Expose an interface to determine if an ACE is inherited. > >>> > >>> Submitted by: sef > >>> Reviewed by: trasz > >>> MFC after: 2 weeks > >>> Differential Revision: https://reviews.freebsd.org/D3540 > >>> > >>> Modified: > >>> head/bin/setfacl/setfacl.1 > >>> head/lib/libc/posix1e/acl_add_flag_np.3 > >>> head/lib/libc/posix1e/acl_support_nfs4.c > >>> head/share/man/man9/acl.9 > >>> head/sys/cddl/compat/opensolaris/kern/opensolaris_acl.c > >>> head/sys/cddl/contrib/opensolaris/uts/common/sys/acl.h > >>> head/sys/kern/subr_acl_nfs4.c > >>> head/sys/sys/acl.h > >>> head/tools/regression/acltools/tools-crossfs.test > >>> head/tools/regression/acltools/tools-nfs4-psarc.test > >>> head/tools/regression/acltools/tools-nfs4-trivial.test > >>> head/tools/regression/acltools/tools-nfs4.test > >> > >> > >> ... > >> > >>> > >>> Modified: head/sys/sys/acl.h > >>> > >>> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > >>> --- head/sys/sys/acl.h Thu Sep 3 22:15:56 2015 (r287444) > >>> +++ head/sys/sys/acl.h Fri Sep 4 00:14:20 2015 (r287445) > >>> @@ -249,11 +249,12 @@ typedef void *acl_t; > >>> #define ACL_ENTRY_INHERIT_ONLY 0x0008 > >>> #define ACL_ENTRY_SUCCESSFUL_ACCESS 0x0010 > >>> #define ACL_ENTRY_FAILED_ACCESS 0x0020 > >>> +#define ACL_ENTRY_INHERITED 0x0080 > >>> > >>> #define ACL_FLAGS_BITS = (ACL_ENTRY_FILE_INHERIT | > >>> \ > >>> ACL_ENTRY_DIRECTORY_INHERIT | ACL_ENTRY_NO_PROPAGATE_INHERIT | = \ > >>> ACL_ENTRY_INHERIT_ONLY | ACL_ENTRY_SUCCESSFUL_ACCESS | \ > >>> - ACL_ENTRY_FAILED_ACCESS) > >>> + ACL_ENTRY_FAILED_ACCESS | ACL_ENTRY_INHERITED) > >>> > >>> /* > >>> * Undefined value in ae_id field. ae_id should be set to this = value > >> > >> > >> Out of curiosity, why did you choose 0x0080 for ACL_ENTRY_INHERITED = instead > >> of 0x0040 ? > >> > > > > > > > > -- > > Xin LI https://www.delphij.net/ > > FreeBSD - The Power to Serve! Live free or die >=20 >=20 From owner-svn-src-head@freebsd.org Thu Mar 17 06:23:49 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B6E5FAD3C3B; Thu, 17 Mar 2016 06:23:49 +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 80F726D9; Thu, 17 Mar 2016 06:23:49 +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 u2H6Nm0m088895; Thu, 17 Mar 2016 06:23:48 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H6NmGG088892; Thu, 17 Mar 2016 06:23:48 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603170623.u2H6NmGG088892@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 17 Mar 2016 06:23:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296980 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 06:23:49 -0000 Author: loos Date: Thu Mar 17 06:23:48 2016 New Revision: 296980 URL: https://svnweb.freebsd.org/changeset/base/296980 Log: Fixes a few style(9) issues, remove extra blank lines. No functional changes. Sponsored by: Rubicon Comunications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Mar 17 04:21:57 2016 (r296979) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Mar 17 06:23:48 2016 (r296980) @@ -148,8 +148,7 @@ static int cpsw_stats_sysctl(SYSCTL_HAND * Packets with more segments than this will be defragmented before * they are queued. */ -#define CPSW_TXFRAGS 8 - +#define CPSW_TXFRAGS 8 /* * TODO: The CPSW subsystem (CPSW_SS) can drive two independent PHYs @@ -251,7 +250,7 @@ static struct cpsw_stat { * Basic debug support. */ -#define IF_DEBUG(sc) if (sc->cpsw_if_flags & IFF_DEBUG) +#define IF_DEBUG(sc) if (sc->cpsw_if_flags & IFF_DEBUG) static void cpsw_debugf_head(const char *funcname) @@ -274,35 +273,34 @@ cpsw_debugf(const char *fmt, ...) } -#define CPSW_DEBUGF(a) do { \ - IF_DEBUG(sc) { \ - cpsw_debugf_head(__func__); \ - cpsw_debugf a; \ - } \ +#define CPSW_DEBUGF(a) do { \ + IF_DEBUG(sc) { \ + cpsw_debugf_head(__func__); \ + cpsw_debugf a; \ + } \ } while (0) - /* * Locking macros */ -#define CPSW_TX_LOCK(sc) do { \ +#define CPSW_TX_LOCK(sc) do { \ mtx_assert(&(sc)->rx.lock, MA_NOTOWNED); \ mtx_lock(&(sc)->tx.lock); \ } while (0) -#define CPSW_TX_UNLOCK(sc) mtx_unlock(&(sc)->tx.lock) -#define CPSW_TX_LOCK_ASSERT(sc) mtx_assert(&(sc)->tx.lock, MA_OWNED) +#define CPSW_TX_UNLOCK(sc) mtx_unlock(&(sc)->tx.lock) +#define CPSW_TX_LOCK_ASSERT(sc) mtx_assert(&(sc)->tx.lock, MA_OWNED) -#define CPSW_RX_LOCK(sc) do { \ +#define CPSW_RX_LOCK(sc) do { \ mtx_assert(&(sc)->tx.lock, MA_NOTOWNED); \ mtx_lock(&(sc)->rx.lock); \ } while (0) -#define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx.lock) -#define CPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx.lock, MA_OWNED) +#define CPSW_RX_UNLOCK(sc) mtx_unlock(&(sc)->rx.lock) +#define CPSW_RX_LOCK_ASSERT(sc) mtx_assert(&(sc)->rx.lock, MA_OWNED) -#define CPSW_GLOBAL_LOCK(sc) do { \ - if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) != \ +#define CPSW_GLOBAL_LOCK(sc) do { \ + if ((mtx_owned(&(sc)->tx.lock) ? 1 : 0) != \ (mtx_owned(&(sc)->rx.lock) ? 1 : 0)) { \ panic("cpsw deadlock possibility detection!"); \ } \ @@ -310,12 +308,12 @@ cpsw_debugf(const char *fmt, ...) mtx_lock(&(sc)->rx.lock); \ } while (0) -#define CPSW_GLOBAL_UNLOCK(sc) do { \ - CPSW_RX_UNLOCK(sc); \ - CPSW_TX_UNLOCK(sc); \ +#define CPSW_GLOBAL_UNLOCK(sc) do { \ + CPSW_RX_UNLOCK(sc); \ + CPSW_TX_UNLOCK(sc); \ } while (0) -#define CPSW_GLOBAL_LOCK_ASSERT(sc) do { \ +#define CPSW_GLOBAL_LOCK_ASSERT(sc) do { \ CPSW_TX_LOCK_ASSERT(sc); \ CPSW_RX_LOCK_ASSERT(sc); \ } while (0) @@ -328,7 +326,7 @@ cpsw_debugf(const char *fmt, ...) #define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16)) -#define cpsw_cpdma_bd_paddr(sc, slot) \ +#define cpsw_cpdma_bd_paddr(sc, slot) \ BUS_SPACE_PHYSADDR(sc->mem_res, slot->bd_offset) #define cpsw_cpdma_read_bd(sc, slot, val) \ bus_read_region_4(sc->mem_res, slot->bd_offset, (uint32_t *) val, 4) @@ -336,16 +334,16 @@ cpsw_debugf(const char *fmt, ...) bus_write_region_4(sc->mem_res, slot->bd_offset, (uint32_t *) val, 4) #define cpsw_cpdma_write_bd_next(sc, slot, next_slot) \ cpsw_write_4(sc, slot->bd_offset, cpsw_cpdma_bd_paddr(sc, next_slot)) -#define cpsw_cpdma_read_bd_flags(sc, slot) \ +#define cpsw_cpdma_read_bd_flags(sc, slot) \ bus_read_2(sc->mem_res, slot->bd_offset + 14) #define cpsw_write_hdp_slot(sc, queue, slot) \ cpsw_write_4(sc, (queue)->hdp_offset, cpsw_cpdma_bd_paddr(sc, slot)) #define CP_OFFSET (CPSW_CPDMA_TX_CP(0) - CPSW_CPDMA_TX_HDP(0)) -#define cpsw_read_cp(sc, queue) \ +#define cpsw_read_cp(sc, queue) \ cpsw_read_4(sc, (queue)->hdp_offset + CP_OFFSET) -#define cpsw_write_cp(sc, queue, val) \ +#define cpsw_write_cp(sc, queue, val) \ cpsw_write_4(sc, (queue)->hdp_offset + CP_OFFSET, (val)) -#define cpsw_write_cp_slot(sc, queue, slot) \ +#define cpsw_write_cp_slot(sc, queue, slot) \ cpsw_write_cp(sc, queue, cpsw_cpdma_bd_paddr(sc, slot)) #if 0 @@ -403,13 +401,12 @@ cpsw_dump_slot(struct cpsw_softc *sc, st } } -#define CPSW_DUMP_SLOT(cs, slot) do { \ +#define CPSW_DUMP_SLOT(cs, slot) do { \ IF_DEBUG(sc) { \ cpsw_dump_slot(sc, slot); \ } \ } while (0) - static void cpsw_dump_queue(struct cpsw_softc *sc, struct cpsw_slots *q) { @@ -429,13 +426,12 @@ cpsw_dump_queue(struct cpsw_softc *sc, s printf("\n"); } -#define CPSW_DUMP_QUEUE(sc, q) do { \ +#define CPSW_DUMP_QUEUE(sc, q) do { \ IF_DEBUG(sc) { \ cpsw_dump_queue(sc, q); \ } \ } while (0) - /* * * Device Probe, Attach, Detach. @@ -456,7 +452,6 @@ cpsw_probe(device_t dev) return (BUS_PROBE_DEFAULT); } - static void cpsw_init_slots(struct cpsw_softc *sc) { @@ -1303,7 +1298,6 @@ cpsw_miibus_statchg(device_t dev) * */ - static void cpsw_intr_rx(void *arg) { @@ -2266,4 +2260,3 @@ cpsw_add_sysctls(struct cpsw_softc *sc) CTLFLAG_RD, NULL, "Watchdog Statistics"); cpsw_add_watchdog_sysctls(ctx, node, sc); } - Modified: head/sys/arm/ti/cpsw/if_cpswreg.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswreg.h Thu Mar 17 04:21:57 2016 (r296979) +++ head/sys/arm/ti/cpsw/if_cpswreg.h Thu Mar 17 06:23:48 2016 (r296980) @@ -29,103 +29,103 @@ #ifndef _IF_CPSWREG_H #define _IF_CPSWREG_H -#define CPSW_SS_OFFSET 0x0000 -#define CPSW_SS_IDVER (CPSW_SS_OFFSET + 0x00) -#define CPSW_SS_SOFT_RESET (CPSW_SS_OFFSET + 0x08) -#define CPSW_SS_STAT_PORT_EN (CPSW_SS_OFFSET + 0x0C) -#define CPSW_SS_PTYPE (CPSW_SS_OFFSET + 0x10) +#define CPSW_SS_OFFSET 0x0000 +#define CPSW_SS_IDVER (CPSW_SS_OFFSET + 0x00) +#define CPSW_SS_SOFT_RESET (CPSW_SS_OFFSET + 0x08) +#define CPSW_SS_STAT_PORT_EN (CPSW_SS_OFFSET + 0x0C) +#define CPSW_SS_PTYPE (CPSW_SS_OFFSET + 0x10) #define CPSW_SS_FLOW_CONTROL (CPSW_SS_OFFSET + 0x24) -#define CPSW_PORT_OFFSET 0x0100 +#define CPSW_PORT_OFFSET 0x0100 #define CPSW_PORT_P_MAX_BLKS(p) (CPSW_PORT_OFFSET + 0x08 + ((p) * 0x100)) #define CPSW_PORT_P_BLK_CNT(p) (CPSW_PORT_OFFSET + 0x0C + ((p) * 0x100)) -#define CPSW_PORT_P_TX_PRI_MAP(p) (CPSW_PORT_OFFSET + 0x118 + ((p-1) * 0x100)) -#define CPSW_PORT_P0_CPDMA_TX_PRI_MAP (CPSW_PORT_OFFSET + 0x01C) -#define CPSW_PORT_P0_CPDMA_RX_CH_MAP (CPSW_PORT_OFFSET + 0x020) -#define CPSW_PORT_P_SA_LO(p) (CPSW_PORT_OFFSET + 0x120 + ((p-1) * 0x100)) -#define CPSW_PORT_P_SA_HI(p) (CPSW_PORT_OFFSET + 0x124 + ((p-1) * 0x100)) - -#define CPSW_CPDMA_OFFSET 0x0800 -#define CPSW_CPDMA_TX_CONTROL (CPSW_CPDMA_OFFSET + 0x04) -#define CPSW_CPDMA_TX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x08) -#define CPSW_CPDMA_RX_CONTROL (CPSW_CPDMA_OFFSET + 0x14) -#define CPSW_CPDMA_RX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x18) -#define CPSW_CPDMA_SOFT_RESET (CPSW_CPDMA_OFFSET + 0x1c) -#define CPSW_CPDMA_DMACONTROL (CPSW_CPDMA_OFFSET + 0x20) -#define CPSW_CPDMA_DMASTATUS (CPSW_CPDMA_OFFSET + 0x24) -#define CPSW_CPDMA_RX_BUFFER_OFFSET (CPSW_CPDMA_OFFSET + 0x28) -#define CPSW_CPDMA_TX_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0x80) -#define CPSW_CPDMA_TX_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0x84) -#define CPSW_CPDMA_TX_INTMASK_SET (CPSW_CPDMA_OFFSET + 0x88) -#define CPSW_CPDMA_TX_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0x8C) -#define CPSW_CPDMA_CPDMA_EOI_VECTOR (CPSW_CPDMA_OFFSET + 0x94) -#define CPSW_CPDMA_RX_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0xA0) -#define CPSW_CPDMA_RX_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xA4) -#define CPSW_CPDMA_RX_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xA8) -#define CPSW_CPDMA_RX_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xAc) -#define CPSW_CPDMA_DMA_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0xB0) -#define CPSW_CPDMA_DMA_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xB4) -#define CPSW_CPDMA_DMA_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xB8) -#define CPSW_CPDMA_DMA_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xBC) -#define CPSW_CPDMA_RX_FREEBUFFER(p) (CPSW_CPDMA_OFFSET + 0x0e0 + ((p) * 0x04)) - -#define CPSW_STATS_OFFSET 0x0900 - -#define CPSW_STATERAM_OFFSET 0x0A00 -#define CPSW_CPDMA_TX_HDP(p) (CPSW_STATERAM_OFFSET + 0x00 + ((p) * 0x04)) -#define CPSW_CPDMA_RX_HDP(p) (CPSW_STATERAM_OFFSET + 0x20 + ((p) * 0x04)) -#define CPSW_CPDMA_TX_CP(p) (CPSW_STATERAM_OFFSET + 0x40 + ((p) * 0x04)) -#define CPSW_CPDMA_RX_CP(p) (CPSW_STATERAM_OFFSET + 0x60 + ((p) * 0x04)) - -#define CPSW_CPTS_OFFSET 0x0C00 - -#define CPSW_ALE_OFFSET 0x0D00 -#define CPSW_ALE_CONTROL (CPSW_ALE_OFFSET + 0x08) -#define CPSW_ALE_TBLCTL (CPSW_ALE_OFFSET + 0x20) -#define CPSW_ALE_TBLW2 (CPSW_ALE_OFFSET + 0x34) -#define CPSW_ALE_TBLW1 (CPSW_ALE_OFFSET + 0x38) -#define CPSW_ALE_TBLW0 (CPSW_ALE_OFFSET + 0x3C) -#define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04)) +#define CPSW_PORT_P_TX_PRI_MAP(p) (CPSW_PORT_OFFSET + 0x118 + ((p-1) * 0x100)) +#define CPSW_PORT_P0_CPDMA_TX_PRI_MAP (CPSW_PORT_OFFSET + 0x01C) +#define CPSW_PORT_P0_CPDMA_RX_CH_MAP (CPSW_PORT_OFFSET + 0x020) +#define CPSW_PORT_P_SA_LO(p) (CPSW_PORT_OFFSET + 0x120 + ((p-1) * 0x100)) +#define CPSW_PORT_P_SA_HI(p) (CPSW_PORT_OFFSET + 0x124 + ((p-1) * 0x100)) + +#define CPSW_CPDMA_OFFSET 0x0800 +#define CPSW_CPDMA_TX_CONTROL (CPSW_CPDMA_OFFSET + 0x04) +#define CPSW_CPDMA_TX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x08) +#define CPSW_CPDMA_RX_CONTROL (CPSW_CPDMA_OFFSET + 0x14) +#define CPSW_CPDMA_RX_TEARDOWN (CPSW_CPDMA_OFFSET + 0x18) +#define CPSW_CPDMA_SOFT_RESET (CPSW_CPDMA_OFFSET + 0x1c) +#define CPSW_CPDMA_DMACONTROL (CPSW_CPDMA_OFFSET + 0x20) +#define CPSW_CPDMA_DMASTATUS (CPSW_CPDMA_OFFSET + 0x24) +#define CPSW_CPDMA_RX_BUFFER_OFFSET (CPSW_CPDMA_OFFSET + 0x28) +#define CPSW_CPDMA_TX_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0x80) +#define CPSW_CPDMA_TX_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0x84) +#define CPSW_CPDMA_TX_INTMASK_SET (CPSW_CPDMA_OFFSET + 0x88) +#define CPSW_CPDMA_TX_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0x8C) +#define CPSW_CPDMA_CPDMA_EOI_VECTOR (CPSW_CPDMA_OFFSET + 0x94) +#define CPSW_CPDMA_RX_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0xA0) +#define CPSW_CPDMA_RX_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xA4) +#define CPSW_CPDMA_RX_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xA8) +#define CPSW_CPDMA_RX_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xAc) +#define CPSW_CPDMA_DMA_INTSTAT_RAW (CPSW_CPDMA_OFFSET + 0xB0) +#define CPSW_CPDMA_DMA_INTSTAT_MASKED (CPSW_CPDMA_OFFSET + 0xB4) +#define CPSW_CPDMA_DMA_INTMASK_SET (CPSW_CPDMA_OFFSET + 0xB8) +#define CPSW_CPDMA_DMA_INTMASK_CLEAR (CPSW_CPDMA_OFFSET + 0xBC) +#define CPSW_CPDMA_RX_FREEBUFFER(p) (CPSW_CPDMA_OFFSET + 0x0e0 + ((p) * 0x04)) + +#define CPSW_STATS_OFFSET 0x0900 + +#define CPSW_STATERAM_OFFSET 0x0A00 +#define CPSW_CPDMA_TX_HDP(p) (CPSW_STATERAM_OFFSET + 0x00 + ((p) * 0x04)) +#define CPSW_CPDMA_RX_HDP(p) (CPSW_STATERAM_OFFSET + 0x20 + ((p) * 0x04)) +#define CPSW_CPDMA_TX_CP(p) (CPSW_STATERAM_OFFSET + 0x40 + ((p) * 0x04)) +#define CPSW_CPDMA_RX_CP(p) (CPSW_STATERAM_OFFSET + 0x60 + ((p) * 0x04)) + +#define CPSW_CPTS_OFFSET 0x0C00 + +#define CPSW_ALE_OFFSET 0x0D00 +#define CPSW_ALE_CONTROL (CPSW_ALE_OFFSET + 0x08) +#define CPSW_ALE_TBLCTL (CPSW_ALE_OFFSET + 0x20) +#define CPSW_ALE_TBLW2 (CPSW_ALE_OFFSET + 0x34) +#define CPSW_ALE_TBLW1 (CPSW_ALE_OFFSET + 0x38) +#define CPSW_ALE_TBLW0 (CPSW_ALE_OFFSET + 0x3C) +#define CPSW_ALE_PORTCTL(p) (CPSW_ALE_OFFSET + 0x40 + ((p) * 0x04)) /* SL1 is at 0x0D80, SL2 is at 0x0DC0 */ -#define CPSW_SL_OFFSET 0x0D80 -#define CPSW_SL_MACCONTROL(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x04) -#define CPSW_SL_MACSTATUS(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x08) -#define CPSW_SL_SOFT_RESET(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x0C) -#define CPSW_SL_RX_MAXLEN(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x10) -#define CPSW_SL_RX_PAUSE(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x18) -#define CPSW_SL_TX_PAUSE(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x1C) -#define CPSW_SL_RX_PRI_MAP(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x24) - -#define MDIO_OFFSET 0x1000 -#define MDIOCONTROL (MDIO_OFFSET + 0x04) -#define MDIOUSERACCESS0 (MDIO_OFFSET + 0x80) -#define MDIOUSERPHYSEL0 (MDIO_OFFSET + 0x84) - -#define CPSW_WR_OFFSET 0x1200 -#define CPSW_WR_SOFT_RESET (CPSW_WR_OFFSET + 0x04) -#define CPSW_WR_CONTROL (CPSW_WR_OFFSET + 0x08) -#define CPSW_WR_INT_CONTROL (CPSW_WR_OFFSET + 0x0c) -#define CPSW_WR_C_RX_THRESH_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x10) -#define CPSW_WR_C_RX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x14) -#define CPSW_WR_C_TX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x18) -#define CPSW_WR_C_MISC_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x1C) -#define CPSW_WR_C_RX_THRESH_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x40) -#define CPSW_WR_C_RX_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x44) -#define CPSW_WR_C_TX_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x48) -#define CPSW_WR_C_MISC_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x4C) +#define CPSW_SL_OFFSET 0x0D80 +#define CPSW_SL_MACCONTROL(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x04) +#define CPSW_SL_MACSTATUS(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x08) +#define CPSW_SL_SOFT_RESET(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x0C) +#define CPSW_SL_RX_MAXLEN(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x10) +#define CPSW_SL_RX_PAUSE(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x18) +#define CPSW_SL_TX_PAUSE(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x1C) +#define CPSW_SL_RX_PRI_MAP(p) (CPSW_SL_OFFSET + (0x40 * (p)) + 0x24) + +#define MDIO_OFFSET 0x1000 +#define MDIOCONTROL (MDIO_OFFSET + 0x04) +#define MDIOUSERACCESS0 (MDIO_OFFSET + 0x80) +#define MDIOUSERPHYSEL0 (MDIO_OFFSET + 0x84) + +#define CPSW_WR_OFFSET 0x1200 +#define CPSW_WR_SOFT_RESET (CPSW_WR_OFFSET + 0x04) +#define CPSW_WR_CONTROL (CPSW_WR_OFFSET + 0x08) +#define CPSW_WR_INT_CONTROL (CPSW_WR_OFFSET + 0x0c) +#define CPSW_WR_C_RX_THRESH_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x10) +#define CPSW_WR_C_RX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x14) +#define CPSW_WR_C_TX_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x18) +#define CPSW_WR_C_MISC_EN(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x1C) +#define CPSW_WR_C_RX_THRESH_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x40) +#define CPSW_WR_C_RX_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x44) +#define CPSW_WR_C_TX_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x48) +#define CPSW_WR_C_MISC_STAT(p) (CPSW_WR_OFFSET + (0x10 * (p)) + 0x4C) -#define CPSW_CPPI_RAM_OFFSET 0x2000 +#define CPSW_CPPI_RAM_OFFSET 0x2000 #define CPSW_CPPI_RAM_SIZE 0x2000 #define CPSW_MEMWINDOW_SIZE 0x4000 -#define CPDMA_BD_SOP (1<<15) -#define CPDMA_BD_EOP (1<<14) -#define CPDMA_BD_OWNER (1<<13) -#define CPDMA_BD_EOQ (1<<12) -#define CPDMA_BD_TDOWNCMPLT (1<<11) -#define CPDMA_BD_PKT_ERR_MASK (3<< 4) +#define CPDMA_BD_SOP (1<<15) +#define CPDMA_BD_EOP (1<<14) +#define CPDMA_BD_OWNER (1<<13) +#define CPDMA_BD_EOQ (1<<12) +#define CPDMA_BD_TDOWNCMPLT (1<<11) +#define CPDMA_BD_PKT_ERR_MASK (3<< 4) struct cpsw_cpdma_bd { volatile uint32_t next; Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Thu Mar 17 04:21:57 2016 (r296979) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Thu Mar 17 06:23:48 2016 (r296980) @@ -29,15 +29,15 @@ #ifndef _IF_CPSWVAR_H #define _IF_CPSWVAR_H -#define CPSW_INTR_COUNT 4 +#define CPSW_INTR_COUNT 4 /* MII BUS */ -#define CPSW_MIIBUS_RETRIES 5 -#define CPSW_MIIBUS_DELAY 1000 +#define CPSW_MIIBUS_RETRIES 5 +#define CPSW_MIIBUS_DELAY 1000 -#define CPSW_MAX_ALE_ENTRIES 1024 +#define CPSW_MAX_ALE_ENTRIES 1024 -#define CPSW_SYSCTL_COUNT 34 +#define CPSW_SYSCTL_COUNT 34 struct cpsw_slot { uint32_t bd_offset; /* Offset of corresponding BD within CPPI RAM. */ From owner-svn-src-head@freebsd.org Thu Mar 17 07:17:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 20B76AD31EB; Thu, 17 Mar 2016 07:17:12 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DC850FCE; Thu, 17 Mar 2016 07:17:11 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id DFCD41FE024; Thu, 17 Mar 2016 08:17:02 +0100 (CET) Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys To: Gleb Smirnoff References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203601.GO1328@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56EA5A96.5070402@selasky.org> Date: Thu, 17 Mar 2016 08:19:50 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160316203601.GO1328@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 07:17:12 -0000 On 03/16/16 21:36, Gleb Smirnoff wrote: > On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: > H> Modified: head/sys/sys/sysctl.h > H> ============================================================================== > H> --- head/sys/sys/sysctl.h Wed Mar 16 06:42:15 2016 (r296932) > H> +++ head/sys/sys/sysctl.h Wed Mar 16 08:37:52 2016 (r296933) > H> @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e > H> SYSCTL_OID(parent, nbr, name, \ > H> CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ > H> (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ > H> - CTASSERT(((access) & CTLTYPE) == 0 || \ > H> - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) > H> + CTASSERT((((access) & CTLTYPE) == 0 || \ > H> + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ > H> + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ > H> + sizeof(uint64_t) == sizeof(**(ptr))) > > I don't agree with the last line. Does it assert that counter_u64_t is > implemented using uint64_t? That is true, but that is internal detail, > that might be changed in future. > Yes, it asserts that counter_u64_t is a 64-bit counter, as the name of the typedef hints at. From the past experience there has been several cases where someone has changed a field in structure which is exported as a sysctl, and then the sysctls were never updated. --HPS From owner-svn-src-head@freebsd.org Thu Mar 17 07:18:27 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4E61AD3264; Thu, 17 Mar 2016 07:18:27 +0000 (UTC) (envelope-from hps@selasky.org) Received: from mail.turbocat.net (heidi.turbocat.net [88.198.202.214]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7EE641D6; Thu, 17 Mar 2016 07:18:26 +0000 (UTC) (envelope-from hps@selasky.org) Received: from laptop015.home.selasky.org (unknown [62.141.129.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.turbocat.net (Postfix) with ESMTPSA id 28C081FE024; Thu, 17 Mar 2016 08:18:25 +0100 (CET) Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys To: Gleb Smirnoff References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203241.GM1328@FreeBSD.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Hans Petter Selasky Message-ID: <56EA5AE8.4050700@selasky.org> Date: Thu, 17 Mar 2016 08:21:12 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:38.0) Gecko/20100101 Thunderbird/38.5.0 MIME-Version: 1.0 In-Reply-To: <20160316203241.GM1328@FreeBSD.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 07:18:27 -0000 On 03/16/16 21:32, Gleb Smirnoff wrote: > On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: > H> Author: hselasky > H> Date: Wed Mar 16 08:37:52 2016 > H> New Revision: 296933 > H> URL: https://svnweb.freebsd.org/changeset/base/296933 > H> > H> Log: > H> Improve the implementation and documentation of the > H> SYSCTL_COUNTER_U64_ARRAY() macro. > H> > H> - Add proper asserts to the SYSCTL_COUNTER_U64_ARRAY() macro that checks > H> the size of the first element of the array. > H> - Add an example to the counter(9) manual page how to use the > H> SYSCTL_COUNTER_U64_ARRAY() macro. > H> - Add some missing symbolic links for counter(9) while at it. > > ... > > H> +.Sh EXAMPLES > H> +The following example creates a static counter array exported to > H> +userspace through a sysctl: > H> +.Bd -literal -offset indent > H> +#define MY_SIZE 8 > H> +static counter_u64_t array[MY_SIZE]; > H> +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, > H> + &array[0], MY_SIZE, "Test counter array"); > > I always wondered what is stylistically better: array or &array[0]? I > usually prefer the former. > A question: If you pass "array" why do you need a length argument in the SYSCTL macro. Can't you get the length of the array like sizeof(array)/sizeof((array)[0]) inside the macro? --HPS From owner-svn-src-head@freebsd.org Thu Mar 17 08:40:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8D57AD4FB4; Thu, 17 Mar 2016 08:40:59 +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 8B2B07D7; Thu, 17 Mar 2016 08:40:59 +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 u2H8ewde029226; Thu, 17 Mar 2016 08:40:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H8ew9R029225; Thu, 17 Mar 2016 08:40:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603170840.u2H8ew9R029225@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 17 Mar 2016 08:40:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296981 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 08:40:59 -0000 Author: andrew Date: Thu Mar 17 08:40:58 2016 New Revision: 296981 URL: https://svnweb.freebsd.org/changeset/base/296981 Log: Make it an error to build an ARM kernel with COMPAT_FREEBSDn where n < 10. We changed the ABI for ARM in 10, an removed support for the old ABI in 11, as such binaries from these releases are unable to be run on a head kernel. Reviewed by: bz, emast Sponsored by: ABT Systems Ltd Differential Revision: https://reviews.freebsd.org/D5652 Modified: head/sys/arm/arm/machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Thu Mar 17 06:23:48 2016 (r296980) +++ head/sys/arm/arm/machdep.c Thu Mar 17 08:40:58 2016 (r296981) @@ -178,6 +178,12 @@ DB_SHOW_COMMAND(vtop, db_show_vtop) #define debugf(fmt, args...) #endif +#if defined(COMPAT_FREEBSD4) || defined(COMPAT_FREEBSD5) || \ + defined(COMPAT_FREEBSD6) || defined(COMPAT_FREEBSD7) || \ + defined(COMPAT_FREEBSD9) +#error FreeBSD/arm doesn't provide compatibility with releases prior to 10 +#endif + struct pcpu __pcpu[MAXCPU]; struct pcpu *pcpup = &__pcpu[0]; From owner-svn-src-head@freebsd.org Thu Mar 17 08:57:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F0275AD3885; Thu, 17 Mar 2016 08:57:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C21A567; Thu, 17 Mar 2016 08:57:42 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H8vf95035443; Thu, 17 Mar 2016 08:57:41 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H8vfQv035442; Thu, 17 Mar 2016 08:57:41 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603170857.u2H8vfQv035442@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Thu, 17 Mar 2016 08:57:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296982 - head/sys/arm/allwinner X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 08:57:43 -0000 Author: mmel Date: Thu Mar 17 08:57:41 2016 New Revision: 296982 URL: https://svnweb.freebsd.org/changeset/base/296982 Log: A20: Gpiobus can be attached only after full gpio driver initialization. While i'm in, remove now unused global variable. Submited by: Emmanuel Vadot Modified: head/sys/arm/allwinner/a10_gpio.c Modified: head/sys/arm/allwinner/a10_gpio.c ============================================================================== --- head/sys/arm/allwinner/a10_gpio.c Thu Mar 17 08:40:58 2016 (r296981) +++ head/sys/arm/allwinner/a10_gpio.c Thu Mar 17 08:57:41 2016 (r296982) @@ -136,8 +136,6 @@ extern const struct allwinner_padconf a3 #define A10_GPIO_GP_INT_STA 0x214 #define A10_GPIO_GP_INT_DEB 0x218 -static struct a10_gpio_softc *a10_gpio_sc; - #define A10_GPIO_WRITE(_sc, _off, _val) \ bus_space_write_4(_sc->sc_bst, _sc->sc_bsh, _off, _val) #define A10_GPIO_READ(_sc, _off) \ @@ -562,12 +560,6 @@ a10_gpio_attach(device_t dev) /* Node is not a GPIO controller. */ goto fail; - a10_gpio_sc = sc; - sc->sc_busdev = gpiobus_attach_bus(dev); - if (sc->sc_busdev == NULL) - goto fail; - - /* Use the right pin data for the current SoC */ switch (allwinner_soc_type()) { #ifdef SOC_ALLWINNER_A10 @@ -594,6 +586,10 @@ a10_gpio_attach(device_t dev) return (ENOENT); } + sc->sc_busdev = gpiobus_attach_bus(dev); + if (sc->sc_busdev == NULL) + goto fail; + /* * Register as a pinctrl device */ From owner-svn-src-head@freebsd.org Thu Mar 17 09:04:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51F07AD3D07; Thu, 17 Mar 2016 09:04:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1F7E3877; Thu, 17 Mar 2016 09:04:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2H94798038298; Thu, 17 Mar 2016 09:04:07 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2H947Xk038297; Thu, 17 Mar 2016 09:04:07 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603170904.u2H947Xk038297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Thu, 17 Mar 2016 09:04:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296983 - head/release/doc/en_US.ISO8859-1/relnotes X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 09:04:08 -0000 Author: mav Date: Thu Mar 17 09:04:07 2016 New Revision: 296983 URL: https://svnweb.freebsd.org/changeset/base/296983 Log: Add paragraph about isp(4) improvements. Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml Modified: head/release/doc/en_US.ISO8859-1/relnotes/article.xml ============================================================================== --- head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Mar 17 08:57:41 2016 (r296982) +++ head/release/doc/en_US.ISO8859-1/relnotes/article.xml Thu Mar 17 09:04:07 2016 (r296983) @@ -1168,6 +1168,11 @@ The &man.ctl.4; driver has been updated to support CD-ROM and removable devices. + + The &man.isp.4; driver has + been updated and improved: added support for 16Gbps FC cards, + improved target mode support, completed Multi-ID (NPIV) + functionality. From owner-svn-src-head@freebsd.org Thu Mar 17 10:59:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A97EAD36BD; Thu, 17 Mar 2016 10:59:31 +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 1821F1F3C; Thu, 17 Mar 2016 10:59:31 +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 u2HAxUb9072095; Thu, 17 Mar 2016 10:59:30 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HAxUkM072094; Thu, 17 Mar 2016 10:59:30 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201603171059.u2HAxUkM072094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 17 Mar 2016 10:59:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296984 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 10:59:31 -0000 Author: ae Date: Thu Mar 17 10:59:30 2016 New Revision: 296984 URL: https://svnweb.freebsd.org/changeset/base/296984 Log: Change in6_selectsrc() to allow usage of non-local IPv6 addresses in IPV6_PKTINFO ancillary data when IPV6_BINDANY socket option is set. Submitted by: n_hibma MFC after: 2 weeks Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Thu Mar 17 09:04:07 2016 (r296983) +++ head/sys/netinet6/in6_src.c Thu Mar 17 10:59:30 2016 (r296984) @@ -256,19 +256,27 @@ in6_selectsrc(uint32_t fibnum, struct so (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) return (error); - ia6 = (struct in6_ifaddr *)ifa_ifwithaddr( - (struct sockaddr *)&srcsock); - if (ia6 == NULL || - (ia6->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) { - if (ia6 != NULL) - ifa_free(&ia6->ia_ifa); - return (EADDRNOTAVAIL); - } + /* + * If IPV6_BINDANY socket option is set, we allow to specify + * non local addresses as source address in IPV6_PKTINFO + * ancillary data. + */ + if ((inp->inp_flags & INP_BINDANY) == 0) { + ia6 = (struct in6_ifaddr *)ifa_ifwithaddr( + (struct sockaddr *)&srcsock); + if (ia6 == NULL || (ia6->ia6_flags & (IN6_IFF_ANYCAST | + IN6_IFF_NOTREADY))) { + if (ia6 != NULL) + ifa_free(&ia6->ia_ifa); + return (EADDRNOTAVAIL); + } + bcopy(&ia6->ia_addr.sin6_addr, srcp, sizeof(*srcp)); + ifa_free(&ia6->ia_ifa); + } else + bcopy(&srcsock.sin6_addr, srcp, sizeof(*srcp)); pi->ipi6_addr = srcsock.sin6_addr; /* XXX: this overrides pi */ if (ifpp) *ifpp = ifp; - bcopy(&ia6->ia_addr.sin6_addr, srcp, sizeof(*srcp)); - ifa_free(&ia6->ia_ifa); return (0); } From owner-svn-src-head@freebsd.org Thu Mar 17 11:10:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D6CCAD3A99; Thu, 17 Mar 2016 11:10:45 +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 558DB982; Thu, 17 Mar 2016 11:10:45 +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 u2HBAi2f075165; Thu, 17 Mar 2016 11:10:44 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HBAiFR075164; Thu, 17 Mar 2016 11:10:44 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201603171110.u2HBAiFR075164@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 17 Mar 2016 11:10:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296986 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 11:10:45 -0000 Author: ae Date: Thu Mar 17 11:10:44 2016 New Revision: 296986 URL: https://svnweb.freebsd.org/changeset/base/296986 Log: Reduce the number of local variables. Remove redundant check that inp pointer isn't NULL, it is safe, because we are handling IPV6_PKTINFO socket option in this block of code. Also, use in6ifa_withaddr() instead of ifa_withaddr(). Modified: head/sys/netinet6/in6_src.c Modified: head/sys/netinet6/in6_src.c ============================================================================== --- head/sys/netinet6/in6_src.c Thu Mar 17 11:06:43 2016 (r296985) +++ head/sys/netinet6/in6_src.c Thu Mar 17 11:10:44 2016 (r296986) @@ -226,9 +226,6 @@ in6_selectsrc(uint32_t fibnum, struct so */ if (opts && (pi = opts->ip6po_pktinfo) && !IN6_IS_ADDR_UNSPECIFIED(&pi->ipi6_addr)) { - struct sockaddr_in6 srcsock; - struct in6_ifaddr *ia6; - /* get the outgoing interface */ if ((error = in6_selectif(dstsock, opts, mopts, &ifp, oifp, fibnum)) @@ -242,18 +239,14 @@ in6_selectsrc(uint32_t fibnum, struct so * the interface must be specified; otherwise, ifa_ifwithaddr() * will fail matching the address. */ - bzero(&srcsock, sizeof(srcsock)); - srcsock.sin6_family = AF_INET6; - srcsock.sin6_len = sizeof(srcsock); - srcsock.sin6_addr = pi->ipi6_addr; + tmp = pi->ipi6_addr; if (ifp) { - error = in6_setscope(&srcsock.sin6_addr, ifp, NULL); + error = in6_setscope(&tmp, ifp, &odstzone); if (error) return (error); } if (cred != NULL && (error = prison_local_ip6(cred, - &srcsock.sin6_addr, (inp != NULL && - (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0))) != 0) + &tmp, (inp->inp_flags & IN6P_IPV6_V6ONLY) != 0)) != 0) return (error); /* @@ -262,19 +255,18 @@ in6_selectsrc(uint32_t fibnum, struct so * ancillary data. */ if ((inp->inp_flags & INP_BINDANY) == 0) { - ia6 = (struct in6_ifaddr *)ifa_ifwithaddr( - (struct sockaddr *)&srcsock); - if (ia6 == NULL || (ia6->ia6_flags & (IN6_IFF_ANYCAST | + ia = in6ifa_ifwithaddr(&tmp, odstzone); + if (ia == NULL || (ia->ia6_flags & (IN6_IFF_ANYCAST | IN6_IFF_NOTREADY))) { - if (ia6 != NULL) - ifa_free(&ia6->ia_ifa); + if (ia != NULL) + ifa_free(&ia->ia_ifa); return (EADDRNOTAVAIL); } - bcopy(&ia6->ia_addr.sin6_addr, srcp, sizeof(*srcp)); - ifa_free(&ia6->ia_ifa); + bcopy(&ia->ia_addr.sin6_addr, srcp, sizeof(*srcp)); + ifa_free(&ia->ia_ifa); } else - bcopy(&srcsock.sin6_addr, srcp, sizeof(*srcp)); - pi->ipi6_addr = srcsock.sin6_addr; /* XXX: this overrides pi */ + bcopy(&tmp, srcp, sizeof(*srcp)); + pi->ipi6_addr = tmp; /* XXX: this overrides pi */ if (ifpp) *ifpp = ifp; return (0); From owner-svn-src-head@freebsd.org Thu Mar 17 12:30:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 80BB5AD33F3; Thu, 17 Mar 2016 12:30:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 528BD9AE; Thu, 17 Mar 2016 12:30:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2HCULqt099386; Thu, 17 Mar 2016 12:30:21 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HCULjr099385; Thu, 17 Mar 2016 12:30:21 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201603171230.u2HCULjr099385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Thu, 17 Mar 2016 12:30:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296987 - head/sys/ofed/drivers/net/mlx4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 12:30:22 -0000 Author: hselasky Date: Thu Mar 17 12:30:21 2016 New Revision: 296987 URL: https://svnweb.freebsd.org/changeset/base/296987 Log: Add missing curly brackets in for loop. Sponsored by: Mellanox Technologies MFC after: 1 week Modified: head/sys/ofed/drivers/net/mlx4/en_port.c Modified: head/sys/ofed/drivers/net/mlx4/en_port.c ============================================================================== --- head/sys/ofed/drivers/net/mlx4/en_port.c Thu Mar 17 11:10:44 2016 (r296986) +++ head/sys/ofed/drivers/net/mlx4/en_port.c Thu Mar 17 12:30:21 2016 (r296987) @@ -60,10 +60,11 @@ int mlx4_SET_VLAN_FLTR(struct mlx4_dev * memset(filter, 0, sizeof(*filter)); for (i = VLAN_FLTR_SIZE - 1; i >= 0; i--) { entry = 0; - for (j = 0; j < 32; j++) + for (j = 0; j < 32; j++) { if (test_bit(index, priv->active_vlans)) entry |= 1 << j; - index++; + index++; + } filter->entry[i] = cpu_to_be32(entry); } err = mlx4_cmd(dev, mailbox->dma, priv->port, 0, MLX4_CMD_SET_VLAN_FLTR, From owner-svn-src-head@freebsd.org Thu Mar 17 17:53:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7863FAD34DC; Thu, 17 Mar 2016 17:53:39 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3153AEDF; Thu, 17 Mar 2016 17:53:39 +0000 (UTC) (envelope-from allanjude@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2HHrcfD001795; Thu, 17 Mar 2016 17:53:38 GMT (envelope-from allanjude@FreeBSD.org) Received: (from allanjude@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HHrcTj001794; Thu, 17 Mar 2016 17:53:38 GMT (envelope-from allanjude@FreeBSD.org) Message-Id: <201603171753.u2HHrcTj001794@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: allanjude set sender to allanjude@FreeBSD.org using -f From: Allan Jude Date: Thu, 17 Mar 2016 17:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296988 - head/usr.sbin/bsdinstall/scripts X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 17:53:39 -0000 Author: allanjude Date: Thu Mar 17 17:53:38 2016 New Revision: 296988 URL: https://svnweb.freebsd.org/changeset/base/296988 Log: Remove 50% ZFS conditional from bsdinstall/zfsboot Remove the requirement that the resulting partition table be atleast 50% ZFS PR: 208094 Requested by: brooks Sponsored by: ScaleEngine Inc. Modified: head/usr.sbin/bsdinstall/scripts/zfsboot Modified: head/usr.sbin/bsdinstall/scripts/zfsboot ============================================================================== --- head/usr.sbin/bsdinstall/scripts/zfsboot Thu Mar 17 12:30:21 2016 (r296987) +++ head/usr.sbin/bsdinstall/scripts/zfsboot Thu Mar 17 17:53:38 2016 (r296988) @@ -302,7 +302,7 @@ msg_swap_mirror_help="Mirror swap partit msg_swap_size="Swap Size" msg_swap_size_help="Customize how much swap space is allocated to each selected disk" msg_swap_toosmall="The selected swap size (%s) is to small. Please enter a value greater than 100MB or enter 0 for no swap" -msg_these_disks_are_too_small="These disks are too small given the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 50%% or more of each of the following selected disk\ndevices (not recommended):\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of devices." +msg_these_disks_are_too_small="These disks are smaller than the amount of requested\nswap (%s) and/or geli(8) (%s) partitions, which would\ntake 100%% or more of each of the following selected disks:\n\n %s\n\nRecommend changing partition size(s) and/or selecting a\ndifferent set of disks." msg_unable_to_get_disk_capacity="Unable to get disk capacity of \`%s'" msg_unsupported_partition_scheme="%s is an unsupported partition scheme" msg_user_cancelled="User Cancelled." @@ -1483,11 +1483,12 @@ while :; do # NB: dialog_menu_layout supports running non-interactively dialog_menu_layout || continue - # Make sure each disk will be at least 50% ZFS + # Make sure each disk will have room for ZFS if f_expand_number "$ZFSBOOT_SWAP_SIZE" swapsize && - f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize + f_expand_number "$ZFSBOOT_BOOT_POOL_SIZE" bootsize && + f_expand_number "1g" zpoolmin then - minsize=$swapsize teeny_disks= + minsize=$(( $swapsize + $zpoolmin )) teeny_disks= [ "$ZFSBOOT_BOOT_POOL" ] && minsize=$(( $minsize + $bootsize )) for disk in $ZFSBOOT_DISKS; do @@ -1495,7 +1496,6 @@ while :; do $disk $DEVICE_TYPE_DISK device $device get capacity disksize || continue [ ${disksize:-0} -ge 0 ] || disksize=0 - disksize=$(( $disksize - $minsize )) [ $disksize -lt $minsize ] && teeny_disks="$teeny_disks $disk" done From owner-svn-src-head@freebsd.org Thu Mar 17 18:55:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F2F6EAD4C6D; Thu, 17 Mar 2016 18:55:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B2AC1159A; Thu, 17 Mar 2016 18:55:55 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2HItsne020101; Thu, 17 Mar 2016 18:55:54 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HItsCP020094; Thu, 17 Mar 2016 18:55:54 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201603171855.u2HItsCP020094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Mar 2016 18:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296990 - in head/sys/cddl: contrib/opensolaris/uts/common/dtrace dev/dtrace/aarch64 dev/dtrace/amd64 dev/dtrace/arm dev/dtrace/i386 dev/dtrace/mips dev/dtrace/powerpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 18:55:56 -0000 Author: markj Date: Thu Mar 17 18:55:54 2016 New Revision: 296990 URL: https://svnweb.freebsd.org/changeset/base/296990 Log: Remove unused variables dtrace_in_probe and dtrace_in_probe_addr. Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c head/sys/cddl/dev/dtrace/arm/dtrace_subr.c head/sys/cddl/dev/dtrace/i386/dtrace_subr.c head/sys/cddl/dev/dtrace/mips/dtrace_subr.c head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/contrib/opensolaris/uts/common/dtrace/dtrace.c Thu Mar 17 18:55:54 2016 (r296990) @@ -246,10 +246,6 @@ static int dtrace_dynvar_failclean; /* #ifndef illumos static struct mtx dtrace_unr_mtx; MTX_SYSINIT(dtrace_unr_mtx, &dtrace_unr_mtx, "Unique resource identifier", MTX_DEF); -int dtrace_in_probe; /* non-zero if executing a probe */ -#if defined(__i386__) || defined(__amd64__) || defined(__mips__) || defined(__powerpc__) -uintptr_t dtrace_in_probe_addr; /* Address of invop when already in probe */ -#endif static eventhandler_tag dtrace_kld_load_tag; static eventhandler_tag dtrace_kld_unload_try_tag; #endif Modified: head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/aarch64/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -45,8 +45,6 @@ __FBSDID("$FreeBSD$"); #include #include -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern void dtrace_getnanotime(struct timespec *tsp); Modified: head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/amd64/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -44,9 +44,6 @@ #include #include -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; - extern void dtrace_getnanotime(struct timespec *tsp); int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); Modified: head/sys/cddl/dev/dtrace/arm/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/arm/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -51,8 +51,6 @@ __FBSDID("$FreeBSD$"); #define BIT_LR 14 #define BIT_SP 13 -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); extern void dtrace_getnanotime(struct timespec *tsp); Modified: head/sys/cddl/dev/dtrace/i386/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/i386/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -46,8 +46,6 @@ #include extern uintptr_t kernelbase; -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; extern void dtrace_getnanotime(struct timespec *tsp); Modified: head/sys/cddl/dev/dtrace/mips/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/mips/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); #define DELAYBRANCH(x) ((int)(x) < 0) -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; int dtrace_invop(uintptr_t, uintptr_t *, uintptr_t); Modified: head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c ============================================================================== --- head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Thu Mar 17 18:49:37 2016 (r296989) +++ head/sys/cddl/dev/dtrace/powerpc/dtrace_subr.c Thu Mar 17 18:55:54 2016 (r296990) @@ -46,8 +46,6 @@ __FBSDID("$FreeBSD$"); #define DELAYBRANCH(x) ((int)(x) < 0) -extern uintptr_t dtrace_in_probe_addr; -extern int dtrace_in_probe; extern dtrace_id_t dtrace_probeid_error; extern int (*dtrace_invop_jump_addr)(struct trapframe *); From owner-svn-src-head@freebsd.org Thu Mar 17 19:01:46 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73397AD4E2B; Thu, 17 Mar 2016 19:01:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 31DAF1A44; Thu, 17 Mar 2016 19:01:46 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2HJ1jLb020980; Thu, 17 Mar 2016 19:01:45 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HJ1jEk020977; Thu, 17 Mar 2016 19:01:45 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201603171901.u2HJ1jEk020977@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 17 Mar 2016 19:01:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296991 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 19:01:46 -0000 Author: markj Date: Thu Mar 17 19:01:44 2016 New Revision: 296991 URL: https://svnweb.freebsd.org/changeset/base/296991 Log: Modify defrouter_remove() to perform the router lookup before removal. This allows some simplification of its callers. No functional change intended. Tested by: Larry Rosenman (as part of a larger change) MFC after: 1 month Modified: head/sys/netinet6/nd6.h head/sys/netinet6/nd6_nbr.c head/sys/netinet6/nd6_rtr.c Modified: head/sys/netinet6/nd6.h ============================================================================== --- head/sys/netinet6/nd6.h Thu Mar 17 18:55:54 2016 (r296990) +++ head/sys/netinet6/nd6.h Thu Mar 17 19:01:44 2016 (r296991) @@ -459,7 +459,7 @@ void defrouter_reset(void); void defrouter_select(void); void defrouter_ref(struct nd_defrouter *); void defrouter_rele(struct nd_defrouter *); -void defrouter_remove(struct nd_defrouter *); +bool defrouter_remove(struct in6_addr *, struct ifnet *); void defrouter_unlink(struct nd_defrouter *, struct nd_drhead *); void defrouter_del(struct nd_defrouter *); void prelist_remove(struct nd_prefix *); Modified: head/sys/netinet6/nd6_nbr.c ============================================================================== --- head/sys/netinet6/nd6_nbr.c Thu Mar 17 18:55:54 2016 (r296990) +++ head/sys/netinet6/nd6_nbr.c Thu Mar 17 19:01:44 2016 (r296991) @@ -857,30 +857,19 @@ nd6_na_input(struct mbuf *m, int off, in * Remove the sender from the Default Router List and * update the Destination Cache entries. */ - struct nd_defrouter *dr; struct ifnet *nd6_ifp; nd6_ifp = lltable_get_ifp(ln->lle_tbl); - ND6_WLOCK(); - dr = defrouter_lookup_locked(&ln->r_l3addr.addr6, - nd6_ifp); - if (dr != NULL) { - /* releases the ND lock */ - defrouter_remove(dr); - dr = NULL; - } else { - ND6_WUNLOCK(); - if ((ND_IFINFO(nd6_ifp)->flags & ND6_IFF_ACCEPT_RTADV) != 0) { - /* - * Even if the neighbor is not in the default - * router list, the neighbor may be used - * as a next hop for some destinations - * (e.g. redirect case). So we must - * call rt6_flush explicitly. - */ - rt6_flush(&ip6->ip6_src, ifp); - } - } + if (!defrouter_remove(&ln->r_l3addr.addr6, nd6_ifp) && + (ND_IFINFO(nd6_ifp)->flags & + ND6_IFF_ACCEPT_RTADV) != 0) + /* + * Even if the neighbor is not in the default + * router list, the neighbor may be used as a + * next hop for some destinations (e.g. redirect + * case). So we must call rt6_flush explicitly. + */ + rt6_flush(&ip6->ip6_src, ifp); } ln->ln_router = is_router; } Modified: head/sys/netinet6/nd6_rtr.c ============================================================================== --- head/sys/netinet6/nd6_rtr.c Thu Mar 17 18:55:54 2016 (r296990) +++ head/sys/netinet6/nd6_rtr.c Thu Mar 17 19:01:44 2016 (r296991) @@ -627,22 +627,26 @@ defrouter_reset(void) } /* - * Remove a router from the global list and free it. - * - * The ND lock must be held and is released before returning. The caller must - * hold a reference on the router object. + * Look up a matching default router list entry and remove it. Returns true if a + * matching entry was found, false otherwise. */ -void -defrouter_remove(struct nd_defrouter *dr) +bool +defrouter_remove(struct in6_addr *addr, struct ifnet *ifp) { + struct nd_defrouter *dr; - ND6_WLOCK_ASSERT(); - KASSERT(dr->refcnt >= 2, ("unexpected refcount 0x%x", dr->refcnt)); + ND6_WLOCK(); + dr = defrouter_lookup_locked(addr, ifp); + if (dr == NULL) { + ND6_WUNLOCK(); + return (false); + } defrouter_unlink(dr, NULL); ND6_WUNLOCK(); defrouter_del(dr); defrouter_rele(dr); + return (true); } /* @@ -850,14 +854,14 @@ defrtrlist_update(struct nd_defrouter *n struct nd_defrouter *dr, *n; int oldpref; - ND6_WLOCK(); - if ((dr = defrouter_lookup_locked(&new->rtaddr, new->ifp)) != NULL) { - if (new->rtlifetime == 0) { - /* releases the ND lock */ - defrouter_remove(dr); - return (NULL); - } + if (new->rtlifetime == 0) { + defrouter_remove(&new->rtaddr, new->ifp); + return (NULL); + } + ND6_WLOCK(); + dr = defrouter_lookup_locked(&new->rtaddr, new->ifp); + if (dr != NULL) { oldpref = rtpref(dr); /* override */ @@ -881,25 +885,17 @@ defrtrlist_update(struct nd_defrouter *n */ TAILQ_REMOVE(&V_nd_defrouter, dr, dr_entry); n = dr; - goto insert; - } - - /* entry does not exist */ - if (new->rtlifetime == 0) { - ND6_WUNLOCK(); - return (NULL); - } - - n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); - if (n == NULL) { - ND6_WUNLOCK(); - return (NULL); + } else { + n = malloc(sizeof(*n), M_IP6NDP, M_NOWAIT | M_ZERO); + if (n == NULL) { + ND6_WUNLOCK(); + return (NULL); + } + memcpy(n, new, sizeof(*n)); + /* Initialize with an extra reference for the caller. */ + refcount_init(&n->refcnt, 2); } - memcpy(n, new, sizeof(*n)); - /* Initialize with an extra reference for the caller. */ - refcount_init(&n->refcnt, 2); -insert: /* * Insert the new router in the Default Router List; * The Default Router List should be in the descending order From owner-svn-src-head@freebsd.org Thu Mar 17 19:35:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD547AD3CBD; Thu, 17 Mar 2016 19:35:09 +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 95E2CE39; Thu, 17 Mar 2016 19:35:09 +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 u2HJZ8dn032207; Thu, 17 Mar 2016 19:35:08 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2HJZ87J032205; Thu, 17 Mar 2016 19:35:08 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603171935.u2HJZ87J032205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Thu, 17 Mar 2016 19:35:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296993 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 19:35:09 -0000 Author: loos Date: Thu Mar 17 19:35:08 2016 New Revision: 296993 URL: https://svnweb.freebsd.org/changeset/base/296993 Log: Add support for dual emac mode. In dual emac mode, the CPSW subsystem provides two independent ethernets. This is implemented (as recommended by TI's TRM) with a mixture of switch settings (vlans) and specific features of CPSW subsystem. The driver was splitted to accommodate the shared parts (RX and TX rings for example) while it still provides two independent ethernets. Each of the ethernet ports driver has it's own set of MDIO registers among the other private settings. Previously this driver always operate in promisc mode, now the Switch ALE (address table entry) is properly initialized and enabled. The driver is also tested (and known to work) with both ports operating in single port mode (active_slave 0 or 1). Tested on uBMC (dual emac mode, both ports in single mode, giga and fast ethernet) and BBB (single port, fast ethernet). Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswreg.h head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Thu Mar 17 19:28:15 2016 (r296992) +++ head/sys/arm/ti/cpsw/if_cpsw.c Thu Mar 17 19:35:08 2016 (r296993) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2012 Damjan Marion + * Copyright (c) 2016 Rubicon Communications, LLC (Netgate) * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -93,50 +94,54 @@ __FBSDID("$FreeBSD$"); /* Device probe/attach/detach. */ static int cpsw_probe(device_t); -static void cpsw_init_slots(struct cpsw_softc *); static int cpsw_attach(device_t); -static void cpsw_free_slot(struct cpsw_softc *, struct cpsw_slot *); static int cpsw_detach(device_t); +static int cpswp_probe(device_t); +static int cpswp_attach(device_t); +static int cpswp_detach(device_t); + +static phandle_t cpsw_get_node(device_t, device_t); /* Device Init/shutdown. */ -static void cpsw_init(void *); -static void cpsw_init_locked(void *); static int cpsw_shutdown(device_t); -static void cpsw_shutdown_locked(struct cpsw_softc *); +static void cpswp_init(void *); +static void cpswp_init_locked(void *); +static void cpswp_stop_locked(struct cpswp_softc *); /* Device Suspend/Resume. */ static int cpsw_suspend(device_t); static int cpsw_resume(device_t); /* Ioctl. */ -static int cpsw_ioctl(struct ifnet *, u_long command, caddr_t data); +static int cpswp_ioctl(struct ifnet *, u_long command, caddr_t data); -static int cpsw_miibus_readreg(device_t, int phy, int reg); -static int cpsw_miibus_writereg(device_t, int phy, int reg, int value); -static void cpsw_miibus_statchg(device_t); +static int cpswp_miibus_readreg(device_t, int phy, int reg); +static int cpswp_miibus_writereg(device_t, int phy, int reg, int value); +static void cpswp_miibus_statchg(device_t); /* Send/Receive packets. */ static void cpsw_intr_rx(void *arg); static struct mbuf *cpsw_rx_dequeue(struct cpsw_softc *); static void cpsw_rx_enqueue(struct cpsw_softc *); -static void cpsw_start(struct ifnet *); -static void cpsw_tx_enqueue(struct cpsw_softc *); +static void cpswp_start(struct ifnet *); +static void cpswp_tx_enqueue(struct cpswp_softc *); static int cpsw_tx_dequeue(struct cpsw_softc *); /* Misc interrupts and watchdog. */ static void cpsw_intr_rx_thresh(void *); static void cpsw_intr_misc(void *); -static void cpsw_tick(void *); -static void cpsw_ifmedia_sts(struct ifnet *, struct ifmediareq *); -static int cpsw_ifmedia_upd(struct ifnet *); -static void cpsw_tx_watchdog(struct cpsw_softc *); +static void cpswp_tick(void *); +static void cpswp_ifmedia_sts(struct ifnet *, struct ifmediareq *); +static int cpswp_ifmedia_upd(struct ifnet *); +static void cpsw_tx_watchdog(void *); /* ALE support */ -static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t idx, uint32_t *ale_entry); -static void cpsw_ale_write_entry(struct cpsw_softc *, uint16_t idx, uint32_t *ale_entry); -static int cpsw_ale_mc_entry_set(struct cpsw_softc *, uint8_t portmap, uint8_t *mac); -static int cpsw_ale_update_addresses(struct cpsw_softc *, int purge); +static void cpsw_ale_read_entry(struct cpsw_softc *, uint16_t, uint32_t *); +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 cpswp_ale_update_addresses(struct cpswp_softc *, int); /* Statistics and sysctls. */ static void cpsw_add_sysctls(struct cpsw_softc *); @@ -150,24 +155,7 @@ static int cpsw_stats_sysctl(SYSCTL_HAND */ #define CPSW_TXFRAGS 8 -/* - * TODO: The CPSW subsystem (CPSW_SS) can drive two independent PHYs - * as separate Ethernet ports. To properly support this, we should - * break this into two separate devices: a CPSW_SS device that owns - * the interrupts and actually talks to the CPSW hardware, and a - * separate CPSW Ethernet child device for each Ethernet port. The RX - * interrupt, for example, would be part of CPSW_SS; it would receive - * a packet, note the input port, and then dispatch it to the child - * device's interface queue. Similarly for transmit. - * - * It's not clear to me whether the device tree should be restructured - * with a cpsw_ss node and two child nodes. That would allow specifying - * MAC addresses for each port, for example, but might be overkill. - * - * Unfortunately, I don't have hardware right now that supports two - * Ethernet ports via CPSW. - */ - +/* Shared resources. */ static device_method_t cpsw_methods[] = { /* Device interface */ DEVMETHOD(device_probe, cpsw_probe), @@ -176,26 +164,49 @@ static device_method_t cpsw_methods[] = DEVMETHOD(device_shutdown, cpsw_shutdown), DEVMETHOD(device_suspend, cpsw_suspend), DEVMETHOD(device_resume, cpsw_resume), - /* MII interface */ - DEVMETHOD(miibus_readreg, cpsw_miibus_readreg), - DEVMETHOD(miibus_writereg, cpsw_miibus_writereg), - DEVMETHOD(miibus_statchg, cpsw_miibus_statchg), - { 0, 0 } + /* OFW methods */ + DEVMETHOD(ofw_bus_get_node, cpsw_get_node), + DEVMETHOD_END }; static driver_t cpsw_driver = { - "cpsw", + "cpswss", cpsw_methods, sizeof(struct cpsw_softc), }; static devclass_t cpsw_devclass; -DRIVER_MODULE(cpsw, simplebus, cpsw_driver, cpsw_devclass, 0, 0); +DRIVER_MODULE(cpswss, simplebus, cpsw_driver, cpsw_devclass, 0, 0); + +/* Port/Slave resources. */ +static device_method_t cpswp_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, cpswp_probe), + DEVMETHOD(device_attach, cpswp_attach), + DEVMETHOD(device_detach, cpswp_detach), + /* MII interface */ + DEVMETHOD(miibus_readreg, cpswp_miibus_readreg), + DEVMETHOD(miibus_writereg, cpswp_miibus_writereg), + DEVMETHOD(miibus_statchg, cpswp_miibus_statchg), + DEVMETHOD_END +}; + +static driver_t cpswp_driver = { + "cpsw", + cpswp_methods, + sizeof(struct cpswp_softc), +}; + +static devclass_t cpswp_devclass; + +DRIVER_MODULE(cpsw, cpswss, cpswp_driver, cpswp_devclass, 0, 0); DRIVER_MODULE(miibus, cpsw, miibus_driver, miibus_devclass, 0, 0); MODULE_DEPEND(cpsw, ether, 1, 1, 1); MODULE_DEPEND(cpsw, miibus, 1, 1, 1); +static uint32_t slave_mdio_addr[] = { 0x4a100200, 0x4a100300 }; + static struct resource_spec irq_res_spec[] = { { SYS_RES_IRQ, 0, RF_ACTIVE | RF_SHAREABLE }, { SYS_RES_IRQ, 1, RF_ACTIVE | RF_SHAREABLE }, @@ -205,7 +216,7 @@ static struct resource_spec irq_res_spec }; /* Number of entries here must match size of stats - * array in struct cpsw_softc. */ + * array in struct cpswp_softc. */ static struct cpsw_stat { int reg; char *oid; @@ -250,7 +261,7 @@ static struct cpsw_stat { * Basic debug support. */ -#define IF_DEBUG(sc) if (sc->cpsw_if_flags & IFF_DEBUG) +#define IF_DEBUG(_sc) if ((_sc)->if_flags & IFF_DEBUG) static void cpsw_debugf_head(const char *funcname) @@ -273,13 +284,21 @@ cpsw_debugf(const char *fmt, ...) } -#define CPSW_DEBUGF(a) do { \ - IF_DEBUG(sc) { \ +#define CPSW_DEBUGF(_sc, a) do { \ + if (sc->debug) { \ cpsw_debugf_head(__func__); \ cpsw_debugf a; \ } \ } while (0) +#define CPSWP_DEBUGF(_sc, a) do { \ + IF_DEBUG((_sc)) { \ + cpsw_debugf_head(__func__); \ + cpsw_debugf a; \ + } \ +} while (0) + + /* * Locking macros */ @@ -318,11 +337,20 @@ cpsw_debugf(const char *fmt, ...) CPSW_RX_LOCK_ASSERT(sc); \ } while (0) +#define CPSW_PORT_LOCK(_sc) do { \ + mtx_assert(&(_sc)->lock, MA_NOTOWNED); \ + mtx_lock(&(_sc)->lock); \ +} while (0) + +#define CPSW_PORT_UNLOCK(_sc) mtx_unlock(&(_sc)->lock) +#define CPSW_PORT_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->lock, MA_OWNED) + /* * Read/Write macros */ -#define cpsw_read_4(sc, reg) bus_read_4(sc->mem_res, reg) -#define cpsw_write_4(sc, reg, val) bus_write_4(sc->mem_res, reg, val) +#define cpsw_read_4(_sc, _reg) bus_read_4((_sc)->mem_res, (_reg)) +#define cpsw_write_4(_sc, _reg, _val) \ + bus_write_4((_sc)->mem_res, (_reg), (_val)) #define cpsw_cpdma_bd_offset(i) (CPSW_CPPI_RAM_OFFSET + ((i)*16)) @@ -426,32 +454,12 @@ cpsw_dump_queue(struct cpsw_softc *sc, s printf("\n"); } -#define CPSW_DUMP_QUEUE(sc, q) do { \ +#define CPSW_DUMP_QUEUE(sc, q) do { \ IF_DEBUG(sc) { \ cpsw_dump_queue(sc, q); \ } \ } while (0) -/* - * - * Device Probe, Attach, Detach. - * - */ - -static int -cpsw_probe(device_t dev) -{ - - if (!ofw_bus_status_okay(dev)) - return (ENXIO); - - if (!ofw_bus_is_compatible(dev, "ti,cpsw")) - return (ENXIO); - - device_set_desc(dev, "3-port Switch Ethernet Subsystem"); - return (BUS_PROBE_DEFAULT); -} - static void cpsw_init_slots(struct cpsw_softc *sc) { @@ -468,50 +476,6 @@ cpsw_init_slots(struct cpsw_softc *sc) } } -/* - * bind an interrupt, add the relevant info to sc->interrupts - */ -static int -cpsw_attach_interrupt(struct cpsw_softc *sc, struct resource *res, driver_intr_t *handler, const char *description) -{ - void **pcookie; - int error; - - sc->interrupts[sc->interrupt_count].res = res; - sc->interrupts[sc->interrupt_count].description = description; - pcookie = &sc->interrupts[sc->interrupt_count].ih_cookie; - - error = bus_setup_intr(sc->dev, res, INTR_TYPE_NET | INTR_MPSAFE, - NULL, *handler, sc, pcookie); - if (error) - device_printf(sc->dev, - "could not setup %s\n", description); - else - ++sc->interrupt_count; - return (error); -} - -/* - * teardown everything in sc->interrupts. - */ -static void -cpsw_detach_interrupts(struct cpsw_softc *sc) -{ - int error; - int i; - - for (i = 0; i < sizeof(sc->interrupts) / sizeof(sc->interrupts[0]); ++i) { - if (!sc->interrupts[i].ih_cookie) - continue; - error = bus_teardown_intr(sc->dev, - sc->interrupts[i].res, sc->interrupts[i].ih_cookie); - if (error) - device_printf(sc->dev, "could not release %s\n", - sc->interrupts[i].description); - sc->interrupts[i].ih_cookie = NULL; - } -} - static int cpsw_add_slots(struct cpsw_softc *sc, struct cpsw_queue *queue, int requested) { @@ -527,7 +491,7 @@ cpsw_add_slots(struct cpsw_softc *sc, st if (slot == NULL) return (0); if (bus_dmamap_create(sc->mbuf_dtag, 0, &slot->dmamap)) { - if_printf(sc->ifp, "failed to create dmamap\n"); + device_printf(sc->dev, "failed to create dmamap\n"); return (ENOMEM); } STAILQ_REMOVE_HEAD(&sc->avail, next); @@ -538,56 +502,294 @@ cpsw_add_slots(struct cpsw_softc *sc, st return (0); } -static int -cpsw_attach(device_t dev) +static void +cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot) { - bus_dma_segment_t segs[1]; - struct cpsw_softc *sc = device_get_softc(dev); - struct mii_softc *miisc; - struct ifnet *ifp; - int phy, nsegs, error; + int error; + + if (slot->dmamap) { + if (slot->mbuf) + bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); + error = bus_dmamap_destroy(sc->mbuf_dtag, slot->dmamap); + KASSERT(error == 0, ("Mapping still active")); + slot->dmamap = NULL; + } + if (slot->mbuf) { + m_freem(slot->mbuf); + slot->mbuf = NULL; + } +} + +static void +cpsw_reset(struct cpsw_softc *sc) +{ + int i; + + callout_stop(&sc->watchdog.callout); + + /* Reset RMII/RGMII wrapper. */ + cpsw_write_4(sc, CPSW_WR_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_WR_SOFT_RESET) & 1) + ; + + /* Disable TX and RX interrupts for all cores. */ + for (i = 0; i < 3; ++i) { + cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_TX_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_RX_EN(i), 0x00); + cpsw_write_4(sc, CPSW_WR_C_MISC_EN(i), 0x00); + } + + /* Reset CPSW subsystem. */ + cpsw_write_4(sc, CPSW_SS_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_SS_SOFT_RESET) & 1) + ; + + /* Reset Sliver port 1 and 2 */ + for (i = 0; i < 2; i++) { + /* Reset */ + cpsw_write_4(sc, CPSW_SL_SOFT_RESET(i), 1); + while (cpsw_read_4(sc, CPSW_SL_SOFT_RESET(i)) & 1) + ; + } + + /* Reset DMA controller. */ + cpsw_write_4(sc, CPSW_CPDMA_SOFT_RESET, 1); + while (cpsw_read_4(sc, CPSW_CPDMA_SOFT_RESET) & 1) + ; + + /* Disable TX & RX DMA */ + cpsw_write_4(sc, CPSW_CPDMA_TX_CONTROL, 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_CONTROL, 0); + + /* Clear all queues. */ + for (i = 0; i < 8; i++) { + cpsw_write_4(sc, CPSW_CPDMA_TX_HDP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_HDP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_TX_CP(i), 0); + cpsw_write_4(sc, CPSW_CPDMA_RX_CP(i), 0); + } + + /* Clear all interrupt Masks */ + cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_CLEAR, 0xFFFFFFFF); + cpsw_write_4(sc, CPSW_CPDMA_TX_INTMASK_CLEAR, 0xFFFFFFFF); +} + +static void +cpsw_init(struct cpsw_softc *sc) +{ + struct cpsw_slot *slot; uint32_t reg; - pcell_t phy_id[3]; - u_long mem_base, mem_size; - phandle_t child; - int len; - CPSW_DEBUGF(("")); + /* Clear ALE */ + cpsw_write_4(sc, CPSW_ALE_CONTROL, CPSW_ALE_CTL_CLEAR_TBL); - getbinuptime(&sc->attach_uptime); - sc->dev = dev; - sc->node = ofw_bus_get_node(dev); + /* Enable ALE */ + reg = CPSW_ALE_CTL_ENABLE; + if (sc->dualemac) + reg |= CPSW_ALE_CTL_VLAN_AWARE; + cpsw_write_4(sc, CPSW_ALE_CONTROL, reg); - /* TODO: handle multiple slaves */ - phy = -1; + /* Set Host Port Mapping. */ + cpsw_write_4(sc, CPSW_PORT_P0_CPDMA_TX_PRI_MAP, 0x76543210); + cpsw_write_4(sc, CPSW_PORT_P0_CPDMA_RX_CH_MAP, 0); + + /* Initialize ALE: set host port to forwarding(3). */ + cpsw_write_4(sc, CPSW_ALE_PORTCTL(0), 3); + + cpsw_write_4(sc, CPSW_SS_PTYPE, 0); + + /* Enable statistics for ports 0, 1 and 2 */ + cpsw_write_4(sc, CPSW_SS_STAT_PORT_EN, 7); + + /* Experiment: Turn off flow control */ + /* This seems to fix the watchdog resets that have plagued + earlier versions of this driver; I'm not yet sure if there + are negative effects yet. */ + cpsw_write_4(sc, CPSW_SS_FLOW_CONTROL, 0); + + /* Make IP hdr aligned with 4 */ + cpsw_write_4(sc, CPSW_CPDMA_RX_BUFFER_OFFSET, 2); + + /* Initialize RX Buffer Descriptors */ + cpsw_write_4(sc, CPSW_CPDMA_RX_FREEBUFFER(0), 0); + + /* Enable TX & RX DMA */ + cpsw_write_4(sc, CPSW_CPDMA_TX_CONTROL, 1); + cpsw_write_4(sc, CPSW_CPDMA_RX_CONTROL, 1); + + /* Enable Interrupts for core 0 */ + cpsw_write_4(sc, CPSW_WR_C_RX_THRESH_EN(0), 0xFF); + cpsw_write_4(sc, CPSW_WR_C_RX_EN(0), 0xFF); + cpsw_write_4(sc, CPSW_WR_C_MISC_EN(0), 0x1F); + + /* Enable host Error Interrupt */ + cpsw_write_4(sc, CPSW_CPDMA_DMA_INTMASK_SET, 3); + + /* Enable interrupts for RX Channel 0 */ + cpsw_write_4(sc, CPSW_CPDMA_RX_INTMASK_SET, 1); + + /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ + /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ + cpsw_write_4(sc, MDIOCONTROL, MDIOCTL_ENABLE | MDIOCTL_FAULTENB | 0xff); + + /* Select MII in GMII_SEL, Internal Delay mode */ + //ti_scm_reg_write_4(0x650, 0); + + /* Initialize active queues. */ + slot = STAILQ_FIRST(&sc->tx.active); + if (slot != NULL) + cpsw_write_hdp_slot(sc, &sc->tx, slot); + slot = STAILQ_FIRST(&sc->rx.active); + if (slot != NULL) + cpsw_write_hdp_slot(sc, &sc->rx, slot); + cpsw_rx_enqueue(sc); + + /* Activate network interface. */ + sc->rx.running = 1; + sc->tx.running = 1; + sc->watchdog.timer = 0; + callout_init(&sc->watchdog.callout, 0); + callout_reset(&sc->watchdog.callout, hz, cpsw_tx_watchdog, sc); +} + +/* + * + * Device Probe, Attach, Detach. + * + */ + +static int +cpsw_probe(device_t dev) +{ + + if (!ofw_bus_status_okay(dev)) + return (ENXIO); + + if (!ofw_bus_is_compatible(dev, "ti,cpsw")) + return (ENXIO); + + device_set_desc(dev, "3-port Switch Ethernet Subsystem"); + return (BUS_PROBE_DEFAULT); +} + +static int +cpsw_intr_attach(struct cpsw_softc *sc) +{ + + /* Note: We don't use sc->irq_res[2] (TX interrupt) */ + if (bus_setup_intr(sc->dev, sc->irq_res[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx_thresh, + sc, &sc->ih_cookie[0]) != 0) { + return (-1); + } + if (bus_setup_intr(sc->dev, sc->irq_res[1], + INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_rx, + sc, &sc->ih_cookie[1]) != 0) { + return (-1); + } + if (bus_setup_intr(sc->dev, sc->irq_res[3], + INTR_TYPE_NET | INTR_MPSAFE, NULL, cpsw_intr_misc, + sc, &sc->ih_cookie[3]) != 0) { + return (-1); + } + + return (0); +} + +static void +cpsw_intr_detach(struct cpsw_softc *sc) +{ + int i; + + for (i = 0; i < CPSW_INTR_COUNT; i++) { + if (sc->ih_cookie[i]) { + bus_teardown_intr(sc->dev, sc->irq_res[i], + sc->ih_cookie[i]); + } + } +} + +static int +cpsw_get_fdt_data(struct cpsw_softc *sc, int port) +{ + char *name; + int len, phy, vlan; + pcell_t phy_id[3], vlan_id; + phandle_t child; + unsigned long mdio_child_addr; /* Find any slave with phy_id */ + phy = -1; + vlan = -1; for (child = OF_child(sc->node); child != 0; child = OF_peer(child)) { - len = OF_getproplen(child, "phy_id"); - if (len <= 0) + if (OF_getprop_alloc(child, "name", 1, (void **)&name) < 0) continue; - - /* Get phy address from fdt */ - if (OF_getencprop(child, "phy_id", phy_id, len) <= 0) + if (sscanf(name, "slave@%x", &mdio_child_addr) != 1) { + free(name, M_OFWPROP); continue; + } + free(name, M_OFWPROP); + if (mdio_child_addr != slave_mdio_addr[port]) + continue; + + len = OF_getproplen(child, "phy_id"); + if (len / sizeof(pcell_t) == 2) { + /* Get phy address from fdt */ + if (OF_getencprop(child, "phy_id", phy_id, len) > 0) + phy = phy_id[1]; + } - phy = phy_id[1]; - /* TODO: get memory window for MDIO */ + len = OF_getproplen(child, "dual_emac_res_vlan"); + if (len / sizeof(pcell_t) == 1) { + /* Get phy address from fdt */ + if (OF_getencprop(child, "dual_emac_res_vlan", + &vlan_id, len) > 0) { + vlan = vlan_id; + } + } break; } - - if (phy == -1) { - device_printf(dev, "failed to get PHY address from FDT\n"); + if (phy == -1) return (ENXIO); + sc->port[port].phy = phy; + sc->port[port].vlan = vlan; + + return (0); +} + +static int +cpsw_attach(device_t dev) +{ + bus_dma_segment_t segs[1]; + int error, i, nsegs; + struct cpsw_softc *sc; + uint32_t reg; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->node = ofw_bus_get_node(dev); + getbinuptime(&sc->attach_uptime); + + if (OF_getencprop(sc->node, "active_slave", &sc->active_slave, + sizeof(sc->active_slave)) <= 0) { + sc->active_slave = 0; } + if (sc->active_slave > 1) + sc->active_slave = 1; - mem_base = 0; - mem_size = 0; + if (OF_hasprop(sc->node, "dual_emac")) + sc->dualemac = 1; - if (fdt_regsize(sc->node, &mem_base, &mem_size) != 0) { - device_printf(sc->dev, "no regs property in cpsw node\n"); - return (ENXIO); + for (i = 0; i < CPSW_PORTS; i++) { + if (!sc->dualemac && i != sc->active_slave) + continue; + if (cpsw_get_fdt_data(sc, i) != 0) { + device_printf(dev, + "failed to get PHY address from FDT\n"); + return (ENXIO); + } } /* Initialize mutexes */ @@ -605,9 +807,8 @@ cpsw_attach(device_t dev) } sc->mem_rid = 0; - sc->mem_res = bus_alloc_resource(dev, SYS_RES_MEMORY, - &sc->mem_rid, mem_base, mem_base + CPSW_MEMWINDOW_SIZE -1, - CPSW_MEMWINDOW_SIZE, RF_ACTIVE); + sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->mem_rid, RF_ACTIVE); if (sc->mem_res == NULL) { device_printf(sc->dev, "failed to allocate memory resource\n"); cpsw_detach(dev); @@ -637,14 +838,6 @@ cpsw_attach(device_t dev) return (error); } - /* Allocate network interface */ - ifp = sc->ifp = if_alloc(IFT_ETHER); - if (ifp == NULL) { - device_printf(dev, "if_alloc() failed\n"); - cpsw_detach(dev); - return (ENOMEM); - } - /* Allocate the null mbuf and pre-sync it. */ sc->null_mbuf = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR); memset(sc->null_mbuf->m_data, 0, sc->null_mbuf->m_ext.ext_size); @@ -655,16 +848,6 @@ cpsw_attach(device_t dev) BUS_DMASYNC_PREWRITE); sc->null_mbuf_paddr = segs[0].ds_addr; - if_initname(ifp, device_get_name(dev), device_get_unit(dev)); - ifp->if_softc = sc; - ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; - ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_HWCSUM; //FIXME VLAN? - ifp->if_capenable = ifp->if_capabilities; - - ifp->if_init = cpsw_init; - ifp->if_start = cpsw_start; - ifp->if_ioctl = cpsw_ioctl; - cpsw_init_slots(sc); /* Allocate slots to TX and RX queues. */ @@ -674,7 +857,8 @@ cpsw_attach(device_t dev) STAILQ_INIT(&sc->tx.active); // For now: 128 slots to TX, rest to RX. // XXX TODO: start with 32/64 and grow dynamically based on demand. - if (cpsw_add_slots(sc, &sc->tx, 128) || cpsw_add_slots(sc, &sc->rx, -1)) { + if (cpsw_add_slots(sc, &sc->tx, 128) || + cpsw_add_slots(sc, &sc->rx, -1)) { device_printf(dev, "failed to allocate dmamaps\n"); cpsw_detach(dev); return (ENOMEM); @@ -682,130 +866,207 @@ cpsw_attach(device_t dev) device_printf(dev, "Initial queue size TX=%d RX=%d\n", sc->tx.queue_slots, sc->rx.queue_slots); - ifp->if_snd.ifq_drv_maxlen = sc->tx.queue_slots; - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); - sc->tx.hdp_offset = CPSW_CPDMA_TX_HDP(0); sc->rx.hdp_offset = CPSW_CPDMA_RX_HDP(0); - /* Get high part of MAC address from control module (mac_id0_hi) */ - /* TODO: Get MAC ID1 as well as MAC ID0. */ - ti_scm_reg_read_4(0x634, ®); - sc->mac_addr[0] = reg & 0xFF; - sc->mac_addr[1] = (reg >> 8) & 0xFF; - sc->mac_addr[2] = (reg >> 16) & 0xFF; - sc->mac_addr[3] = (reg >> 24) & 0xFF; - - /* Get low part of MAC address from control module (mac_id0_lo) */ - ti_scm_reg_read_4(0x630, ®); - sc->mac_addr[4] = reg & 0xFF; - sc->mac_addr[5] = (reg >> 8) & 0xFF; - - /* Initialze MDIO - ENABLE, PREAMBLE=0, FAULTENB, CLKDIV=0xFF */ - /* TODO Calculate MDCLK=CLK/(CLKDIV+1) */ - cpsw_write_4(sc, MDIOCONTROL, 1 << 30 | 1 << 18 | 0xFF); - - /* Clear ALE */ - cpsw_write_4(sc, CPSW_ALE_CONTROL, 1 << 30); - - /* Attach PHY(s) */ - error = mii_attach(dev, &sc->miibus, ifp, cpsw_ifmedia_upd, - cpsw_ifmedia_sts, BMSR_DEFCAPMASK, phy, MII_OFFSET_ANY, 0); - if (error) { - device_printf(dev, "attaching PHYs failed\n"); + if (cpsw_intr_attach(sc) == -1) { + device_printf(dev, "failed to setup interrupts\n"); cpsw_detach(dev); - return (error); + return (ENXIO); } - sc->mii = device_get_softc(sc->miibus); - /* Tell the MAC where to find the PHY so autoneg works */ - miisc = LIST_FIRST(&sc->mii->mii_phys); + /* Reset the controller. */ + cpsw_reset(sc); + cpsw_init(sc); - /* Select PHY and enable interrupts */ - cpsw_write_4(sc, MDIOUSERPHYSEL0, 1 << 6 | (miisc->mii_phy & 0x1F)); - - /* Note: We don't use sc->res[3] (TX interrupt) */ - if (cpsw_attach_interrupt(sc, sc->irq_res[0], - cpsw_intr_rx_thresh, "CPSW RX threshold interrupt") || - cpsw_attach_interrupt(sc, sc->irq_res[1], - cpsw_intr_rx, "CPSW RX interrupt") || - cpsw_attach_interrupt(sc, sc->irq_res[3], - cpsw_intr_misc, "CPSW misc interrupt")) { - cpsw_detach(dev); - return (ENXIO); + for (i = 0; i < CPSW_PORTS; i++) { + if (!sc->dualemac && i != sc->active_slave) + continue; + sc->port[i].dev = device_add_child(dev, "cpsw", i); + if (sc->port[i].dev == NULL) { + cpsw_detach(dev); + return (ENXIO); + } } - - ether_ifattach(ifp, sc->mac_addr); - callout_init(&sc->watchdog.callout, 0); + bus_generic_attach(dev); return (0); } -static void -cpsw_free_slot(struct cpsw_softc *sc, struct cpsw_slot *slot) -{ - int error; - - if (slot->dmamap) { - error = bus_dmamap_destroy(sc->mbuf_dtag, slot->dmamap); - KASSERT(error == 0, ("Mapping still active")); - slot->dmamap = NULL; - } - if (slot->mbuf) { - m_freem(slot->mbuf); - slot->mbuf = NULL; - } -} - static int cpsw_detach(device_t dev) { - struct cpsw_softc *sc = device_get_softc(dev); + struct cpsw_softc *sc; int error, i; - CPSW_DEBUGF(("")); + bus_generic_detach(dev); + sc = device_get_softc(dev); + + for (i = 0; i < CPSW_PORTS; i++) { + if (sc->port[i].dev) + device_delete_child(dev, sc->port[i].dev); + } - /* Stop controller and free TX queue */ if (device_is_attached(dev)) { - ether_ifdetach(sc->ifp); - CPSW_GLOBAL_LOCK(sc); - cpsw_shutdown_locked(sc); - CPSW_GLOBAL_UNLOCK(sc); + callout_stop(&sc->watchdog.callout); callout_drain(&sc->watchdog.callout); } - bus_generic_detach(dev); - if (sc->miibus) - device_delete_child(dev, sc->miibus); - /* Stop and release all interrupts */ - cpsw_detach_interrupts(sc); + cpsw_intr_detach(sc); /* Free dmamaps and mbufs */ for (i = 0; i < sizeof(sc->_slots) / sizeof(sc->_slots[0]); ++i) cpsw_free_slot(sc, &sc->_slots[i]); + + /* Free null mbuf. */ if (sc->null_mbuf_dmamap) { + bus_dmamap_unload(sc->mbuf_dtag, sc->null_mbuf_dmamap); error = bus_dmamap_destroy(sc->mbuf_dtag, sc->null_mbuf_dmamap); KASSERT(error == 0, ("Mapping still active")); - } - if (sc->null_mbuf) m_freem(sc->null_mbuf); + } /* Free DMA tag */ - error = bus_dma_tag_destroy(sc->mbuf_dtag); - KASSERT(error == 0, ("Unable to destroy DMA tag")); + if (sc->mbuf_dtag) { + error = bus_dma_tag_destroy(sc->mbuf_dtag); + KASSERT(error == 0, ("Unable to destroy DMA tag")); + } + + /* Free IO memory handler */ + if (sc->mem_res != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); + bus_release_resources(dev, irq_res_spec, sc->irq_res); + + /* Destroy mutexes */ + mtx_destroy(&sc->rx.lock); + mtx_destroy(&sc->tx.lock); + + return (0); +} + +static phandle_t +cpsw_get_node(device_t bus, device_t dev) +{ + + /* Share controller node with port device. */ + return (ofw_bus_get_node(bus)); +} + +static int +cpswp_probe(device_t dev) +{ + + if (device_get_unit(dev) > 1) { + device_printf(dev, "Only two ports are supported.\n"); + return (ENXIO); + } + device_set_desc(dev, "Ethernet Switch Port"); + + return (BUS_PROBE_DEFAULT); +} + +static int +cpswp_attach(device_t dev) +{ + int error; + struct ifnet *ifp; + struct cpswp_softc *sc; + uint32_t reg; + uint8_t mac_addr[ETHER_ADDR_LEN]; + + sc = device_get_softc(dev); + sc->dev = dev; + sc->pdev = device_get_parent(dev); + sc->swsc = device_get_softc(sc->pdev); + sc->unit = device_get_unit(dev); + sc->phy = sc->swsc->port[sc->unit].phy; + sc->vlan = sc->swsc->port[sc->unit].vlan; + if (sc->swsc->dualemac && sc->vlan == -1) + sc->vlan = sc->unit + 1; + + if (sc->unit == 0) { + sc->physel = MDIOUSERPHYSEL0; + sc->phyaccess = MDIOUSERACCESS0; + } else { + sc->physel = MDIOUSERPHYSEL1; + sc->phyaccess = MDIOUSERACCESS1; + } + + mtx_init(&sc->lock, device_get_nameunit(dev), "cpsw port lock", + MTX_DEF); + + /* Allocate network interface */ + ifp = sc->ifp = if_alloc(IFT_ETHER); + if (ifp == NULL) { + cpswp_detach(dev); + return (ENXIO); + } + + if_initname(ifp, device_get_name(sc->dev), sc->unit); + ifp->if_softc = sc; + ifp->if_flags = IFF_SIMPLEX | IFF_MULTICAST | IFF_BROADCAST; + ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_HWCSUM; //FIXME VLAN? + ifp->if_capenable = ifp->if_capabilities; + + ifp->if_init = cpswp_init; + ifp->if_start = cpswp_start; + ifp->if_ioctl = cpswp_ioctl; + + ifp->if_snd.ifq_drv_maxlen = sc->swsc->tx.queue_slots; + IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); + IFQ_SET_READY(&ifp->if_snd); + + /* Get high part of MAC address from control module (mac_id[0|1]_hi) */ + ti_scm_reg_read_4(0x634 + sc->unit * 8, ®); + mac_addr[0] = reg & 0xFF; + mac_addr[1] = (reg >> 8) & 0xFF; + mac_addr[2] = (reg >> 16) & 0xFF; + mac_addr[3] = (reg >> 24) & 0xFF; + + /* Get low part of MAC address from control module (mac_id[0|1]_lo) */ + ti_scm_reg_read_4(0x630 + sc->unit * 8, ®); + mac_addr[4] = reg & 0xFF; + mac_addr[5] = (reg >> 8) & 0xFF; + + error = mii_attach(dev, &sc->miibus, ifp, cpswp_ifmedia_upd, + cpswp_ifmedia_sts, BMSR_DEFCAPMASK, sc->phy, MII_OFFSET_ANY, 0); + if (error) { + device_printf(dev, "attaching PHYs failed\n"); + cpswp_detach(dev); + return (error); + } + sc->mii = device_get_softc(sc->miibus); + + /* Select PHY and enable interrupts */ + cpsw_write_4(sc->swsc, sc->physel, + MDIO_PHYSEL_LINKINTENB | (sc->phy & 0x1F)); + + ether_ifattach(sc->ifp, mac_addr); + callout_init(&sc->mii_callout, 0); + + return (0); +} + +static int +cpswp_detach(device_t dev) +{ + struct cpswp_softc *sc; - /* Free IO memory handler */ - bus_release_resource(dev, SYS_RES_MEMORY, sc->mem_rid, sc->mem_res); - bus_release_resources(dev, irq_res_spec, sc->irq_res); + sc = device_get_softc(dev); + CPSWP_DEBUGF(sc, ("")); + if (device_is_attached(dev)) { + ether_ifdetach(sc->ifp); + CPSW_PORT_LOCK(sc); + cpswp_stop_locked(sc); + CPSW_PORT_UNLOCK(sc); + callout_drain(&sc->mii_callout); + } - if (sc->ifp != NULL) - if_free(sc->ifp); + bus_generic_detach(dev); - /* Destroy mutexes */ - mtx_destroy(&sc->rx.lock); - mtx_destroy(&sc->tx.lock); + if_free(sc->ifp); + mtx_destroy(&sc->lock); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Thu Mar 17 20:04:39 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4078AD45DA; Thu, 17 Mar 2016 20:04:39 +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 B3E8A3F1; Thu, 17 Mar 2016 20:04:39 +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 u2HK4cTe085841 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Mar 2016 13:04:38 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2HK4bGT085840; Thu, 17 Mar 2016 13:04:37 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Mar 2016 13:04:37 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <20160317200437.GW1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203601.GO1328@FreeBSD.org> <56EA5A96.5070402@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56EA5A96.5070402@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 20:04:40 -0000 On Thu, Mar 17, 2016 at 08:19:50AM +0100, Hans Petter Selasky wrote: H> On 03/16/16 21:36, Gleb Smirnoff wrote: H> > On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: H> > H> Modified: head/sys/sys/sysctl.h H> > H> ============================================================================== H> > H> --- head/sys/sys/sysctl.h Wed Mar 16 06:42:15 2016 (r296932) H> > H> +++ head/sys/sys/sysctl.h Wed Mar 16 08:37:52 2016 (r296933) H> > H> @@ -654,8 +654,10 @@ TAILQ_HEAD(sysctl_ctx_list, sysctl_ctx_e H> > H> SYSCTL_OID(parent, nbr, name, \ H> > H> CTLTYPE_OPAQUE | CTLFLAG_MPSAFE | (access), \ H> > H> (ptr), (len), sysctl_handle_counter_u64_array, "S", descr); \ H> > H> - CTASSERT(((access) & CTLTYPE) == 0 || \ H> > H> - ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) H> > H> + CTASSERT((((access) & CTLTYPE) == 0 || \ H> > H> + ((access) & SYSCTL_CT_ASSERT_MASK) == CTLTYPE_OPAQUE) && \ H> > H> + sizeof(counter_u64_t) == sizeof(*(ptr)) && \ H> > H> + sizeof(uint64_t) == sizeof(**(ptr))) H> > H> > I don't agree with the last line. Does it assert that counter_u64_t is H> > implemented using uint64_t? That is true, but that is internal detail, H> > that might be changed in future. H> > H> H> Yes, it asserts that counter_u64_t is a 64-bit counter, as the name of H> the typedef hints at. H> H> From the past experience there has been several cases where someone has H> changed a field in structure which is exported as a sysctl, and then the H> sysctls were never updated. It could be that counter_u64_t becomes a machine dependent typedef, being different size on different machines. Unlikely, but possible. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Thu Mar 17 20:06:16 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A057AD466E; Thu, 17 Mar 2016 20:06:16 +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 285897DF; Thu, 17 Mar 2016 20:06:15 +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 u2HK6FLh085857 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 17 Mar 2016 13:06:15 -0700 (PDT) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id u2HK6Fw6085856; Thu, 17 Mar 2016 13:06:15 -0700 (PDT) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 17 Mar 2016 13:06:15 -0700 From: Gleb Smirnoff To: Hans Petter Selasky Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r296933 - in head: share/man/man9 sys/sys Message-ID: <20160317200615.GX1328@FreeBSD.org> References: <201603160837.u2G8bqgr087126@repo.freebsd.org> <20160316203241.GM1328@FreeBSD.org> <56EA5AE8.4050700@selasky.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56EA5AE8.4050700@selasky.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Mar 2016 20:06:16 -0000 On Thu, Mar 17, 2016 at 08:21:12AM +0100, Hans Petter Selasky wrote: H> On 03/16/16 21:32, Gleb Smirnoff wrote: H> > On Wed, Mar 16, 2016 at 08:37:52AM +0000, Hans Petter Selasky wrote: H> > H> Author: hselasky H> > H> Date: Wed Mar 16 08:37:52 2016 H> > H> New Revision: 296933 H> > H> URL: https://svnweb.freebsd.org/changeset/base/296933 H> > H> H> > H> Log: H> > H> Improve the implementation and documentation of the H> > H> SYSCTL_COUNTER_U64_ARRAY() macro. H> > H> H> > H> - Add proper asserts to the SYSCTL_COUNTER_U64_ARRAY() macro that checks H> > H> the size of the first element of the array. H> > H> - Add an example to the counter(9) manual page how to use the H> > H> SYSCTL_COUNTER_U64_ARRAY() macro. H> > H> - Add some missing symbolic links for counter(9) while at it. H> > H> > ... H> > H> > H> +.Sh EXAMPLES H> > H> +The following example creates a static counter array exported to H> > H> +userspace through a sysctl: H> > H> +.Bd -literal -offset indent H> > H> +#define MY_SIZE 8 H> > H> +static counter_u64_t array[MY_SIZE]; H> > H> +SYSCTL_COUNTER_U64_ARRAY(_debug, OID_AUTO, counter_array, CTLFLAG_RW, H> > H> + &array[0], MY_SIZE, "Test counter array"); H> > H> > I always wondered what is stylistically better: array or &array[0]? I H> > usually prefer the former. H> > H> H> A question: If you pass "array" why do you need a length argument in the H> SYSCTL macro. Can't you get the length of the array like H> sizeof(array)/sizeof((array)[0]) inside the macro? IMHO, that's a good idea for the static sysctl declaration. I can't imagine a good case when size in array declaration and in the SYSCTL declaration would differ. -- Totus tuus, Glebius. From owner-svn-src-head@freebsd.org Fri Mar 18 01:26:57 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 162DFAD4F64; Fri, 18 Mar 2016 01:26:57 +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 DBE781836; Fri, 18 Mar 2016 01:26:56 +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 u2I1Qu1c039411; Fri, 18 Mar 2016 01:26:56 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I1QuL8039410; Fri, 18 Mar 2016 01:26:56 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180126.u2I1QuL8039410@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 01:26:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296999 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 01:26:57 -0000 Author: jhibbits Date: Fri Mar 18 01:26:55 2016 New Revision: 296999 URL: https://svnweb.freebsd.org/changeset/base/296999 Log: Add ummax()/ummin() to libkern. This is committed in isolation from a larger patch so that it can be MFC'd separately if needed. Modified: head/sys/sys/libkern.h Modified: head/sys/sys/libkern.h ============================================================================== --- head/sys/sys/libkern.h Fri Mar 18 00:02:46 2016 (r296998) +++ head/sys/sys/libkern.h Fri Mar 18 01:26:55 2016 (r296999) @@ -65,6 +65,16 @@ static __inline u_quad_t uqmax(u_quad_t static __inline u_quad_t uqmin(u_quad_t a, u_quad_t b) { return (a < b ? a : b); } 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); } +static __inline __uintmax_t ummax(__uintmax_t a, __uintmax_t b) +{ + + return (a > b ? a : b); +} +static __inline __uintmax_t ummin(__uintmax_t a, __uintmax_t b) +{ + + return (a < b ? a : b); +} static __inline off_t omax(off_t a, off_t b) { return (a > b ? a : b); } static __inline off_t omin(off_t a, off_t b) { return (a < b ? a : b); } From owner-svn-src-head@freebsd.org Fri Mar 18 01:28:47 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 220F9AD4001; Fri, 18 Mar 2016 01:28:47 +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 B2BD519F7; Fri, 18 Mar 2016 01:28:46 +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 u2I1Sj9q039545; Fri, 18 Mar 2016 01:28:45 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I1SfaM039505; Fri, 18 Mar 2016 01:28:41 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180128.u2I1SfaM039505@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 01:28:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297000 - in head: . sys/arm/xscale/ixp425 sys/arm/xscale/pxa sys/compat/ndis sys/dev/acpica sys/dev/advansys sys/dev/atkbdc sys/dev/bxe sys/dev/cardbus sys/dev/ctau sys/dev/ed sys/dev/... X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 01:28:47 -0000 Author: jhibbits Date: Fri Mar 18 01:28:41 2016 New Revision: 297000 URL: https://svnweb.freebsd.org/changeset/base/297000 Log: Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. On some architectures, u_long isn't large enough for resource definitions. Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but type `long' is only 32-bit. This extends rman's resources to uintmax_t. With this change, any resource can feasibly be placed anywhere in physical memory (within the constraints of the driver). Why uintmax_t and not something machine dependent, or uint64_t? Though it's possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb the increase on resource sizes if and when this occurs, and the number of resources on memory-constrained systems should be sufficiently small as to not pose a drastic overhead. That being said, uintmax_t was chosen for source clarity. If it's specified as uint64_t, all printf()-like calls would either need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t aren't horrible, but it would also bake into the API for resource_list_print_type() either a hidden assumption that entries get cast to uintmax_t for printing, or these calls would need the PRI*64 macros. Since source code is meant to be read more often than written, I chose the clearest path of simply using uintmax_t. Tested on a PowerPC p5020-based board, which places all device resources in 0xfxxxxxxxx, and has 8GB RAM. Regression tested on qemu-system-i386 Regression tested on qemu-system-mips (malta profile) Tested PAE and devinfo on virtualbox (live CD) Special thanks to bz for his testing on ARM. Reviewed By: bz, jhb (previous) Relnotes: Yes Sponsored by: Alex Perez/Inertial Computing Differential Revision: https://reviews.freebsd.org/D4544 Modified: head/UPDATING head/sys/arm/xscale/ixp425/avila_ata.c head/sys/arm/xscale/ixp425/ixp425.c head/sys/arm/xscale/pxa/pxa_obio.c head/sys/compat/ndis/kern_ndis.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_timer.c head/sys/dev/advansys/adv_isa.c head/sys/dev/atkbdc/atkbdc_subr.c head/sys/dev/bxe/bxe.c head/sys/dev/cardbus/cardbus_cis.c head/sys/dev/ctau/if_ct.c head/sys/dev/ed/if_ed_3c503.c head/sys/dev/ed/if_ed_cbus.c head/sys/dev/fdt/simplebus.c head/sys/dev/iir/iir_pci.c head/sys/dev/mca/mca_bus.c head/sys/dev/mxge/if_mxge.c head/sys/dev/ofw/ofwbus.c head/sys/dev/pccard/pccard.c head/sys/dev/pccard/pccard_cis.c head/sys/dev/pccbb/pccbb.c head/sys/dev/pccbb/pccbb_pci.c head/sys/dev/pci/pci.c head/sys/dev/pci/pci_pci.c head/sys/dev/pci/pci_subr.c head/sys/dev/ppc/ppc.c head/sys/dev/proto/proto_bus_isa.c head/sys/dev/sound/isa/ad1816.c head/sys/dev/sound/isa/ess.c head/sys/dev/sound/isa/mss.c head/sys/dev/sound/isa/sb16.c head/sys/dev/sound/isa/sb8.c head/sys/dev/sound/pci/als4000.c head/sys/dev/sound/pci/atiixp.c head/sys/dev/sound/pci/aureal.c head/sys/dev/sound/pci/cmi.c head/sys/dev/sound/pci/cs4281.c head/sys/dev/sound/pci/csapcm.c head/sys/dev/sound/pci/ds1.c head/sys/dev/sound/pci/emu10k1.c head/sys/dev/sound/pci/emu10kx.c head/sys/dev/sound/pci/envy24.c head/sys/dev/sound/pci/envy24ht.c head/sys/dev/sound/pci/es137x.c head/sys/dev/sound/pci/fm801.c head/sys/dev/sound/pci/hdspe-pcm.c head/sys/dev/sound/pci/ich.c head/sys/dev/sound/pci/maestro.c head/sys/dev/sound/pci/maestro3.c head/sys/dev/sound/pci/neomagic.c head/sys/dev/sound/pci/solo.c head/sys/dev/sound/pci/t4dwave.c head/sys/dev/sound/pci/via8233.c head/sys/dev/sound/pci/via82c686.c head/sys/dev/sound/pci/vibes.c head/sys/dev/wl/if_wl.c head/sys/dev/xe/if_xe.c head/sys/dev/xe/if_xe_pccard.c head/sys/kern/subr_rman.c head/sys/mips/atheros/apb.c head/sys/mips/mips/nexus.c head/sys/mips/nlm/xlp_pci.c head/sys/mips/nlm/xlp_simplebus.c head/sys/mips/rmi/iodi.c head/sys/mips/rmi/xlr_pci.c head/sys/powerpc/mpc85xx/lbc.c head/sys/powerpc/ofw/ofw_pci.c head/sys/powerpc/powermac/uninorth.c head/sys/powerpc/powerpc/nexus.c head/sys/sparc64/pci/apb.c head/sys/sys/_types.h head/sys/sys/param.h head/sys/x86/x86/io_apic.c head/usr.sbin/devinfo/devinfo.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Mar 18 01:26:55 2016 (r296999) +++ head/UPDATING Fri Mar 18 01:28:41 2016 (r297000) @@ -31,6 +31,10 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 11 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) +20160317: + Resource range types have grown from unsigned long to uintmax_t. All + drivers, and anything using libdevinfo, need to be recompiled. + 20160311: WITH_FAST_DEPEND is now enabled by default for in-tree and out-of-tree builds. It no longer runs mkdep(1) during 'make depend', and the Modified: head/sys/arm/xscale/ixp425/avila_ata.c ============================================================================== --- head/sys/arm/xscale/ixp425/avila_ata.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/arm/xscale/ixp425/avila_ata.c Fri Mar 18 01:28:41 2016 (r297000) @@ -287,7 +287,7 @@ ata_avila_alloc_resource(device_t dev, d struct ata_avila_softc *sc = device_get_softc(dev); KASSERT(type == SYS_RES_IRQ && *rid == ATA_IRQ_RID, - ("type %u rid %u start %lu end %lu count %lu flags %u", + ("type %u rid %u start %ju end %ju count %ju flags %u", type, *rid, start, end, count, flags)); /* doesn't matter what we return so reuse the real thing */ Modified: head/sys/arm/xscale/ixp425/ixp425.c ============================================================================== --- head/sys/arm/xscale/ixp425/ixp425.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/arm/xscale/ixp425/ixp425.c Fri Mar 18 01:28:41 2016 (r297000) @@ -533,7 +533,7 @@ ixp425_alloc_resource(device_t dev, devi (start - vtrans->hwbase); if (bootverbose) device_printf(child, - "%s: assign 0x%lx:0x%lx%s\n", + "%s: assign 0x%jx:0x%jx%s\n", __func__, start, end - start, vtrans->isa4x ? " A4X" : vtrans->isslow ? " SLOW" : ""); @@ -542,14 +542,14 @@ ixp425_alloc_resource(device_t dev, devi vtrans = gethwvtrans(start, end - start); if (vtrans == NULL) { /* likely means above table needs to be updated */ - device_printf(child, "%s: no mapping for 0x%lx:0x%lx\n", + device_printf(child, "%s: no mapping for 0x%jx:0x%jx\n", __func__, start, end - start); return NULL; } rv = rman_reserve_resource(&sc->sc_mem_rman, start, end, end - start, flags, child); if (rv == NULL) { - device_printf(child, "%s: cannot reserve 0x%lx:0x%lx\n", + device_printf(child, "%s: cannot reserve 0x%jx:0x%jx\n", __func__, start, end - start); return NULL; } @@ -586,7 +586,7 @@ ixp425_activate_resource(device_t dev, d if (type == SYS_RES_MEMORY) { vtrans = gethwvtrans(rman_get_start(r), rman_get_size(r)); if (vtrans == NULL) { /* NB: should not happen */ - device_printf(child, "%s: no mapping for 0x%lx:0x%lx\n", + device_printf(child, "%s: no mapping for 0x%jx:0x%jx\n", __func__, rman_get_start(r), rman_get_size(r)); return (ENOENT); } Modified: head/sys/arm/xscale/pxa/pxa_obio.c ============================================================================== --- head/sys/arm/xscale/pxa/pxa_obio.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/arm/xscale/pxa/pxa_obio.c Fri Mar 18 01:28:41 2016 (r297000) @@ -390,7 +390,7 @@ pxa_alloc_gpio_irq(device_t dev, device_ } if (bootverbose) - device_printf(dev, "lazy allocation of irq %ld for %s\n", + device_printf(dev, "lazy allocation of irq %jd for %s\n", start, device_get_nameunit(child)); return (rv); Modified: head/sys/compat/ndis/kern_ndis.c ============================================================================== --- head/sys/compat/ndis/kern_ndis.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/compat/ndis/kern_ndis.c Fri Mar 18 01:28:41 2016 (r297000) @@ -348,13 +348,13 @@ ndis_create_sysctls(arg) ndis_add_sysctl(sc, "BusType", "Bus Type", buf, NDIS_FLAG_RDONLY); if (sc->ndis_res_io != NULL) { - sprintf(buf, "0x%lx", rman_get_start(sc->ndis_res_io)); + sprintf(buf, "0x%jx", rman_get_start(sc->ndis_res_io)); ndis_add_sysctl(sc, "IOBaseAddress", "Base I/O Address", buf, NDIS_FLAG_RDONLY); } if (sc->ndis_irq != NULL) { - sprintf(buf, "%lu", rman_get_start(sc->ndis_irq)); + sprintf(buf, "%ju", rman_get_start(sc->ndis_irq)); ndis_add_sysctl(sc, "InterruptNumber", "Interrupt Number", buf, NDIS_FLAG_RDONLY); } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/acpica/acpi.c Fri Mar 18 01:28:41 2016 (r297000) @@ -795,10 +795,10 @@ acpi_print_child(device_t bus, device_t int retval = 0; retval += bus_print_child_header(bus, child); - 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(child)) retval += printf(" flags %#x", device_get_flags(child)); retval += bus_print_child_domain(bus, child); @@ -1156,7 +1156,7 @@ acpi_sysres_alloc(device_t dev) rl = BUS_GET_RESOURCE_LIST(device_get_parent(dev), dev); STAILQ_FOREACH(rle, rl, link) { if (rle->res != NULL) { - device_printf(dev, "duplicate resource for %lx\n", rle->start); + device_printf(dev, "duplicate resource for %jx\n", rle->start); continue; } @@ -1179,7 +1179,7 @@ acpi_sysres_alloc(device_t dev) rman_manage_region(rm, rman_get_start(res), rman_get_end(res)); rle->res = res; } else if (bootverbose) - device_printf(dev, "reservation of %lx, %lx (%d) failed\n", + device_printf(dev, "reservation of %jx, %jx (%d) failed\n", rle->start, rle->count, rle->type); } return (0); Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/acpica/acpi_hpet.c Fri Mar 18 01:28:41 2016 (r297000) @@ -453,7 +453,7 @@ hpet_attach(device_t dev) /* Validate that we can access the whole region. */ if (rman_get_size(sc->mem_res) < HPET_MEM_WIDTH) { - device_printf(dev, "memory region width %ld too small\n", + device_printf(dev, "memory region width %jd too small\n", rman_get_size(sc->mem_res)); bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); return (ENXIO); Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/acpica/acpi_timer.c Fri Mar 18 01:28:41 2016 (r297000) @@ -152,7 +152,7 @@ acpi_timer_identify(driver_t *driver, de rlen = AcpiGbl_FADT.PmTimerLength; rstart = AcpiGbl_FADT.XPmTimerBlock.Address; if (bus_set_resource(dev, rtype, rid, rstart, rlen)) - device_printf(dev, "couldn't set resource (%s 0x%lx+0x%lx)\n", + device_printf(dev, "couldn't set resource (%s 0x%jx+0x%jx)\n", (rtype == SYS_RES_IOPORT) ? "port" : "mem", rstart, rlen); return_VOID; } Modified: head/sys/dev/advansys/adv_isa.c ============================================================================== --- head/sys/dev/advansys/adv_isa.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/advansys/adv_isa.c Fri Mar 18 01:28:41 2016 (r297000) @@ -136,7 +136,7 @@ adv_isa_probe(device_t dev) || (iobase != adv_isa_ioports[port_index])) { if (bootverbose) device_printf(dev, - "Invalid baseport of 0x%lx specified. " + "Invalid baseport of 0x%jx specified. " "Nearest valid baseport is 0x%x. Failing " "probe.\n", iobase, (port_index <= max_port_index) ? Modified: head/sys/dev/atkbdc/atkbdc_subr.c ============================================================================== --- head/sys/dev/atkbdc/atkbdc_subr.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/atkbdc/atkbdc_subr.c Fri Mar 18 01:28:41 2016 (r297000) @@ -63,7 +63,7 @@ atkbdc_print_child(device_t bus, device_ retval += printf(" flags 0x%x", flags); irq = bus_get_resource_start(dev, SYS_RES_IRQ, kbdcdev->rid); if (irq != 0) - retval += printf(" irq %ld", irq); + retval += printf(" irq %jd", irq); retval += bus_print_child_footer(bus, dev); return (retval); Modified: head/sys/dev/bxe/bxe.c ============================================================================== --- head/sys/dev/bxe/bxe.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/bxe/bxe.c Fri Mar 18 01:28:41 2016 (r297000) @@ -12845,7 +12845,7 @@ bxe_allocate_bars(struct bxe_softc *sc) sc->bar[i].handle = rman_get_bushandle(sc->bar[i].resource); sc->bar[i].kva = (vm_offset_t)rman_get_virtual(sc->bar[i].resource); - BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%ld) -> %p\n", + BLOGI(sc, "PCI BAR%d [%02x] memory allocated: %p-%p (%jd) -> %p\n", i, PCIR_BAR(i), (void *)rman_get_start(sc->bar[i].resource), (void *)rman_get_end(sc->bar[i].resource), Modified: head/sys/dev/cardbus/cardbus_cis.c ============================================================================== --- head/sys/dev/cardbus/cardbus_cis.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/cardbus/cardbus_cis.c Fri Mar 18 01:28:41 2016 (r297000) @@ -485,7 +485,8 @@ cardbus_read_tuple_init(device_t cbdev, "to read CIS.\n"); return (NULL); } - DEVPRINTF((cbdev, "CIS Mapped to %#lx\n", rman_get_start(res))); + DEVPRINTF((cbdev, "CIS Mapped to %#jx\n", + rman_get_start(res))); /* Flip to the right ROM image if CIS is in ROM */ if (space == PCIM_CIS_ASI_ROM) { Modified: head/sys/dev/ctau/if_ct.c ============================================================================== --- head/sys/dev/ctau/if_ct.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/ctau/if_ct.c Fri Mar 18 01:28:41 2016 (r297000) @@ -459,7 +459,7 @@ static int ct_probe (device_t dev) } if (!ct_probe_board (iobase, -1, -1)) { - printf ("ct%d: probing for Tau-ISA at %lx faild\n", unit, iobase); + printf ("ct%d: probing for Tau-ISA at %jx faild\n", unit, iobase); return ENXIO; } @@ -632,7 +632,7 @@ static int ct_attach (device_t dev) ct_ln[2] = '0' + unit; mtx_init (&bd->ct_mtx, ct_ln, MTX_NETWORK_LOCK, MTX_DEF|MTX_RECURSE); if (! probe_irq (b, irq)) { - printf ("ct%d: irq %ld not functional\n", unit, irq); + printf ("ct%d: irq %jd not functional\n", unit, irq); bd->board = 0; adapter [unit] = 0; free (b, M_DEVBUF); @@ -651,7 +651,7 @@ static int ct_attach (device_t dev) if (bus_setup_intr (dev, bd->irq_res, INTR_TYPE_NET|INTR_MPSAFE, NULL, ct_intr, bd, &bd->intrhand)) { - printf ("ct%d: Can't setup irq %ld\n", unit, irq); + printf ("ct%d: Can't setup irq %jd\n", unit, irq); bd->board = 0; adapter [unit] = 0; free (b, M_DEVBUF); Modified: head/sys/dev/ed/if_ed_3c503.c ============================================================================== --- head/sys/dev/ed/if_ed_3c503.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/ed/if_ed_3c503.c Fri Mar 18 01:28:41 2016 (r297000) @@ -324,7 +324,7 @@ ed_probe_3Com(device_t dev, int port_rid ed_asic_outb(sc, ED_3COM_IDCFR, ED_3COM_IDCFR_IRQ5); break; default: - device_printf(dev, "Invalid irq configuration (%ld) must be 3-5,9 for 3c503\n", + device_printf(dev, "Invalid irq configuration (%jd) must be 3-5,9 for 3c503\n", irq); return (ENXIO); } Modified: head/sys/dev/ed/if_ed_cbus.c ============================================================================== --- head/sys/dev/ed/if_ed_cbus.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/ed/if_ed_cbus.c Fri Mar 18 01:28:41 2016 (r297000) @@ -1021,7 +1021,7 @@ ed_probe_CNET98(device_t dev, int port_r if (((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) || ((rman_get_start(sc->port_res) & 0xf000) < (u_short) 0xa000)) { #ifdef DIAGNOSTIC - device_printf(dev, "Invalid i/o port configuration (0x%lx) " + device_printf(dev, "Invalid i/o port configuration (0x%jx) " "must be %s for %s\n", rman_get_start(sc->port_res), "0x[a-f]3d0", "CNET98"); #endif @@ -1032,7 +1032,7 @@ ed_probe_CNET98(device_t dev, int port_r /* Check window area address */ tmp_s = rman_get_start(sc->mem_res) >> 12; if (tmp_s < 0x80) { - device_printf(dev, "Please change window address(0x%lx)\n", + device_printf(dev, "Please change window address(0x%jx)\n", rman_get_start(sc->mem_res)); return (ENXIO); } @@ -1040,8 +1040,8 @@ ed_probe_CNET98(device_t dev, int port_r tmp_s &= 0x0f; tmp = rman_get_start(sc->port_res) >> 12; if ((tmp_s <= tmp) && (tmp < (tmp_s + 4))) { - device_printf(dev, "Please change iobase address(0x%lx) " - "or window address(0x%lx)\n", + device_printf(dev, "Please change iobase address(0x%jx) " + "or window address(0x%jx)\n", rman_get_start(sc->port_res), rman_get_start(sc->mem_res)); return (ENXIO); @@ -1128,7 +1128,7 @@ ed_probe_CNET98(device_t dev, int port_r tmp = ED_CNET98_INT_IRQ13; break; default: - device_printf(dev, "Invalid irq configuration (%ld) must be " + device_printf(dev, "Invalid irq configuration (%jd) must be " "%s for %s\n", conf_irq, "3,5,6,9,12,13", "CNET98"); return (ENXIO); } @@ -1169,7 +1169,7 @@ ed_probe_CNET98EL(device_t dev, int port /* Check I/O address. 0x[0-f]3d0 are allowed. */ if ((rman_get_start(sc->port_res) & 0x0fff) != 0x03d0) { #ifdef DIAGNOSTIC - device_printf(dev, "Invalid i/o port configuration (0x%lx) " + device_printf(dev, "Invalid i/o port configuration (0x%jx) " "must be %s for %s\n", rman_get_start(sc->port_res), "0x?3d0", "CNET98E/L"); #endif @@ -1223,7 +1223,7 @@ ed_probe_CNET98EL(device_t dev, int port break; #endif default: - device_printf(dev, "Invalid irq configuration (%ld) must be " + device_printf(dev, "Invalid irq configuration (%jd) must be " "%s for %s\n", conf_irq, "3,5,6", "CNET98E/L"); return (ENXIO); } @@ -1285,7 +1285,7 @@ ed_probe_NEC77(device_t dev, int port_ri tmp = ED_NEC77_IRQ13; break; default: - device_printf(dev, "Invalid irq configuration (%ld) must be " + device_printf(dev, "Invalid irq configuration (%jd) must be " "%s for %s\n", conf_irq, "3,5,6,12,13", "PC-9801-77"); return (ENXIO); } @@ -1337,7 +1337,7 @@ ed_probe_NW98X(device_t dev, int port_ri tmp = ED_NW98X_IRQ13; break; default: - device_printf(dev, "Invalid irq configuration (%ld) must be " + device_printf(dev, "Invalid irq configuration (%jd) must be " "%s for %s\n", conf_irq, "3,5,6,12,13", "EC/EP-98X"); return (ENXIO); } @@ -1439,7 +1439,7 @@ ed_probe_SB98(device_t dev, int port_rid /* Check I/O address. 00d[02468ace] are allowed. */ if ((rman_get_start(sc->port_res) & ~0x000e) != 0x00d0) { #ifdef DIAGNOSTIC - device_printf(dev, "Invalid i/o port configuration (0x%lx) " + device_printf(dev, "Invalid i/o port configuration (0x%jx) " "must be %s for %s\n", rman_get_start(sc->port_res), "0xd?", "SB9801"); #endif @@ -1475,7 +1475,7 @@ ed_probe_SB98(device_t dev, int port_rid tmp = ED_SB98_CFG_IRQ12; break; default: - device_printf(dev, "Invalid irq configuration (%ld) must be " + device_printf(dev, "Invalid irq configuration (%jd) must be " "%s for %s\n", conf_irq, "3,5,6,12", "SB9801"); return (ENXIO); } Modified: head/sys/dev/fdt/simplebus.c ============================================================================== --- head/sys/dev/fdt/simplebus.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/fdt/simplebus.c Fri Mar 18 01:28:41 2016 (r297000) @@ -369,7 +369,7 @@ simplebus_alloc_resource(device_t bus, d if (j == sc->nranges && sc->nranges != 0) { if (bootverbose) device_printf(bus, "Could not map resource " - "%#lx-%#lx\n", start, end); + "%#jx-%#jx\n", start, end); return (NULL); } @@ -387,8 +387,8 @@ simplebus_print_res(struct simplebus_dev if (di == NULL) return (0); 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/dev/iir/iir_pci.c ============================================================================== --- head/sys/dev/iir/iir_pci.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/iir/iir_pci.c Fri Mar 18 01:28:41 2016 (r297000) @@ -228,7 +228,7 @@ iir_pci_attach(device_t dev) /* check and reset interface area */ bus_write_4(gdt->sc_dpmem, GDT_MPR_IC, htole32(GDT_MPR_MAGIC)); if (bus_read_4(gdt->sc_dpmem, GDT_MPR_IC) != htole32(GDT_MPR_MAGIC)) { - device_printf(dev, "cannot access DPMEM at 0x%lx (shadowed?)\n", + device_printf(dev, "cannot access DPMEM at 0x%jx (shadowed?)\n", rman_get_start(gdt->sc_dpmem)); error = ENXIO; goto err; Modified: head/sys/dev/mca/mca_bus.c ============================================================================== --- head/sys/dev/mca/mca_bus.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/mca/mca_bus.c Fri Mar 18 01:28:41 2016 (r297000) @@ -365,11 +365,11 @@ mca_print_child (device_t dev, device_t rid = 0; while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IOPORT, rid++))) { if (rle->count == 1) { - snprintf(buf, sizeof(buf), "%s%lx", + snprintf(buf, sizeof(buf), "%s%jx", ((rid == 1) ? "io 0x" : "0x"), rle->start); } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", + snprintf(buf, sizeof(buf), "%s%jx-0x%jx", ((rid == 1) ? "io 0x" : "0x"), rle->start, (rle->start + rle->count)); @@ -381,11 +381,11 @@ mca_print_child (device_t dev, device_t rid = 0; while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_MEMORY, rid++))) { if (rle->count == 1) { - snprintf(buf, sizeof(buf), "%s%lx", + snprintf(buf, sizeof(buf), "%s%jx", ((rid == 1) ? "mem 0x" : "0x"), rle->start); } else { - snprintf(buf, sizeof(buf), "%s%lx-0x%lx", + snprintf(buf, sizeof(buf), "%s%jx-0x%jx", ((rid == 1) ? "mem 0x" : "0x"), rle->start, (rle->start + rle->count)); @@ -396,14 +396,14 @@ mca_print_child (device_t dev, device_t rid = 0; while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_IRQ, rid++))) { - snprintf(buf, sizeof(buf), "irq %ld", rle->start); + snprintf(buf, sizeof(buf), "irq %jd", rle->start); mca_reg_print(child, buf, ((rid == 1) ? &separator : NULL), &column); } rid = 0; while ((rle = resource_list_find(&(m_dev->rl), SYS_RES_DRQ, rid++))) { - snprintf(buf, sizeof(buf), "drq %lx", rle->start); + snprintf(buf, sizeof(buf), "drq %jx", rle->start); mca_reg_print(child, buf, ((rid == 1) ? &separator : NULL), &column); } Modified: head/sys/dev/mxge/if_mxge.c ============================================================================== --- head/sys/dev/mxge/if_mxge.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/mxge/if_mxge.c Fri Mar 18 01:28:41 2016 (r297000) @@ -4612,7 +4612,7 @@ mxge_add_msix_irqs(mxge_softc_t *sc) device_printf(sc->dev, "using %d msix IRQs:", sc->num_slices); for (i = 0; i < sc->num_slices; i++) - printf(" %ld", rman_get_start(sc->msix_irq_res[i])); + printf(" %jd", rman_get_start(sc->msix_irq_res[i])); printf("\n"); } return (0); @@ -4668,7 +4668,7 @@ mxge_add_single_irq(mxge_softc_t *sc) return ENXIO; } if (mxge_verbose) - device_printf(sc->dev, "using %s irq %ld\n", + device_printf(sc->dev, "using %s irq %jd\n", sc->legacy_irq ? "INTx" : "MSI", rman_get_start(sc->irq_res)); err = bus_setup_intr(sc->dev, sc->irq_res, @@ -4823,7 +4823,7 @@ mxge_attach(device_t dev) sc->sram = rman_get_virtual(sc->mem_res); sc->sram_size = 2*1024*1024 - (2*(48*1024)+(32*1024)) - 0x100; if (sc->sram_size > rman_get_size(sc->mem_res)) { - device_printf(dev, "impossible memory region size %ld\n", + device_printf(dev, "impossible memory region size %jd\n", rman_get_size(sc->mem_res)); err = ENXIO; goto abort_with_mem_res; Modified: head/sys/dev/ofw/ofwbus.c ============================================================================== --- head/sys/dev/ofw/ofwbus.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/ofw/ofwbus.c Fri Mar 18 01:28:41 2016 (r297000) @@ -200,8 +200,8 @@ ofwbus_alloc_resource(device_t bus, devi return (NULL); } start = rle->start; - count = ulmax(count, rle->count); - end = ulmax(rle->end, start + count - 1); + count = ummax(count, rle->count); + end = ummax(rle->end, start + count - 1); } switch (type) { Modified: head/sys/dev/pccard/pccard.c ============================================================================== --- head/sys/dev/pccard/pccard.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pccard/pccard.c Fri Mar 18 01:28:41 2016 (r297000) @@ -507,7 +507,7 @@ pccard_function_init(struct pccard_funct end = start + ios->length - 1; else end = ~0; - DEVPRINTF((bus, "I/O rid %d start %#lx end %#lx\n", + DEVPRINTF((bus, "I/O rid %d start %#jx end %#jx\n", i, start, end)); rid = i; len = ios->length; @@ -531,7 +531,7 @@ pccard_function_init(struct pccard_funct end = start + mems->length - 1; else end = ~0; - DEVPRINTF((bus, "Memory rid %d start %#lx end %#lx\ncardaddr %#lx hostaddr %#lx length %#lx\n", + DEVPRINTF((bus, "Memory rid %d start %#jx end %#jx\ncardaddr %#jx hostaddr %#jx length %#jx\n", i, start, end, mems->cardaddr, mems->hostaddr, mems->length)); rid = i; @@ -602,7 +602,7 @@ pccard_function_free(struct pccard_funct device_printf(pf->sc->dev, "function_free: Resource still owned by " "child, oops. " - "(type=%d, rid=%d, addr=%#lx)\n", + "(type=%d, rid=%d, addr=%#jx)\n", rle->type, rle->rid, rman_get_start(rle->res)); BUS_RELEASE_RESOURCE(device_get_parent(pf->sc->dev), @@ -697,7 +697,7 @@ pccard_function_enable(struct pccard_fun &pf->ccr_rid, PCCARD_MEM_PAGE_SIZE, RF_ACTIVE); if (!pf->ccr_res) goto bad; - DEVPRINTF((dev, "ccr_res == %#lx-%#lx, base=%#x\n", + DEVPRINTF((dev, "ccr_res == %#jx-%#jx, base=%#x\n", rman_get_start(pf->ccr_res), rman_get_end(pf->ccr_res), pf->ccr_base)); CARD_SET_RES_FLAGS(device_get_parent(dev), dev, SYS_RES_MEMORY, @@ -1197,7 +1197,7 @@ pccard_release_resource(device_t dev, de if (!rle) { device_printf(dev, "Allocated resource not found, " - "%d %#x %#lx %#lx\n", + "%d %#x %#jx %#jx\n", type, rid, rman_get_start(r), rman_get_size(r)); return ENOENT; } Modified: head/sys/dev/pccard/pccard_cis.c ============================================================================== --- head/sys/dev/pccard/pccard_cis.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pccard/pccard_cis.c Fri Mar 18 01:28:41 2016 (r297000) @@ -151,7 +151,7 @@ pccard_scan_cis(device_t bus, device_t d tuple.memh = rman_get_bushandle(res); tuple.ptr = 0; - DPRINTF(("cis mem map %#x (resource: %#lx)\n", + DPRINTF(("cis mem map %#x (resource: %#jx)\n", (unsigned int) tuple.memh, rman_get_start(res))); tuple.mult = 2; @@ -576,9 +576,9 @@ pccard_print_cis(device_t dev) printf("; iomask %#lx, iospace", cfe->iomask); for (i = 0; i < cfe->num_iospace; i++) { - printf(" %#lx", cfe->iospace[i].start); + printf(" %#jx", cfe->iospace[i].start); if (cfe->iospace[i].length) - printf("-%#lx", + printf("-%#jx", cfe->iospace[i].start + cfe->iospace[i].length - 1); } @@ -587,14 +587,14 @@ pccard_print_cis(device_t dev) printf("; memspace"); for (i = 0; i < cfe->num_memspace; i++) { - printf(" %#lx", + printf(" %#jx", cfe->memspace[i].cardaddr); if (cfe->memspace[i].length) - printf("-%#lx", + printf("-%#jx", cfe->memspace[i].cardaddr + cfe->memspace[i].length - 1); if (cfe->memspace[i].hostaddr) - printf("@%#lx", + printf("@%#jx", cfe->memspace[i].hostaddr); } } Modified: head/sys/dev/pccbb/pccbb.c ============================================================================== --- head/sys/dev/pccbb/pccbb.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pccbb/pccbb.c Fri Mar 18 01:28:41 2016 (r297000) @@ -229,7 +229,7 @@ cbb_destroy_res(struct cbb_softc *sc) while ((rle = SLIST_FIRST(&sc->rl)) != NULL) { device_printf(sc->dev, "Danger Will Robinson: Resource " "left allocated! This is a bug... " - "(rid=%x, type=%d, addr=%lx)\n", rle->rid, rle->type, + "(rid=%x, type=%d, addr=%jx)\n", rle->rid, rle->type, rman_get_start(rle->res)); SLIST_REMOVE_HEAD(&sc->rl, link); free(rle, M_DEVBUF); @@ -1241,8 +1241,8 @@ cbb_cardbus_alloc_resource(device_t brde case SYS_RES_IRQ: tmp = rman_get_start(sc->irq_res); if (start > tmp || end < tmp || count != 1) { - device_printf(child, "requested interrupt %ld-%ld," - "count = %ld not supported by cbb\n", + device_printf(child, "requested interrupt %jd-%jd," + "count = %jd not supported by cbb\n", start, end, count); return (NULL); } @@ -1425,8 +1425,8 @@ cbb_pcic_alloc_resource(device_t brdev, case SYS_RES_IRQ: tmp = rman_get_start(sc->irq_res); if (start > tmp || end < tmp || count != 1) { - device_printf(child, "requested interrupt %ld-%ld," - "count = %ld not supported by cbb\n", + device_printf(child, "requested interrupt %jd-%jd," + "count = %jd not supported by cbb\n", start, end, count); return (NULL); } Modified: head/sys/dev/pccbb/pccbb_pci.c ============================================================================== --- head/sys/dev/pccbb/pccbb_pci.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pccbb/pccbb_pci.c Fri Mar 18 01:28:41 2016 (r297000) @@ -313,7 +313,7 @@ cbb_pci_attach(device_t brdev) mtx_destroy(&sc->mtx); return (ENOMEM); } else { - DEVPRINTF((brdev, "Found memory at %08lx\n", + DEVPRINTF((brdev, "Found memory at %jx\n", rman_get_start(sc->base_res))); } Modified: head/sys/dev/pci/pci.c ============================================================================== --- head/sys/dev/pci/pci.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pci/pci.c Fri Mar 18 01:28:41 2016 (r297000) @@ -1643,7 +1643,7 @@ pci_alloc_msix_method(device_t dev, devi if (bootverbose) { rle = resource_list_find(&dinfo->resources, SYS_RES_IRQ, 1); if (actual == 1) - device_printf(child, "using IRQ %lu for MSI-X\n", + device_printf(child, "using IRQ %ju for MSI-X\n", rle->start); else { int run; @@ -1653,7 +1653,7 @@ pci_alloc_msix_method(device_t dev, devi * IRQ values as ranges. 'irq' is the previous IRQ. * 'run' is true if we are in a range. */ - device_printf(child, "using IRQs %lu", rle->start); + device_printf(child, "using IRQs %ju", rle->start); irq = rle->start; run = 0; for (i = 1; i < actual; i++) { @@ -1674,7 +1674,7 @@ pci_alloc_msix_method(device_t dev, devi } /* Start new range. */ - printf(",%lu", rle->start); + printf(",%ju", rle->start); irq = rle->start; } @@ -3572,13 +3572,13 @@ pci_alloc_secbus(device_t dev, device_t start, end, count, flags & ~RF_ACTIVE); if (res == NULL) { resource_list_delete(rl, PCI_RES_BUS, *rid); - device_printf(child, "allocating %lu bus%s failed\n", + device_printf(child, "allocating %ju bus%s failed\n", count, count == 1 ? "" : "es"); return (NULL); } if (bootverbose) device_printf(child, - "Lazy allocation of %lu bus%s at %lu\n", count, + "Lazy allocation of %ju bus%s at %ju\n", count, count == 1 ? "" : "es", rman_get_start(res)); PCI_WRITE_CONFIG(dev, child, sec_reg, rman_get_start(res), 1); PCI_WRITE_CONFIG(dev, child, sub_reg, rman_get_end(res), 1); @@ -4391,9 +4391,9 @@ pci_print_child(device_t dev, device_t c 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)); @@ -4971,13 +4971,13 @@ pci_reserve_map(device_t dev, device_t c if (res == NULL) { resource_list_delete(rl, type, *rid); device_printf(child, - "%#lx bytes of rid %#x res %d failed (%#lx, %#lx).\n", + "%#jx bytes of rid %#x res %d failed (%#jx, %#jx).\n", count, *rid, type, start, end); goto out; } if (bootverbose) device_printf(child, - "Lazy allocation of %#lx bytes rid %#x type %d at %#lx\n", + "Lazy allocation of %#jx bytes rid %#x type %d at %#jx\n", count, *rid, type, rman_get_start(res)); map = rman_get_start(res); pci_write_bar(child, pm, map); @@ -5254,7 +5254,7 @@ pci_delete_resource(device_t dev, device resource_list_busy(rl, type, rid)) { device_printf(dev, "delete_resource: " "Resource still owned by child, oops. " - "(type=%d, rid=%d, addr=%lx)\n", + "(type=%d, rid=%d, addr=%jx)\n", type, rid, rman_get_start(rle->res)); return; } Modified: head/sys/dev/pci/pci_pci.c ============================================================================== --- head/sys/dev/pci/pci_pci.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pci/pci_pci.c Fri Mar 18 01:28:41 2016 (r297000) @@ -247,7 +247,7 @@ pcib_is_isa_range(struct pcib_softc *sc, alias: if (bootverbose) device_printf(sc->dev, - "I/O range %#lx-%#lx overlaps with an ISA alias\n", start, + "I/O range %#jx-%#jx overlaps with an ISA alias\n", start, end); return (1); } @@ -339,7 +339,7 @@ alloc_ranges(rman_res_t start, rman_res_ rid = w->reg; if (bootverbose) device_printf(as->sc->dev, - "allocating non-ISA range %#lx-%#lx\n", start, end); + "allocating non-ISA range %#jx-%#jx\n", start, end); as->res[as->count] = bus_alloc_resource(as->sc->dev, SYS_RES_IOPORT, &rid, start, end, end - start + 1, 0); if (as->res[as->count] == NULL) @@ -621,7 +621,7 @@ pcib_suballoc_bus(struct pcib_secbus *bu if (bootverbose) device_printf(bus->dev, - "allocated bus range (%lu-%lu) for rid %d of %s\n", + "allocated bus range (%ju-%ju) for rid %d of %s\n", rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); @@ -646,7 +646,7 @@ pcib_grow_subbus(struct pcib_secbus *bus if (error) return (error); if (bootverbose) - device_printf(bus->dev, "grew bus range to %lu-%lu\n", + device_printf(bus->dev, "grew bus range to %ju-%ju\n", rman_get_start(bus->res), rman_get_end(bus->res)); error = rman_manage_region(&bus->rman, old_end + 1, rman_get_end(bus->res)); @@ -694,8 +694,8 @@ pcib_alloc_subbus(struct pcib_secbus *bu /* Finally, attempt to grow the existing resource. */ if (bootverbose) { device_printf(bus->dev, - "attempting to grow bus range for %lu buses\n", count); - printf("\tback candidate range: %lu-%lu\n", start_free, + "attempting to grow bus range for %ju buses\n", count); + printf("\tback candidate range: %ju-%ju\n", start_free, new_end); } if (pcib_grow_subbus(bus, new_end) == 0) @@ -1174,7 +1174,7 @@ pcib_suballoc_resource(struct pcib_softc if (bootverbose) device_printf(sc->dev, - "allocated %s range (%#lx-%#lx) for rid %x of %s\n", + "allocated %s range (%#jx-%#jx) for rid %x of %s\n", w->name, rman_get_start(res), rman_get_end(res), *rid, pcib_child_name(child)); rman_set_rid(res, *rid); @@ -1401,7 +1401,7 @@ pcib_grow_window(struct pcib_softc *sc, if (error) { if (bootverbose) device_printf(sc->dev, - "failed to allocate initial %s window (%#lx-%#lx,%#lx)\n", + "failed to allocate initial %s window (%#jx-%#jx,%#jx)\n", w->name, start, end, count); return (error); } @@ -1433,7 +1433,7 @@ pcib_grow_window(struct pcib_softc *sc, */ if (bootverbose) device_printf(sc->dev, - "attempting to grow %s window for (%#lx-%#lx,%#lx)\n", + "attempting to grow %s window for (%#jx-%#jx,%#jx)\n", w->name, start, end, count); align = (rman_res_t)1 << RF_ALIGNMENT(flags); if (start < w->base) { @@ -1457,7 +1457,7 @@ pcib_grow_window(struct pcib_softc *sc, */ if (front >= start && front <= end_free) { if (bootverbose) - printf("\tfront candidate range: %#lx-%#lx\n", + printf("\tfront candidate range: %#jx-%#jx\n", front, end_free); front &= ~wmask; front = w->base - front; @@ -1485,7 +1485,7 @@ pcib_grow_window(struct pcib_softc *sc, */ if (back <= end && start_free <= back) { if (bootverbose) - printf("\tback candidate range: %#lx-%#lx\n", + printf("\tback candidate range: %#jx-%#jx\n", start_free, back); back |= wmask; back -= w->limit; @@ -1709,7 +1709,7 @@ pcib_alloc_resource(device_t dev, device #endif } if (end < start) { - device_printf(dev, "ioport: end (%lx) < start (%lx)\n", + device_printf(dev, "ioport: end (%jx) < start (%jx)\n", end, start); start = 0; end = 0; @@ -1717,13 +1717,13 @@ pcib_alloc_resource(device_t dev, device } if (!ok) { device_printf(dev, "%s%srequested unsupported I/O " - "range 0x%lx-0x%lx (decoding 0x%x-0x%x)\n", + "range 0x%jx-0x%jx (decoding 0x%x-0x%x)\n", name, suffix, start, end, sc->iobase, sc->iolimit); return (NULL); } if (bootverbose) device_printf(dev, - "%s%srequested I/O range 0x%lx-0x%lx: in range\n", + "%s%srequested I/O range 0x%jx-0x%jx: in range\n", name, suffix, start, end); break; @@ -1778,7 +1778,7 @@ pcib_alloc_resource(device_t dev, device #endif } if (end < start) { - device_printf(dev, "memory: end (%lx) < start (%lx)\n", + device_printf(dev, "memory: end (%jx) < start (%jx)\n", end, start); start = 0; end = 0; @@ -1786,7 +1786,7 @@ pcib_alloc_resource(device_t dev, device } if (!ok && bootverbose) device_printf(dev, - "%s%srequested unsupported memory range %#lx-%#lx " + "%s%srequested unsupported memory range %#jx-%#jx " "(decoding %#jx-%#jx, %#jx-%#jx)\n", name, suffix, start, end, (uintmax_t)sc->membase, (uintmax_t)sc->memlimit, @@ -1795,7 +1795,7 @@ pcib_alloc_resource(device_t dev, device return (NULL); if (bootverbose) device_printf(dev,"%s%srequested memory range " - "0x%lx-0x%lx: good\n", + "0x%jx-0x%jx: good\n", name, suffix, start, end); break; Modified: head/sys/dev/pci/pci_subr.c ============================================================================== --- head/sys/dev/pci/pci_subr.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/pci/pci_subr.c Fri Mar 18 01:28:41 2016 (r297000) @@ -185,7 +185,7 @@ pcib_host_res_decodes(struct pcib_host_r int rid; if (bootverbose) - device_printf(hr->hr_pcib, "decoding %d %srange %#lx-%#lx\n", + device_printf(hr->hr_pcib, "decoding %d %srange %#jx-%#jx\n", type, flags & RF_PREFETCHABLE ? "prefetchable ": "", start, end); rid = resource_list_add_next(&hr->hr_rl, type, start, end, @@ -229,8 +229,8 @@ restart: if (((flags & RF_PREFETCHABLE) != 0) != ((rle->flags & RLE_PREFETCH) != 0)) continue; - new_start = ulmax(start, rle->start); - new_end = ulmin(end, rle->end); + new_start = ummax(start, rle->start); + new_end = ummin(end, rle->end); if (new_start > new_end || new_start + count - 1 > new_end || new_start + count < new_start) @@ -240,7 +240,7 @@ restart: if (r != NULL) { if (bootverbose) device_printf(hr->hr_pcib, - "allocated type %d (%#lx-%#lx) for rid %x of %s\n", + "allocated type %d (%#jx-%#jx) for rid %x of %s\n", type, rman_get_start(r), rman_get_end(r), *rid, pcib_child_name(dev)); return (r); Modified: head/sys/dev/ppc/ppc.c ============================================================================== --- head/sys/dev/ppc/ppc.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/ppc/ppc.c Fri Mar 18 01:28:41 2016 (r297000) @@ -1699,7 +1699,7 @@ ppc_probe(device_t dev, int rid) next_bios_ppc += 1; if (bootverbose) device_printf(dev, - "parallel port found at 0x%lx\n", port); + "parallel port found at 0x%jx\n", port); } #else if ((next_bios_ppc < BIOS_MAX_PPC) && @@ -1707,7 +1707,7 @@ ppc_probe(device_t dev, int rid) port = *(BIOS_PORTS + next_bios_ppc++); if (bootverbose) device_printf(dev, - "parallel port found at 0x%lx\n", port); + "parallel port found at 0x%jx\n", port); } else { device_printf(dev, "parallel port not found.\n"); return (ENXIO); Modified: head/sys/dev/proto/proto_bus_isa.c ============================================================================== --- head/sys/dev/proto/proto_bus_isa.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/proto/proto_bus_isa.c Fri Mar 18 01:28:41 2016 (r297000) @@ -80,7 +80,7 @@ proto_isa_probe(device_t dev) return (ENODEV); sb = sbuf_new_auto(); - sbuf_printf(sb, "%s:%#lx", proto_isa_prefix, rman_get_start(res)); + sbuf_printf(sb, "%s:%#jx", proto_isa_prefix, rman_get_start(res)); sbuf_finish(sb); device_set_desc_copy(dev, sbuf_data(sb)); sbuf_delete(sb); Modified: head/sys/dev/sound/isa/ad1816.c ============================================================================== --- head/sys/dev/sound/isa/ad1816.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/isa/ad1816.c Fri Mar 18 01:28:41 2016 (r297000) @@ -624,11 +624,11 @@ ad1816_attach(device_t dev) goto no; } if (ad1816->drq2) - snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(ad1816->drq2)); + snprintf(status2, SND_STATUSLEN, ":%jd", rman_get_start(ad1816->drq2)); else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s", rman_get_start(ad1816->io_base), rman_get_start(ad1816->irq), rman_get_start(ad1816->drq1), Modified: head/sys/dev/sound/isa/ess.c ============================================================================== --- head/sys/dev/sound/isa/ess.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/isa/ess.c Fri Mar 18 01:28:41 2016 (r297000) @@ -867,12 +867,12 @@ ess_attach(device_t dev) } if (sc->drq2) - snprintf(buf, SND_STATUSLEN, ":%ld", rman_get_start(sc->drq2)); + snprintf(buf, SND_STATUSLEN, ":%jd", rman_get_start(sc->drq2)); else buf[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s", - rman_get_start(sc->io_base), rman_get_start(sc->irq), + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s", + rman_get_start(sc->io_base), rman_get_start(sc->irq), rman_get_start(sc->drq1), buf, sc->bufsize, PCM_KLDSTRING(snd_ess)); Modified: head/sys/dev/sound/isa/mss.c ============================================================================== --- head/sys/dev/sound/isa/mss.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/isa/mss.c Fri Mar 18 01:28:41 2016 (r297000) @@ -1326,7 +1326,7 @@ mss_probe(device_t dev) } tmp &= 0x3f; if (!(tmp == 0x04 || tmp == 0x0f || tmp == 0x00 || tmp == 0x05)) { - BVDDB(printf("No MSS signature detected on port 0x%lx (0x%x)\n", + BVDDB(printf("No MSS signature detected on port 0x%jx (0x%x)\n", rman_get_start(mss->io_base), tmpx)); goto no; } @@ -1767,7 +1767,7 @@ mss_doattach(device_t dev, struct mss_in else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %d%s bufsz %u", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %d%s bufsz %u", rman_get_start(mss->io_base), rman_get_start(mss->irq), pdma, status2, mss->bufsize); if (pcm_register(dev, mss, 1, 1)) goto no; Modified: head/sys/dev/sound/isa/sb16.c ============================================================================== --- head/sys/dev/sound/isa/sb16.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/isa/sb16.c Fri Mar 18 01:28:41 2016 (r297000) @@ -854,11 +854,11 @@ sb16_attach(device_t dev) } if (!(pcm_getflags(dev) & SD_F_SIMPLEX)) - snprintf(status2, SND_STATUSLEN, ":%ld", rman_get_start(sb->drq2)); + snprintf(status2, SND_STATUSLEN, ":%jd", rman_get_start(sb->drq2)); else status2[0] = '\0'; - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld%s bufsz %u %s", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd%s bufsz %u %s", rman_get_start(sb->io_base), rman_get_start(sb->irq), rman_get_start(sb->drq1), status2, sb->bufsize, PCM_KLDSTRING(snd_sb16)); Modified: head/sys/dev/sound/isa/sb8.c ============================================================================== --- head/sys/dev/sound/isa/sb8.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/isa/sb8.c Fri Mar 18 01:28:41 2016 (r297000) @@ -749,7 +749,7 @@ sb_attach(device_t dev) goto no; } - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld drq %ld bufsz %u %s", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd drq %jd bufsz %u %s", rman_get_start(sb->io_base), rman_get_start(sb->irq), rman_get_start(sb->drq), sb->bufsize, PCM_KLDSTRING(snd_sb8)); Modified: head/sys/dev/sound/pci/als4000.c ============================================================================== --- head/sys/dev/sound/pci/als4000.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/pci/als4000.c Fri Mar 18 01:28:41 2016 (r297000) @@ -848,7 +848,7 @@ als_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &alspchan_class, sc); pcm_addchan(dev, PCMDIR_REC, &alsrchan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_als4000)); pcm_setstatus(dev, status); return 0; Modified: head/sys/dev/sound/pci/atiixp.c ============================================================================== --- head/sys/dev/sound/pci/atiixp.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/pci/atiixp.c Fri Mar 18 01:28:41 2016 (r297000) @@ -1097,7 +1097,7 @@ atiixp_chip_post_init(void *arg) "polling", CTLTYPE_INT | CTLFLAG_RW, sc->dev, sizeof(sc->dev), sysctl_atiixp_polling, "I", "Enable polling mode"); - snprintf(status, SND_STATUSLEN, "at memory 0x%lx irq %ld %s", + snprintf(status, SND_STATUSLEN, "at memory 0x%jx irq %jd %s", rman_get_start(sc->reg), rman_get_start(sc->irq), PCM_KLDSTRING(snd_atiixp)); Modified: head/sys/dev/sound/pci/aureal.c ============================================================================== --- head/sys/dev/sound/pci/aureal.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/pci/aureal.c Fri Mar 18 01:28:41 2016 (r297000) @@ -645,7 +645,7 @@ au_pci_attach(device_t dev) goto bad; } - snprintf(status, SND_STATUSLEN, "at %s 0x%lx irq %ld %s", + snprintf(status, SND_STATUSLEN, "at %s 0x%jx irq %jd %s", (type[0] == SYS_RES_IOPORT)? "io" : "memory", rman_get_start(reg[0]), rman_get_start(irq),PCM_KLDSTRING(snd_aureal)); Modified: head/sys/dev/sound/pci/cmi.c ============================================================================== --- head/sys/dev/sound/pci/cmi.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/pci/cmi.c Fri Mar 18 01:28:41 2016 (r297000) @@ -995,7 +995,7 @@ cmi_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cmichan_class, sc); pcm_addchan(dev, PCMDIR_REC, &cmichan_class, sc); - snprintf(status, SND_STATUSLEN, "at io 0x%lx irq %ld %s", + snprintf(status, SND_STATUSLEN, "at io 0x%jx irq %jd %s", rman_get_start(sc->reg), rman_get_start(sc->irq),PCM_KLDSTRING(snd_cmi)); pcm_setstatus(dev, status); Modified: head/sys/dev/sound/pci/cs4281.c ============================================================================== --- head/sys/dev/sound/pci/cs4281.c Fri Mar 18 01:26:55 2016 (r296999) +++ head/sys/dev/sound/pci/cs4281.c Fri Mar 18 01:28:41 2016 (r297000) @@ -849,7 +849,7 @@ cs4281_pci_attach(device_t dev) pcm_addchan(dev, PCMDIR_PLAY, &cs4281chan_class, sc); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@freebsd.org Fri Mar 18 01:30:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E90AAAD409B; Fri, 18 Mar 2016 01:30:59 +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 B5E221BFF; Fri, 18 Mar 2016 01:30:59 +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 u2I1UwcI039668; Fri, 18 Mar 2016 01:30:58 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I1Uw1H039667; Fri, 18 Mar 2016 01:30:58 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180130.u2I1Uw1H039667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 01:30:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297001 - head/sys/powerpc/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 01:31:00 -0000 Author: jhibbits Date: Fri Mar 18 01:30:58 2016 New Revision: 297001 URL: https://svnweb.freebsd.org/changeset/base/297001 Log: Increase booke bus max address to 36-bits. Sponsored by: Alex Perez/Inertial Computing Modified: head/sys/powerpc/include/bus.h Modified: head/sys/powerpc/include/bus.h ============================================================================== --- head/sys/powerpc/include/bus.h Fri Mar 18 01:28:41 2016 (r297000) +++ head/sys/powerpc/include/bus.h Fri Mar 18 01:30:58 2016 (r297001) @@ -79,9 +79,14 @@ #define BUS_SPACE_MAXADDR 0xFFFFFFFFFFFFFFFFUL #define BUS_SPACE_MAXSIZE 0xFFFFFFFFFFFFFFFFUL #else +#ifdef BOOKE +#define BUS_SPACE_MAXADDR 0xFFFFFFFFFULL +#define BUS_SPACE_MAXSIZE 0xFFFFFFFFUL +#else #define BUS_SPACE_MAXADDR 0xFFFFFFFFUL #define BUS_SPACE_MAXSIZE 0xFFFFFFFFUL #endif +#endif #define BUS_SPACE_MAP_CACHEABLE 0x01 #define BUS_SPACE_MAP_LINEAR 0x02 From owner-svn-src-head@freebsd.org Fri Mar 18 01:53:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BBC36AD47DF; Fri, 18 Mar 2016 01:53:01 +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 8CFAB9CC; Fri, 18 Mar 2016 01:53:01 +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 u2I1r00a048557; Fri, 18 Mar 2016 01:53:00 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I1r0xX048556; Fri, 18 Mar 2016 01:53:00 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180153.u2I1r0xX048556@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 01:53:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297003 - head/lib/libdevinfo X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 01:53:01 -0000 Author: jhibbits Date: Fri Mar 18 01:53:00 2016 New Revision: 297003 URL: https://svnweb.freebsd.org/changeset/base/297003 Log: Bump libdevinfo SHLIB_MAJOR, forgotten in r297000. Spotted by: bapt Modified: head/lib/libdevinfo/Makefile Modified: head/lib/libdevinfo/Makefile ============================================================================== --- head/lib/libdevinfo/Makefile Fri Mar 18 01:35:03 2016 (r297002) +++ head/lib/libdevinfo/Makefile Fri Mar 18 01:53:00 2016 (r297003) @@ -5,6 +5,8 @@ SRCS= devinfo.c INCS= devinfo.h MAN= devinfo.3 +SHLIB_MAJOR= 6 + WARNS?= 3 .include From owner-svn-src-head@freebsd.org Fri Mar 18 02:56:08 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 57E55AD3C24; Fri, 18 Mar 2016 02:56: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 297177D; Fri, 18 Mar 2016 02:56: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 u2I2u7TP066712; Fri, 18 Mar 2016 02:56:07 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I2u7r6066711; Fri, 18 Mar 2016 02:56:07 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180256.u2I2u7r6066711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 02:56:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297004 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 02:56:08 -0000 Author: jhibbits Date: Fri Mar 18 02:56:07 2016 New Revision: 297004 URL: https://svnweb.freebsd.org/changeset/base/297004 Log: Add old libdevinfo.so version to OLD_LIBS Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 18 01:53:00 2016 (r297003) +++ head/ObsoleteFiles.inc Fri Mar 18 02:56:07 2016 (r297004) @@ -38,6 +38,8 @@ # xargs -n1 | sort | uniq -d; # done +# 20160317: rman_res_t size bump to uintmax_t +OLD_LIBS+=usr/lib/libdevinfo.so.5 # 20160305: new clang import which bumps version from 3.7.1 to 3.8.0. OLD_FILES+=usr/bin/macho-dump OLD_FILES+=usr/lib/clang/3.7.1/include/sanitizer/allocator_interface.h From owner-svn-src-head@freebsd.org Fri Mar 18 02:59:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D95B9AD3DD0; Fri, 18 Mar 2016 02:59:11 +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 AB92D3EC; Fri, 18 Mar 2016 02:59:11 +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 u2I2xAta067089; Fri, 18 Mar 2016 02:59:10 GMT (envelope-from jhibbits@FreeBSD.org) Received: (from jhibbits@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I2xAlx067088; Fri, 18 Mar 2016 02:59:10 GMT (envelope-from jhibbits@FreeBSD.org) Message-Id: <201603180259.u2I2xAlx067088@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhibbits set sender to jhibbits@FreeBSD.org using -f From: Justin Hibbits Date: Fri, 18 Mar 2016 02:59:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297005 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 02:59:12 -0000 Author: jhibbits Date: Fri Mar 18 02:59:10 2016 New Revision: 297005 URL: https://svnweb.freebsd.org/changeset/base/297005 Log: Forgot lib32 libdevinfo.so.5 Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Mar 18 02:56:07 2016 (r297004) +++ head/ObsoleteFiles.inc Fri Mar 18 02:59:10 2016 (r297005) @@ -40,6 +40,7 @@ # 20160317: rman_res_t size bump to uintmax_t OLD_LIBS+=usr/lib/libdevinfo.so.5 +OLD_LIBS+=usr/lib32/libdevinfo.so.5 # 20160305: new clang import which bumps version from 3.7.1 to 3.8.0. OLD_FILES+=usr/bin/macho-dump OLD_FILES+=usr/lib/clang/3.7.1/include/sanitizer/allocator_interface.h From owner-svn-src-head@freebsd.org Fri Mar 18 03:55:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A581AD4134; Fri, 18 Mar 2016 03:55:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 29D5D1BA; Fri, 18 Mar 2016 03:55:01 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I3t0kW085521; Fri, 18 Mar 2016 03:55:00 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I3t0pI085520; Fri, 18 Mar 2016 03:55:00 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603180355.u2I3t0pI085520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Mar 2016 03:55:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297006 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 03:55:01 -0000 Author: adrian Date: Fri Mar 18 03:55:00 2016 New Revision: 297006 URL: https://svnweb.freebsd.org/changeset/base/297006 Log: Add initial 802.11ac IEs and fields. This is a subset of what's in the linux 802.11ac implementation. I've verified that the bits that mention an 802.11ac draft are still the same in 802.11ac-2013 and noted it accordingly. This is for the most part one big no-op. Obtained from: 802.11ac-2013.pdf Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Fri Mar 18 02:59:10 2016 (r297005) +++ head/sys/net80211/ieee80211.h Fri Mar 18 03:55:00 2016 (r297006) @@ -696,6 +696,118 @@ struct ieee80211_ie_htinfo { #define IEEE80211_HTINFO_BASIC_STBCMCS_S 0 #define IEEE80211_HTINFO_DUALPROTECTED 0x80 + +/* + * 802.11ac definitions - 802.11ac-2013 . + */ + +/* VHT opmode bits */ +#define IEEE80211_VHT_OPMODE_CHANWIDTH_MASK 3 +#define IEEE80211_VHT_OPMODE_CHANWIDTH_20MHZ 0 +#define IEEE80211_VHT_OPMODE_CHANWIDTH_40MHZ 1 +#define IEEE80211_VHT_OPMODE_CHANWIDTH_80MHZ 2 +#define IEEE80211_VHT_OPMODE_CHANWIDTH_160MHZ 3 +#define IEEE80211_VHT_OPMODE_RX_NSS_MASK 0x70 +#define IEEE80211_VHT_OPMODE_RX_NSS_SHIFT 4 +#define IEEE80211_VHT_OPMODE_RX_NSS_TYPE_BF 0x80 + +/* + * Maximum length of A-MPDU that the STA can RX in VHT. + * Length = 2 ^ (13 + max_ampdu_length_exp) - 1 (octets) + */ +#define IEEE80211_VHTCAP_MAX_AMPDU_8K 0 +#define IEEE80211_VHTCAP_MAX_AMPDU_16K 1 +#define IEEE80211_VHTCAP_MAX_AMPDU_32K 2 +#define IEEE80211_VHTCAP_MAX_AMPDU_64K 3 +#define IEEE80211_VHTCAP_MAX_AMPDU_128K 4 +#define IEEE80211_VHTCAP_MAX_AMPDU_256K 5 +#define IEEE80211_VHTCAP_MAX_AMPDU_512K 6 +#define IEEE80211_VHTCAP_MAX_AMPDU_1024K 7 + +/* + * VHT MCS information. + * + rx_highest/tx_highest: optional; maximum long GI VHT PPDU + * data rate. 1Mbit/sec units. + * + rx_mcs_map/tx_mcs_map: bitmap of per-stream supported MCS; + * 2 bits each. + */ +#define IEEE80211_VHT_MCS_SUPPORT_0_7 0 /* MCS0-7 */ +#define IEEE80211_VHT_MCS_SUPPORT_0_8 1 /* MCS0-8 */ +#define IEEE80211_VHT_MCS_SUPPORT_0_9 2 /* MCS0-9 */ +#define IEEE80211_VHT_MCS_NOT_SUPPORTED 3 /* not supported */ + +struct ieee80211_vht_mcs_info { + uint16_t rx_mcs_map; + uint16_t rx_highest; + uint16_t tx_mcs_map; + uint16_t tx_highest; +} __packed; + +/* VHT capabilities element: 802.11ac-2013 8.4.2.160 */ +struct ieee80211_ie_vhtcap { + uint8_t ie; + uint8_t len; + uint32_t vht_cap_info; + struct ieee80211_vht_mcs_info supp_mcs; +} __packed; + +#define IEEE80211_VHT_CHANWIDTH_USE_HT 0 /* Use HT IE for chw */ +#define IEEE80211_VHT_CHANWIDTH_80MHZ 1 /* 80MHz */ +#define IEEE80211_VHT_CHANWIDTH_160MHZ 2 /* 160MHz */ +#define IEEE80211_VHT_CHANWIDTH_80P80MHZ 3 /* 80+80MHz */ + +/* VHT operation IE - 802.11ac-2013 8.4.2.161 */ +struct ieee80211_ie_vht_operation { + uint8_t ie; + uint8_t len; + uint8_t chan_width; + uint8_t center_freq_seg1_idx; + uint8_t center_freq_seg2_idx; + uint16_t basic_mcs_set; +} __packed; + +/* 802.11ac VHT Capabilities */ +#define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_3895 0x00000000 +#define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_7991 0x00000001 +#define IEEE80211_VHTCAP_MAX_MPDU_LENGTH_11454 0x00000002 +#define IEEE80211_VHTCAP_MAX_MPDU_MASK 0x00000003 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160MHZ 0x00000004 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ 0x00000008 +#define IEEE80211_VHTCAP_SUPP_CHAN_WIDTH_MASK 0x0000000C +#define IEEE80211_VHTCAP_RXLDPC 0x00000010 +#define IEEE80211_VHTCAP_SHORT_GI_80 0x00000020 +#define IEEE80211_VHTCAP_SHORT_GI_160 0x00000040 +#define IEEE80211_VHTCAP_TXSTBC 0x00000080 +#define IEEE80211_VHTCAP_RXSTBC_1 0x00000100 +#define IEEE80211_VHTCAP_RXSTBC_2 0x00000200 +#define IEEE80211_VHTCAP_RXSTBC_3 0x00000300 +#define IEEE80211_VHTCAP_RXSTBC_4 0x00000400 +#define IEEE80211_VHTCAP_RXSTBC_MASK 0x00000700 +#define IEEE80211_VHTCAP_SU_BEAMFORMER_CAPABLE 0x00000800 +#define IEEE80211_VHTCAP_SU_BEAMFORMEE_CAPABLE 0x00001000 +#define IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT 13 +#define IEEE80211_VHTCAP_BEAMFORMEE_STS_MASK \ + (7 << IEEE80211_VHTCAP_BEAMFORMEE_STS_SHIFT) +#define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT 16 +#define IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_MASK \ + (7 << IEEE80211_VHTCAP_SOUNDING_DIMENSIONS_SHIFT) +#define IEEE80211_VHTCAP_MU_BEAMFORMER_CAPABLE 0x00080000 +#define IEEE80211_VHTCAP_MU_BEAMFORMEE_CAPABLE 0x00100000 +#define IEEE80211_VHTCAP_VHT_TXOP_PS 0x00200000 +#define IEEE80211_VHTCAP_HTC_VHT 0x00400000 +#define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT 23 +#define IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_MASK \ + (7 << IEEE80211_VHTCAP_MAX_A_MPDU_LENGTH_EXPONENT_SHIFT) +#define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_UNSOL_MFB 0x08000000 +#define IEEE80211_VHTCAP_VHT_LINK_ADAPTATION_VHT_MRQ_MFB 0x0c000000 +#define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x10000000 +#define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 + +/* VHT action codes */ +#define WLAN_ACTION_VHT_COMPRESSED_BF 0 +#define WLAN_ACTION_VHT_GROUPID_MGMT 1 +#define WLAN_ACTION_VHT_OPMODE_NOTIF 2 + /* * Management information element payloads. */ From owner-svn-src-head@freebsd.org Fri Mar 18 03:55:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 64F41AD41F7; Fri, 18 Mar 2016 03:55:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 22D1C373; Fri, 18 Mar 2016 03:55:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I3tvJX085592; Fri, 18 Mar 2016 03:55:57 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I3tvLW085591; Fri, 18 Mar 2016 03:55:57 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603180355.u2I3tvLW085591@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Mar 2016 03:55:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297007 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 03:55:58 -0000 Author: adrian Date: Fri Mar 18 03:55:57 2016 New Revision: 297007 URL: https://svnweb.freebsd.org/changeset/base/297007 Log: Decode VHTCAP, VHTINFO and BSSLOAD. BSSLOAD is based on work from Idwer Vollering. Obtained from: Idwer Vollering (bssload) Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 18 03:55:00 2016 (r297006) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 18 03:55:57 2016 (r297007) @@ -2534,6 +2534,45 @@ printwmeinfo(const char *tag, const u_in } static void +printvhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + if (verbose) { + const struct ieee80211_ie_vhtcap *vhtcap = + (const struct ieee80211_ie_vhtcap *) ie; + uint32_t vhtcap_info = LE_READ_4(&vhtcap->vht_cap_info); + + printf("supp_mcs.rx_mcs_map)); + printf(" rx_highest %d", + LE_READ_2(&vhtcap->supp_mcs.rx_highest) & 0x1fff); + printf(" tx_mcs_map 0x%x", + LE_READ_2(&vhtcap->supp_mcs.tx_mcs_map)); + printf(" tx_highest %d", + LE_READ_2(&vhtcap->supp_mcs.tx_highest) & 0x1fff); + + printf(">"); + } +} + +static void +printvhtinfo(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + if (verbose) { + const struct ieee80211_ie_vht_operation *vhtinfo = + (const struct ieee80211_ie_vht_operation *) ie; + + printf("", + vhtinfo->chan_width, + vhtinfo->center_freq_seg1_idx, + vhtinfo->center_freq_seg2_idx, + LE_READ_2(&vhtinfo->basic_mcs_set)); + } +} + +static void printhtcap(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) { printf("%s", tag); @@ -2674,6 +2713,20 @@ do { \ #undef MATCHOUI } +static void +printbssload(const char *tag, const uint8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + if (verbose) { + const struct ieee80211_bss_load_ie *bssload = + (const struct ieee80211_bss_load_ie *) ie; + printf("", + LE_READ_2(&bssload->sta_count), + bssload->chan_load, + bssload->aac); + } +} + static const char * wpa_cipher(const u_int8_t *sel) { @@ -3154,6 +3207,15 @@ printies(const u_int8_t *vp, int ielen, case IEEE80211_ELEMID_MESHCONF: printmeshconf(" MESHCONF", vp, 2+vp[1], maxcols); break; + case IEEE80211_ELEMID_VHT_CAP: + printvhtcap(" VHTCAP", vp, 2+vp[1], maxcols); + break; + case IEEE80211_ELEMID_VHT_OPMODE: + printvhtinfo(" VHTOPMODE", vp, 2+vp[1], maxcols); + break; + case IEEE80211_ELEMID_BSSLOAD: + printbssload(" BSSLOAD", vp, 2+vp[1], maxcols); + break; default: if (verbose) printie(iename(vp[0]), vp, 2+vp[1], maxcols); From owner-svn-src-head@freebsd.org Fri Mar 18 04:00:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47C1AAD42FC; Fri, 18 Mar 2016 04:00: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 195D08CD; Fri, 18 Mar 2016 04:00:59 +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 u2I40wJp085817; Fri, 18 Mar 2016 04:00:58 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I40w91085815; Fri, 18 Mar 2016 04:00:58 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603180400.u2I40w91085815@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Mar 2016 04:00:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297008 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 04:00:59 -0000 Author: adrian Date: Fri Mar 18 04:00:57 2016 New Revision: 297008 URL: https://svnweb.freebsd.org/changeset/base/297008 Log: [net80211] IE 127 is not MESHEXTCAP, just EXTCAP. It's not a mesh extended capabilities; it's just extended capabilities. This is from 802.11-2012 8.4.2.29 (Extended Capabilities element.) Modified: head/sys/net80211/ieee80211.h head/sys/net80211/ieee80211_input.c Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Fri Mar 18 03:55:57 2016 (r297007) +++ head/sys/net80211/ieee80211.h Fri Mar 18 04:00:57 2016 (r297008) @@ -877,7 +877,7 @@ enum { IEEE80211_ELEMID_MESHGANN = 125, IEEE80211_ELEMID_MESHRANN = 126, /* 127 Extended Capabilities */ - IEEE80211_ELEMID_MESHEXTCAP = 127, + IEEE80211_ELEMID_EXTCAP = 127, /* 128-129 reserved */ IEEE80211_ELEMID_MESHPREQ = 130, IEEE80211_ELEMID_MESHPREP = 131, Modified: head/sys/net80211/ieee80211_input.c ============================================================================== --- head/sys/net80211/ieee80211_input.c Fri Mar 18 03:55:57 2016 (r297007) +++ head/sys/net80211/ieee80211_input.c Fri Mar 18 04:00:57 2016 (r297008) @@ -603,9 +603,10 @@ ieee80211_parse_beacon(struct ieee80211_ case IEEE80211_ELEMID_MESHCONF: scan->meshconf = frm; break; - case IEEE80211_ELEMID_MESHEXTCAP: - break; #endif + /* Extended capabilities; nothing handles it for now */ + case IEEE80211_ELEMID_EXTCAP: + break; case IEEE80211_ELEMID_VENDOR: if (iswpaoui(frm)) scan->wpa = frm; From owner-svn-src-head@freebsd.org Fri Mar 18 04:09:28 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4753FAD45B4; Fri, 18 Mar 2016 04:09:28 +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 14F63CA1; Fri, 18 Mar 2016 04:09:28 +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 u2I49RqD088704; Fri, 18 Mar 2016 04:09:27 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I49RuB088703; Fri, 18 Mar 2016 04:09:27 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603180409.u2I49RuB088703@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Mar 2016 04:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297009 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 04:09:28 -0000 Author: adrian Date: Fri Mar 18 04:09:27 2016 New Revision: 297009 URL: https://svnweb.freebsd.org/changeset/base/297009 Log: Remove duplicate LE_READ_4() definition. Tested: * typed 'make', seemed to work. Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 18 04:00:57 2016 (r297008) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 18 04:09:27 2016 (r297009) @@ -3071,14 +3071,6 @@ printcountry(const char *tag, const u_in printf(">"); } -/* unaligned little endian access */ -#define LE_READ_4(p) \ - ((u_int32_t) \ - ((((const u_int8_t *)(p))[0] ) | \ - (((const u_int8_t *)(p))[1] << 8) | \ - (((const u_int8_t *)(p))[2] << 16) | \ - (((const u_int8_t *)(p))[3] << 24))) - static __inline int iswpaoui(const u_int8_t *frm) { From owner-svn-src-head@freebsd.org Fri Mar 18 04:22:09 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 29EA7AD4951; Fri, 18 Mar 2016 04:22:09 +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 D09C01233; Fri, 18 Mar 2016 04:22:08 +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 u2I4M7qo094541; Fri, 18 Mar 2016 04:22:07 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I4M7NZ094540; Fri, 18 Mar 2016 04:22:07 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603180422.u2I4M7NZ094540@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Fri, 18 Mar 2016 04:22:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297010 - head/sbin/ifconfig X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 04:22:09 -0000 Author: adrian Date: Fri Mar 18 04:22:07 2016 New Revision: 297010 URL: https://svnweb.freebsd.org/changeset/base/297010 Log: Add parsing for AP channel report IE. Eg: TP-LINK_D579 60:e3:27:e1:d5:79 10 54M -72:-95 100 EP SSID RATES DSPARMS<10> XRATES<12,24,48,96> COUNTRY APCHANREP APCHANREP TIM<050400010000> ERP<0x4> HTCAP HTINFO ???<4a0e14000a002c01c800140005001900> RSN WME BSSLOAD VEN Modified: head/sbin/ifconfig/ifieee80211.c Modified: head/sbin/ifconfig/ifieee80211.c ============================================================================== --- head/sbin/ifconfig/ifieee80211.c Fri Mar 18 04:09:27 2016 (r297009) +++ head/sbin/ifconfig/ifieee80211.c Fri Mar 18 04:22:07 2016 (r297010) @@ -2727,6 +2727,26 @@ printbssload(const char *tag, const uint } } +static void +printapchanrep(const char *tag, const u_int8_t *ie, size_t ielen, int maxlen) +{ + printf("%s", tag); + if (verbose) { + const struct ieee80211_ap_chan_report_ie *ap = + (const struct ieee80211_ap_chan_report_ie *) ie; + const char *sep = ""; + int i; + + printf("i_class); + + for (i = 3; i < ielen; i++) { + printf("%s%u", sep, ie[i]); + sep = ","; + } + printf("]>"); + } +} + static const char * wpa_cipher(const u_int8_t *sel) { @@ -3129,11 +3149,8 @@ iename(int elemid) case IEEE80211_ELEMID_MEASREP: return " MEASREP"; case IEEE80211_ELEMID_QUIET: return " QUIET"; case IEEE80211_ELEMID_IBSSDFS: return " IBSSDFS"; - case IEEE80211_ELEMID_APCHANREP:return " APCHANREP"; case IEEE80211_ELEMID_TPC: return " TPC"; case IEEE80211_ELEMID_CCKM: return " CCKM"; - case IEEE80211_ELEMID_VHT_CAP: return " VHTCAP"; - case IEEE80211_ELEMID_VHT_OPMODE: return " VHTOPMODE"; case IEEE80211_ELEMID_VHT_PWR_ENV: return " VHTPWRENV"; } return " ???"; @@ -3208,6 +3225,9 @@ printies(const u_int8_t *vp, int ielen, case IEEE80211_ELEMID_BSSLOAD: printbssload(" BSSLOAD", vp, 2+vp[1], maxcols); break; + case IEEE80211_ELEMID_APCHANREP: + printapchanrep(" APCHANREP", vp, 2+vp[1], maxcols); + break; default: if (verbose) printie(iename(vp[0]), vp, 2+vp[1], maxcols); From owner-svn-src-head@freebsd.org Fri Mar 18 07:13:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0E839AD4A3D; Fri, 18 Mar 2016 07:13:11 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B971015F2; Fri, 18 Mar 2016 07:13:10 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I7D9V3021401; Fri, 18 Mar 2016 07:13:09 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I7D9hb021400; Fri, 18 Mar 2016 07:13:09 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603180713.u2I7D9hb021400@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 18 Mar 2016 07:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297011 - head/sys/arm/nvidia X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 07:13:11 -0000 Author: mmel Date: Fri Mar 18 07:13:09 2016 New Revision: 297011 URL: https://svnweb.freebsd.org/changeset/base/297011 Log: TEGRA: Fix tegra_pcie driver after rman_res_t size change. Modified: head/sys/arm/nvidia/tegra_pcie.c Modified: head/sys/arm/nvidia/tegra_pcie.c ============================================================================== --- head/sys/arm/nvidia/tegra_pcie.c Fri Mar 18 04:22:07 2016 (r297010) +++ head/sys/arm/nvidia/tegra_pcie.c Fri Mar 18 07:13:09 2016 (r297011) @@ -491,7 +491,7 @@ tegra_pcib_alloc_resource(device_t dev, struct rman *rm; struct resource *res; - debugf("%s: enter %d start %lx end %lx count %lx\n", __func__, + debugf("%s: enter %d start %#jx end %#jx count %#jx\n", __func__, type, start, end, count); sc = device_get_softc(dev); @@ -513,7 +513,7 @@ tegra_pcib_alloc_resource(device_t dev, if (bootverbose) { device_printf(dev, - "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n", + "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n", start, end, count); } @@ -532,7 +532,7 @@ tegra_pcib_alloc_resource(device_t dev, fail: if (bootverbose) { device_printf(dev, "%s FAIL: type=%d, rid=%d, " - "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", + "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", __func__, type, *rid, start, end, count, flags); } @@ -565,14 +565,13 @@ tegra_pcib_release_resource(device_t dev static int tegra_pcib_adjust_resource(device_t dev, device_t child, int type, - struct resource *res, u_long start, u_long end) + struct resource *res, rman_res_t start, rman_res_t end) { struct tegra_pcib_softc *sc; struct rman *rm; sc = device_get_softc(dev); - debugf("%s: %d start %lx end %lx \n", __func__, - type, start, end); + debugf("%s: %d start %jx end %jx \n", __func__, type, start, end); #if defined(NEW_PCIB) && defined(PCI_RES_BUS) if (type == PCI_RES_BUS) @@ -609,7 +608,7 @@ tegra_pcib_pcie_activate_resource(device } if (bootverbose) - printf("%s: start %zx, len %ld\n", __func__, start, + printf("%s: start %zx, len %jd\n", __func__, start, rman_get_size(r)); p = pmap_mapdev(start, (vm_size_t)rman_get_size(r)); @@ -667,7 +666,7 @@ tegra_pcib_route_interrupt(device_t bus, struct tegra_pcib_softc *sc; sc = device_get_softc(bus); - device_printf(bus, "route pin %d for device %d.%d to %lu\n", + device_printf(bus, "route pin %d for device %d.%d to %ju\n", pin, pci_get_slot(dev), pci_get_function(dev), rman_get_start(sc->irq_res)); From owner-svn-src-head@freebsd.org Fri Mar 18 07:59:40 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3A4AD51E2; Fri, 18 Mar 2016 07:59:40 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E447F9DA; Fri, 18 Mar 2016 07:59:39 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I7xdlX033127; Fri, 18 Mar 2016 07:59:39 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I7xdrV033126; Fri, 18 Mar 2016 07:59:39 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201603180759.u2I7xdrV033126@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 18 Mar 2016 07:59:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297012 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 07:59:40 -0000 Author: julian Date: Fri Mar 18 07:59:38 2016 New Revision: 297012 URL: https://svnweb.freebsd.org/changeset/base/297012 Log: Add a few details that make it easier to use this macro. MFC after: 1 week Sponsored by: Panzura inc Modified: head/share/man/man9/SYSCALL_MODULE.9 Modified: head/share/man/man9/SYSCALL_MODULE.9 ============================================================================== --- head/share/man/man9/SYSCALL_MODULE.9 Fri Mar 18 07:13:09 2016 (r297011) +++ head/share/man/man9/SYSCALL_MODULE.9 Fri Mar 18 07:59:38 2016 (r297012) @@ -57,6 +57,8 @@ A pointer to an which saves the offset in .Vt "struct sysent" where the syscall is allocated. +If the location pointed to by offset holds a non 0 number it will be used if possible. +If it holds 0 then one will be assigned. .It Fa new_sysent is a pointer to a structure that specifies the function implementing the syscall and the number of arguments this function needs (see @@ -72,6 +74,17 @@ The argument passed to the callback func .Fa evh event handler when it is called. .El +.Pp +The syscall number assigned to the module can be retrieved using the +.Xr modstat 3 +and +.Xr modfind 3 +library functions in libc. +The MACRO +.Fn SYSCALL_MODULE_HELPER +includes +.Fn SYSCALL_MODULE +and much of its boilerplate code. .Sh EXAMPLES A minimal example for a syscall module can be found in .Pa /usr/share/examples/kld/syscall/module/syscall.c . From owner-svn-src-head@freebsd.org Fri Mar 18 08:47:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 23E0AAD3013; Fri, 18 Mar 2016 08:47:19 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E93D21F2D; Fri, 18 Mar 2016 08:47:18 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I8lIk4059409; Fri, 18 Mar 2016 08:47:18 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I8lI25059408; Fri, 18 Mar 2016 08:47:18 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201603180847.u2I8lI25059408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 18 Mar 2016 08:47:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297013 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 08:47:19 -0000 Author: julian Date: Fri Mar 18 08:47:17 2016 New Revision: 297013 URL: https://svnweb.freebsd.org/changeset/base/297013 Log: Use the right argumant name MFC after: 1 week Sponsored by: Panzura inc Modified: head/lib/libc/sys/modfind.2 Modified: head/lib/libc/sys/modfind.2 ============================================================================== --- head/lib/libc/sys/modfind.2 Fri Mar 18 07:59:38 2016 (r297012) +++ head/lib/libc/sys/modfind.2 Fri Mar 18 08:47:17 2016 (r297013) @@ -49,7 +49,7 @@ The .Fn modfind system call returns the modid of the kernel module referenced by -.Fa file . +.Fa modname . Upon error, .Fn modfind returns -1 and sets From owner-svn-src-head@freebsd.org Fri Mar 18 09:03:01 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4AEBAD3890; Fri, 18 Mar 2016 09:03:01 +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 86EC2BB0; Fri, 18 Mar 2016 09:03:01 +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 u2I9306a065782; Fri, 18 Mar 2016 09:03:00 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I930nj065781; Fri, 18 Mar 2016 09:03:00 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201603180903.u2I930nj065781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Fri, 18 Mar 2016 09:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297014 - head/sys/netipsec X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 09:03:01 -0000 Author: ae Date: Fri Mar 18 09:03:00 2016 New Revision: 297014 URL: https://svnweb.freebsd.org/changeset/base/297014 Log: Fix handling of net.inet.ipsec.dfbit=2 variable. IP_DF macro is in host bytes order, but ip_off field is in network bytes order. So, use htons() for correct check. Modified: head/sys/netipsec/ipsec_output.c Modified: head/sys/netipsec/ipsec_output.c ============================================================================== --- head/sys/netipsec/ipsec_output.c Fri Mar 18 08:47:17 2016 (r297013) +++ head/sys/netipsec/ipsec_output.c Fri Mar 18 09:03:00 2016 (r297014) @@ -441,7 +441,7 @@ ipsec_encap(struct mbuf **mp, struct sec setdf = V_ip4_ipsec_dfbit; break; default:/* propagate to outer header */ - setdf = (ip->ip_off & ntohs(IP_DF)) != 0; + setdf = (ip->ip_off & htons(IP_DF)) != 0; } itos = ip->ip_tos; break; From owner-svn-src-head@freebsd.org Fri Mar 18 09:17:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF277AD3BE6; Fri, 18 Mar 2016 09:17:55 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9F58F1086; Fri, 18 Mar 2016 09:17:55 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2I9HsTm069003; Fri, 18 Mar 2016 09:17:54 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I9HsOL069002; Fri, 18 Mar 2016 09:17:54 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201603180917.u2I9HsOL069002@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 18 Mar 2016 09:17:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297015 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 09:17:55 -0000 Author: julian Date: Fri Mar 18 09:17:54 2016 New Revision: 297015 URL: https://svnweb.freebsd.org/changeset/base/297015 Log: Change a little to match what appears to be the right way of specifying an argument (from looking at other man pages) MFC after: 1 week Sponsored by: Panzura inc Modified: head/share/man/man9/SYSCALL_MODULE.9 Modified: head/share/man/man9/SYSCALL_MODULE.9 ============================================================================== --- head/share/man/man9/SYSCALL_MODULE.9 Fri Mar 18 09:03:00 2016 (r297014) +++ head/share/man/man9/SYSCALL_MODULE.9 Fri Mar 18 09:17:54 2016 (r297015) @@ -57,7 +57,9 @@ A pointer to an which saves the offset in .Vt "struct sysent" where the syscall is allocated. -If the location pointed to by offset holds a non 0 number it will be used if possible. +If the location pointed to by +.Fa offset +holds a non 0 number it will be used if possible. If it holds 0 then one will be assigned. .It Fa new_sysent is a pointer to a structure that specifies the function implementing From owner-svn-src-head@freebsd.org Fri Mar 18 09:54:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F29CDAD4B59; Fri, 18 Mar 2016 09:54:10 +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 C42A81808; Fri, 18 Mar 2016 09:54:10 +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 u2I9s9ex081332; Fri, 18 Mar 2016 09:54:09 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2I9s99d081331; Fri, 18 Mar 2016 09:54:09 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603180954.u2I9s99d081331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 18 Mar 2016 09:54:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297016 - head/etc/autofs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 09:54:11 -0000 Author: trasz Date: Fri Mar 18 09:54:09 2016 New Revision: 297016 URL: https://svnweb.freebsd.org/changeset/base/297016 Log: Add a special case for NTFS to the -media autofs(5) map. Submitted by: lme@ (earlier version) MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/etc/autofs/special_media Modified: head/etc/autofs/special_media ============================================================================== --- head/etc/autofs/special_media Fri Mar 18 09:17:54 2016 (r297015) +++ head/etc/autofs/special_media Fri Mar 18 09:54:09 2016 (r297016) @@ -32,6 +32,26 @@ print_available() { } # Print a single map entry. +print_map_entry() { + local _fstype _p + + _fstype="$1" + _p="$2" + + if [ "${_fstype}" = "ntfs" ]; then + if [ -f "/usr/local/bin/ntfs-3g" ]; then + echo "-mountprog=/usr/local/bin/ntfs-3g,fstype=${_fstype},nosuid :/dev/${_p}" + else + /usr/bin/logger -p info -t "special_media[$$]" \ + "Cannot mount ${_fstype} formatted device /dev/${_p}: Install sysutils/fusefs-ntfs first" + exit 1 + fi + else + echo "-fstype=${_fstype},nosuid :/dev/${_p}" + fi +} + +# Determine map entry contents for the given key and print out the entry. print_one() { local _fstype _fstype_and_label _label _key _p @@ -39,7 +59,7 @@ print_one() { _fstype="$(fstyp "/dev/${_key}" 2> /dev/null)" if [ $? -eq 0 ]; then - echo "-fstype=${_fstype},nosuid :/dev/${_key}" + print_map_entry "${_fstype}" "${_key}" return fi @@ -67,7 +87,7 @@ print_one() { continue fi - echo "-fstype=${_fstype},nosuid :/dev/${_p}" + print_map_entry "${_fstype}" "${_p}" done # No matching device - don't print anything, autofs will handle it. From owner-svn-src-head@freebsd.org Fri Mar 18 10:01:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6567AAD4DB2; Fri, 18 Mar 2016 10:01: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 33B631D14; Fri, 18 Mar 2016 10:01: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 u2IA1PJp081635; Fri, 18 Mar 2016 10:01:25 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IA1PpL081634; Fri, 18 Mar 2016 10:01:25 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603181001.u2IA1PpL081634@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 18 Mar 2016 10:01:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297017 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 10:01:26 -0000 Author: andrew Date: Fri Mar 18 10:01:25 2016 New Revision: 297017 URL: https://svnweb.freebsd.org/changeset/base/297017 Log: Remove the invalid L0_BLOCK definition. ARMv8 doesn't support block translation in the level 0 descriptor. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/include/pte.h Modified: head/sys/arm64/include/pte.h ============================================================================== --- head/sys/arm64/include/pte.h Fri Mar 18 09:54:09 2016 (r297016) +++ head/sys/arm64/include/pte.h Fri Mar 18 10:01:25 2016 (r297017) @@ -74,7 +74,7 @@ typedef uint64_t pt_entry_t; /* page ta /* Level 0 table, 512GiB per entry */ #define L0_SHIFT 39 #define L0_INVAL 0x0 /* An invalid address */ -#define L0_BLOCK 0x1 /* A block */ + /* 0x1 Level 0 doesn't support block translation */ /* 0x2 also marks an invalid address */ #define L0_TABLE 0x3 /* A next-level table */ @@ -83,16 +83,16 @@ typedef uint64_t pt_entry_t; /* page ta #define L1_SIZE (1 << L1_SHIFT) #define L1_OFFSET (L1_SIZE - 1) #define L1_INVAL L0_INVAL -#define L1_BLOCK L0_BLOCK +#define L1_BLOCK 0x1 #define L1_TABLE L0_TABLE /* Level 2 table, 2MiB per entry */ #define L2_SHIFT 21 #define L2_SIZE (1 << L2_SHIFT) #define L2_OFFSET (L2_SIZE - 1) -#define L2_INVAL L0_INVAL -#define L2_BLOCK L0_BLOCK -#define L2_TABLE L0_TABLE +#define L2_INVAL L1_INVAL +#define L2_BLOCK L1_BLOCK +#define L2_TABLE L1_TABLE #define L2_BLOCK_MASK UINT64_C(0xffffffe00000) From owner-svn-src-head@freebsd.org Fri Mar 18 13:26:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 787A3AD4C64; Fri, 18 Mar 2016 13:26:17 +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 4AC29187A; Fri, 18 Mar 2016 13:26:17 +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 u2IDQGQn046840; Fri, 18 Mar 2016 13:26:16 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IDQGdN046839; Fri, 18 Mar 2016 13:26:16 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201603181326.u2IDQGdN046839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 18 Mar 2016 13:26:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297018 - head/sys/dev/iscsi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 13:26:17 -0000 Author: trasz Date: Fri Mar 18 13:26:16 2016 New Revision: 297018 URL: https://svnweb.freebsd.org/changeset/base/297018 Log: Add lock assertion. MFC after: 1 month Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/iscsi/iscsi.c Modified: head/sys/dev/iscsi/iscsi.c ============================================================================== --- head/sys/dev/iscsi/iscsi.c Fri Mar 18 10:01:25 2016 (r297017) +++ head/sys/dev/iscsi/iscsi.c Fri Mar 18 13:26:16 2016 (r297018) @@ -288,6 +288,8 @@ iscsi_session_terminate_task(struct iscs struct iscsi_outstanding *io, bool requeue) { + ISCSI_SESSION_LOCK_ASSERT(is); + if (io->io_ccb != NULL) { io->io_ccb->ccb_h.status &= ~(CAM_SIM_QUEUED | CAM_STATUS_MASK); if (requeue) From owner-svn-src-head@freebsd.org Fri Mar 18 14:49:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1CE05AD4C0A; Fri, 18 Mar 2016 14:49:13 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id ED4B81580; Fri, 18 Mar 2016 14:49:12 +0000 (UTC) (envelope-from julian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IEnCs8071632; Fri, 18 Mar 2016 14:49:12 GMT (envelope-from julian@FreeBSD.org) Received: (from julian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IEnCeN071630; Fri, 18 Mar 2016 14:49:12 GMT (envelope-from julian@FreeBSD.org) Message-Id: <201603181449.u2IEnCeN071630@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: julian set sender to julian@FreeBSD.org using -f From: Julian Elischer Date: Fri, 18 Mar 2016 14:49:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297023 - head/sbin/kldstat X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 14:49:13 -0000 Author: julian Date: Fri Mar 18 14:49:11 2016 New Revision: 297023 URL: https://svnweb.freebsd.org/changeset/base/297023 Log: Add the ability to print out ht emodule specific information in likely formats. Among other things this gives us the ability to find outthe syscall number of a dynamically loaded syscall that has a dynamicly allocated vector number. MFC after: 1 week Sponsored by: Panzura inc. Modified: head/sbin/kldstat/kldstat.8 head/sbin/kldstat/kldstat.c Modified: head/sbin/kldstat/kldstat.8 ============================================================================== --- head/sbin/kldstat/kldstat.8 Fri Mar 18 13:32:37 2016 (r297022) +++ head/sbin/kldstat/kldstat.8 Fri Mar 18 14:49:11 2016 (r297023) @@ -36,10 +36,12 @@ .Op Fl h .Op Fl q .Op Fl v +.Op Fl d .Op Fl i Ar id .Op Fl n Ar filename .Nm .Op Fl q +.Op Fl d .Op Fl m Ar modname .Sh DESCRIPTION The @@ -54,6 +56,8 @@ Display the size field in a human-readab instead of hex values. .It Fl v Be more verbose. +.It Fl d +Show the module specific data (as int, unsigned int and unsigned long) .It Fl i Ar id Display the status of only the file with this ID. .It Fl n Ar filename Modified: head/sbin/kldstat/kldstat.c ============================================================================== --- head/sbin/kldstat/kldstat.c Fri Mar 18 13:32:37 2016 (r297022) +++ head/sbin/kldstat/kldstat.c Fri Mar 18 14:49:11 2016 (r297023) @@ -36,19 +36,28 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define POINTER_WIDTH ((int)(sizeof(void *) * 2 + 2)) +static int showdata = 0; + static void printmod(int modid) { struct module_stat stat; + bzero(&stat, sizeof(stat)); stat.version = sizeof(struct module_stat); if (modstat(modid, &stat) < 0) warn("can't stat module id %d", modid); else - printf("\t\t%2d %s\n", stat.id, stat.name); + if (showdata) { + printf("\t\t%2d %s (%d, %u, 0x%lx)\n", stat.id, stat.name, + stat.data.intval, stat.data.uintval, stat.data.ulongval); + } else { + printf("\t\t%2d %s\n", stat.id, stat.name); + } } static void @@ -88,8 +97,8 @@ printfile(int fileid, int verbose, int h static void usage(void) { - fprintf(stderr, "usage: kldstat [-h] [-q] [-v] [-i id] [-n filename]\n"); - fprintf(stderr, " kldstat [-q] [-m modname]\n"); + fprintf(stderr, "usage: kldstata[-d] [-h] [-q] [-v] [-i id] [-n filename]\n"); + fprintf(stderr, " kldstat [-d] [-q] [-m modname]\n"); exit(1); } @@ -105,8 +114,11 @@ main(int argc, char** argv) char* modname = NULL; char* p; - while ((c = getopt(argc, argv, "hi:m:n:qv")) != -1) + while ((c = getopt(argc, argv, "dhi:m:n:qv")) != -1) switch (c) { + case 'd': + showdata = 1; + break; case 'h': humanized = 1; break; @@ -152,8 +164,14 @@ main(int argc, char** argv) if (modstat(modid, &stat) < 0) warn("can't stat module id %d", modid); else { - printf("Id Refs Name\n"); - printf("%3d %4d %s\n", stat.id, stat.refs, stat.name); + if (showdata) { + printf("Id Refs Name data..(int, uint, ulong)\n"); + printf("%3d %4d %s (%d, %u, 0x%lx)\n", stat.id, stat.refs, stat.name, + stat.data.intval, stat.data.uintval, stat.data.ulongval); + } else { + printf("Id Refs Name\n"); + printf("%3d %4d %s\n", stat.id, stat.refs, stat.name); + } } return 0; From owner-svn-src-head@freebsd.org Fri Mar 18 15:06:51 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 641D1AD515E; Fri, 18 Mar 2016 15:06: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 352A01F57; Fri, 18 Mar 2016 15:06: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 u2IF6otV077756; Fri, 18 Mar 2016 15:06:50 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IF6ooT077755; Fri, 18 Mar 2016 15:06:50 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201603181506.u2IF6ooT077755@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Fri, 18 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: r297024 - head/sbin/ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:06:51 -0000 Author: maxim Date: Fri Mar 18 15:06:50 2016 New Revision: 297024 URL: https://svnweb.freebsd.org/changeset/base/297024 Log: o No need to resolve a mask that we get with ICMP_MASKREPLY, pass it directly to inet_ntoa(3). Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Fri Mar 18 14:49:11 2016 (r297023) +++ head/sbin/ping/ping.c Fri Mar 18 15:06:50 2016 (r297024) @@ -1201,7 +1201,7 @@ pr_pack(char *buf, int cc, struct sockad if (options & F_MASK) { /* Just prentend this cast isn't ugly */ (void)printf(" mask=%s", - pr_addr(*(struct in_addr *)&(icp->icmp_mask))); + inet_ntoa(*(struct in_addr *)&(icp->icmp_mask))); } if (options & F_TIME) { (void)printf(" tso=%s", pr_ntime(icp->icmp_otime)); From owner-svn-src-head@freebsd.org Fri Mar 18 15:07:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2B365AD51B1; Fri, 18 Mar 2016 15:07:45 +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 ECB2917A; Fri, 18 Mar 2016 15:07:44 +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 u2IF7iEe077828; Fri, 18 Mar 2016 15:07:44 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IF7irG077827; Fri, 18 Mar 2016 15:07:44 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201603181507.u2IF7irG077827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Fri, 18 Mar 2016 15:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297025 - head/sbin/ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:07:45 -0000 Author: maxim Date: Fri Mar 18 15:07:43 2016 New Revision: 297025 URL: https://svnweb.freebsd.org/changeset/base/297025 Log: o Kill EoL whitespaces. Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Fri Mar 18 15:06:50 2016 (r297024) +++ head/sbin/ping/ping.c Fri Mar 18 15:07:43 2016 (r297025) @@ -794,7 +794,7 @@ main(int argc, char *const *argv) #endif if (sweepmax) { if (sweepmin > sweepmax) - errx(EX_USAGE, "Maximum packet size must be no less than the minimum packet size"); + errx(EX_USAGE,"Maximum packet size must be no less than the minimum packet size"); if (datalen != DEFDATALEN) errx(EX_USAGE, "Packet size and ping sweep are mutually exclusive"); From owner-svn-src-head@freebsd.org Fri Mar 18 15:27:11 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62015AD5736; Fri, 18 Mar 2016 15:27:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: from mail-oi0-x22b.google.com (mail-oi0-x22b.google.com [IPv6:2607:f8b0:4003:c06::22b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28A6CB16; Fri, 18 Mar 2016 15:27:11 +0000 (UTC) (envelope-from bjkfbsd@gmail.com) Received: by mail-oi0-x22b.google.com with SMTP id w20so35765548oia.2; Fri, 18 Mar 2016 08:27:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=sY5pAhmlkTwSbY6YaNlpgr8qtdp0neIUuny+lXAlUyQ=; b=caNG9BfhPRrZvxQPg8ZaqE6cXw4AcTh3TGOEWkspZfKY6ET16Y6SXFdZqmqXNQqGJ5 QswGjfs0N8FYuLsNi2nCHpWJPB4Gw8EkvTNFegTw5PR97olK9tpn2GJQGymiwhpFKt5L 7mWDR2G1nCyhSRLtiIn2Yt76CCjUZ6WsLyllXjqXeV3o5l2JyxPn4d8nUkMT63oOAZ1l wYVsWdjXLD43qoic9Eo0KVnFRtCqnugwEGqEYVQwwQnGffPeRiHeDe65jK5DSeYf/zk8 dq4ewsHzUdpekteB587685ODR+sSCSCO8eOB5FqAxSZbBnaGwB6crc1F8gd2dHAnGFEH V8mA== 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=sY5pAhmlkTwSbY6YaNlpgr8qtdp0neIUuny+lXAlUyQ=; b=S5PASYwLyVtXtmJ+yz8apWv0pplJ/+wjvtxbnvqScuR3I75ys34Gh36s8JZOKidsY0 hfc402jZMeylzhz519Po/4DeeUjyJ0ZUH8nQRO8c/rfdiqLlZP8yTIxr1zj4o/Pg+O2B 0YKJGPLY8pBh9p/XOHceQvbOneUadvWYWSnR7GtPXXKFKPRdi15UE9d9QDGZjJKFWaAK vDxHJ8d62U1gcO+sMw7jrWq2qmd3cty0e2YaRMJuOngGdzYL8WGTIfQshIXmHe5eojR+ r7LcESGVGQNZY8lbBh7qCLm86tZqfWum7M/oe71nHcnH6dHJZ91uvKt8VFaM2ZU6osZH Y3hg== X-Gm-Message-State: AD7BkJIInCoAv0kL4tNMby6HW2ab38D93I0rpyf/ijeJ2Nr9+euKIXYz5Qog0iegFIcbUl/NVn+LaE+1LuJxOQ== MIME-Version: 1.0 X-Received: by 10.202.208.83 with SMTP id h80mr1793442oig.87.1458314830366; Fri, 18 Mar 2016 08:27:10 -0700 (PDT) Received: by 10.157.40.69 with HTTP; Fri, 18 Mar 2016 08:27:10 -0700 (PDT) In-Reply-To: <201603181507.u2IF7irG077827@repo.freebsd.org> References: <201603181507.u2IF7irG077827@repo.freebsd.org> Date: Fri, 18 Mar 2016 10:27:10 -0500 Message-ID: Subject: Re: svn commit: r297025 - head/sbin/ping From: Benjamin Kaduk To: Maxim Konovalov 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:27:11 -0000 On Fri, Mar 18, 2016 at 10:07 AM, Maxim Konovalov wrote: > Author: maxim > Date: Fri Mar 18 15:07:43 2016 > New Revision: 297025 > URL: https://svnweb.freebsd.org/changeset/base/297025 > > Log: > o Kill EoL whitespaces. > > Modified: > head/sbin/ping/ping.c > > Modified: head/sbin/ping/ping.c > > ============================================================================== > --- head/sbin/ping/ping.c Fri Mar 18 15:06:50 2016 (r297024) > +++ head/sbin/ping/ping.c Fri Mar 18 15:07:43 2016 (r297025) > @@ -794,7 +794,7 @@ main(int argc, char *const *argv) > #endif > if (sweepmax) { > if (sweepmin > sweepmax) > - errx(EX_USAGE, "Maximum packet size must be no > less than the minimum packet size"); > + errx(EX_USAGE,"Maximum packet size must be no less > than the minimum packet size"); > Looks like the space immediately after the comma was also lost. -Ben From owner-svn-src-head@freebsd.org Fri Mar 18 15:27:58 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 486CFAD57D2; Fri, 18 Mar 2016 15:27:58 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 1A9FED2C; Fri, 18 Mar 2016 15:27:58 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IFRvJG083825; Fri, 18 Mar 2016 15:27:57 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IFRvZ7083823; Fri, 18 Mar 2016 15:27:57 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201603181527.u2IFRvZ7083823@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Fri, 18 Mar 2016 15:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297026 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:27:58 -0000 Author: mmel Date: Fri Mar 18 15:27:57 2016 New Revision: 297026 URL: https://svnweb.freebsd.org/changeset/base/297026 Log: TEGRA: Connect TEGRA124 to universe build. Added: head/sys/arm/conf/TEGRA124 - copied, changed from r297025, head/sys/arm/conf/TEGRA124.common Deleted: head/sys/arm/conf/TEGRA124.common Modified: head/sys/arm/conf/JETSON-TK1 Modified: head/sys/arm/conf/JETSON-TK1 ============================================================================== --- head/sys/arm/conf/JETSON-TK1 Fri Mar 18 15:07:43 2016 (r297025) +++ head/sys/arm/conf/JETSON-TK1 Fri Mar 18 15:27:57 2016 (r297026) @@ -19,7 +19,7 @@ #NO_UNIVERSE -include "TEGRA124.common" +include "TEGRA124" ident JETSON-TK1 # Flattened Device Tree Copied and modified: head/sys/arm/conf/TEGRA124 (from r297025, head/sys/arm/conf/TEGRA124.common) ============================================================================== --- head/sys/arm/conf/TEGRA124.common Fri Mar 18 15:07:43 2016 (r297025, copy source) +++ head/sys/arm/conf/TEGRA124 Fri Mar 18 15:27:57 2016 (r297026) @@ -21,6 +21,8 @@ include "std.armv6" include "../nvidia/tegra124/std.tegra124" +ident TEGRA124 + options HZ=100 # Scheduling quantum is 10 milliseconds. options SCHED_ULE # ULE scheduler options PLATFORM # Platform based SoC From owner-svn-src-head@freebsd.org Fri Mar 18 15:40:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0A024AD5C2F; Fri, 18 Mar 2016 15:40:42 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 907C61317; Fri, 18 Mar 2016 15:40:41 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.15.2/8.15.2) with ESMTP id u2IFecCq049782; Fri, 18 Mar 2016 18:40:38 +0300 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Fri, 18 Mar 2016 18:40:38 +0300 (MSK) From: Maxim Konovalov To: Benjamin Kaduk cc: "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r297025 - head/sbin/ping In-Reply-To: Message-ID: References: <201603181507.u2IF7irG077827@repo.freebsd.org> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:40:42 -0000 On Fri, 18 Mar 2016, 10:27-0500, Benjamin Kaduk wrote: > On Fri, Mar 18, 2016 at 10:07 AM, Maxim Konovalov wrote: > > > Author: maxim > > Date: Fri Mar 18 15:07:43 2016 > > New Revision: 297025 > > URL: https://svnweb.freebsd.org/changeset/base/297025 > > > > Log: > > o Kill EoL whitespaces. > > > > Modified: > > head/sbin/ping/ping.c > > > > Modified: head/sbin/ping/ping.c > > > > ============================================================================== > > --- head/sbin/ping/ping.c Fri Mar 18 15:06:50 2016 (r297024) > > +++ head/sbin/ping/ping.c Fri Mar 18 15:07:43 2016 (r297025) > > @@ -794,7 +794,7 @@ main(int argc, char *const *argv) > > #endif > > if (sweepmax) { > > if (sweepmin > sweepmax) > > - errx(EX_USAGE, "Maximum packet size must be no > > less than the minimum packet size"); > > + errx(EX_USAGE,"Maximum packet size must be no less > > than the minimum packet size"); > > > > Looks like the space immediately after the comma was also lost. > > -Ben > That's strange. Thanks, will fix that. -- Maxim Konovalov From owner-svn-src-head@freebsd.org Fri Mar 18 15:44:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA2BFAD5DE3; Fri, 18 Mar 2016 15:44:22 +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 AB753183F; Fri, 18 Mar 2016 15:44:22 +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 u2IFiLk5089642; Fri, 18 Mar 2016 15:44:21 GMT (envelope-from maxim@FreeBSD.org) Received: (from maxim@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IFiL7k089641; Fri, 18 Mar 2016 15:44:21 GMT (envelope-from maxim@FreeBSD.org) Message-Id: <201603181544.u2IFiL7k089641@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: maxim set sender to maxim@FreeBSD.org using -f From: Maxim Konovalov Date: Fri, 18 Mar 2016 15:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297027 - head/sbin/ping X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 15:44:23 -0000 Author: maxim Date: Fri Mar 18 15:44:21 2016 New Revision: 297027 URL: https://svnweb.freebsd.org/changeset/base/297027 Log: o Restore some good whitespace killed in the previous commit. Spotted by: bjk Modified: head/sbin/ping/ping.c Modified: head/sbin/ping/ping.c ============================================================================== --- head/sbin/ping/ping.c Fri Mar 18 15:27:57 2016 (r297026) +++ head/sbin/ping/ping.c Fri Mar 18 15:44:21 2016 (r297027) @@ -794,7 +794,7 @@ main(int argc, char *const *argv) #endif if (sweepmax) { if (sweepmin > sweepmax) - errx(EX_USAGE,"Maximum packet size must be no less than the minimum packet size"); + errx(EX_USAGE, "Maximum packet size must be no less than the minimum packet size"); if (datalen != DEFDATALEN) errx(EX_USAGE, "Packet size and ping sweep are mutually exclusive"); From owner-svn-src-head@freebsd.org Fri Mar 18 16:18:31 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 523CDAD465B; Fri, 18 Mar 2016 16:18:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 2CBDA7C6; Fri, 18 Mar 2016 16:18:31 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IGIUbR098890; Fri, 18 Mar 2016 16:18:30 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IGIUON098886; Fri, 18 Mar 2016 16:18:30 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603181618.u2IGIUON098886@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 18 Mar 2016 16:18:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297028 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 16:18:31 -0000 Author: andrew Date: Fri Mar 18 16:18:29 2016 New Revision: 297028 URL: https://svnweb.freebsd.org/changeset/base/297028 Log: Reduce the diff with intrng by renaming similar functions. This is a noop, but will help move to use the common interrupt handling code later. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/exception.S head/sys/arm64/arm64/intr_machdep.c head/sys/arm64/arm64/nexus.c head/sys/arm64/include/intr.h Modified: head/sys/arm64/arm64/exception.S ============================================================================== --- head/sys/arm64/arm64/exception.S Fri Mar 18 15:44:21 2016 (r297027) +++ head/sys/arm64/arm64/exception.S Fri Mar 18 16:18:29 2016 (r297028) @@ -150,7 +150,7 @@ END(handle_el1h_sync) ENTRY(handle_el1h_irq) save_registers 1 mov x0, sp - bl arm_cpu_intr + bl intr_irq_handler restore_registers 1 eret END(handle_el1h_irq) @@ -171,7 +171,7 @@ END(handle_el0_sync) ENTRY(handle_el0_irq) save_registers 0 mov x0, sp - bl arm_cpu_intr + bl intr_irq_handler do_ast restore_registers 0 eret Modified: head/sys/arm64/arm64/intr_machdep.c ============================================================================== --- head/sys/arm64/arm64/intr_machdep.c Fri Mar 18 15:44:21 2016 (r297027) +++ head/sys/arm64/arm64/intr_machdep.c Fri Mar 18 16:18:29 2016 (r297028) @@ -408,7 +408,7 @@ arm_setup_intr(const char *name, driver_ } int -arm_teardown_intr(void *cookie) +intr_irq_remove_handler(device_t dev, u_int irq, void *cookie) { struct arm64_intr_entry *intr; int error; @@ -426,7 +426,7 @@ arm_teardown_intr(void *cookie) } int -arm_config_intr(u_int hw_irq, enum intr_trigger trig, enum intr_polarity pol) +intr_irq_config(u_int hw_irq, enum intr_trigger trig, enum intr_polarity pol) { struct arm64_intr_entry *intr; @@ -476,7 +476,7 @@ stray: } void -arm_cpu_intr(struct trapframe *tf) +intr_irq_handler(struct trapframe *tf) { critical_enter(); @@ -512,7 +512,7 @@ SYSINIT(arm_intr_smp_init, SI_SUB_SMP, S /* Attempt to bind the specified IRQ to the specified CPU. */ int -arm_intr_bind(u_int hw_irq, int cpu) +intr_irq_bind(u_int hw_irq, int cpu) { struct arm64_intr_entry *intr; Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Fri Mar 18 15:44:21 2016 (r297027) +++ head/sys/arm64/arm64/nexus.c Fri Mar 18 16:18:29 2016 (r297028) @@ -271,7 +271,7 @@ nexus_config_intr(device_t dev, int irq, enum intr_polarity pol) { - return (arm_config_intr(irq, trig, pol)); + return (intr_irq_config(irq, trig, pol)); } static int @@ -298,7 +298,7 @@ static int nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) { - return (arm_teardown_intr(ih)); + return (intr_irq_remove_handler(child, rman_get_start(r), ih)); } #ifdef SMP @@ -306,7 +306,7 @@ static int nexus_bind_intr(device_t dev, device_t child, struct resource *irq, int cpu) { - return (arm_intr_bind(rman_get_start(irq), cpu)); + return (intr_irq_bind(rman_get_start(irq), cpu)); } #endif Modified: head/sys/arm64/include/intr.h ============================================================================== --- head/sys/arm64/include/intr.h Fri Mar 18 15:44:21 2016 (r297027) +++ head/sys/arm64/include/intr.h Fri Mar 18 16:18:29 2016 (r297028) @@ -29,8 +29,10 @@ #ifndef _MACHINE_INTR_H_ #define _MACHINE_INTR_H_ -int arm_config_intr(u_int, enum intr_trigger, enum intr_polarity); -void arm_cpu_intr(struct trapframe *); +int intr_irq_config(u_int, enum intr_trigger, enum intr_polarity); +void intr_irq_handler(struct trapframe *); +int intr_irq_remove_handler(device_t, u_int, void *); + void arm_dispatch_intr(u_int, struct trapframe *); int arm_enable_intr(void); void arm_mask_irq(u_int); @@ -44,12 +46,12 @@ int arm_map_msi(device_t, device_t, int, int arm_map_msix(device_t, device_t, int, uint64_t *, uint32_t *); int arm_setup_intr(const char *, driver_filter_t *, driver_intr_t, void *, u_int, enum intr_type, void **); -int arm_teardown_intr(void *); void arm_unmask_irq(u_int); #ifdef SMP +int intr_irq_bind(u_int, int); + void arm_init_secondary(void); -int arm_intr_bind(u_int, int); void arm_setup_ipihandler(driver_filter_t *, u_int); void arm_unmask_ipi(u_int); #endif From owner-svn-src-head@freebsd.org Fri Mar 18 16:29:59 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4C1C3AD4A70; Fri, 18 Mar 2016 16:29:59 +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 1E80AE55; Fri, 18 Mar 2016 16:29:59 +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 u2IGTwrJ002172; Fri, 18 Mar 2016 16:29:58 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IGTwaY002170; Fri, 18 Mar 2016 16:29:58 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603181629.u2IGTwaY002170@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 18 Mar 2016 16:29:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297029 - in head/sys/arm64: arm64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 16:29:59 -0000 Author: andrew Date: Fri Mar 18 16:29:58 2016 New Revision: 297029 URL: https://svnweb.freebsd.org/changeset/base/297029 Log: Rename COUNT_IPI to INTR_IPI_COUNT to reduce the diff with intrng. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/mp_machdep.c head/sys/arm64/include/smp.h Modified: head/sys/arm64/arm64/mp_machdep.c ============================================================================== --- head/sys/arm64/arm64/mp_machdep.c Fri Mar 18 16:18:29 2016 (r297028) +++ head/sys/arm64/arm64/mp_machdep.c Fri Mar 18 16:29:58 2016 (r297029) @@ -179,7 +179,7 @@ release_aps(void *dummy __unused) int cpu, i; /* Setup the IPI handler */ - for (i = 0; i < COUNT_IPI; i++) + for (i = 0; i < INTR_IPI_COUNT; i++) arm_setup_ipihandler(ipi_handler, i); atomic_store_rel_int(&aps_ready, 1); @@ -238,7 +238,7 @@ init_secondary(uint64_t cpu) /* Configure the interrupt controller */ arm_init_secondary(); - for (i = 0; i < COUNT_IPI; i++) + for (i = 0; i < INTR_IPI_COUNT; i++) arm_unmask_ipi(i); /* Start per-CPU event timers. */ @@ -277,7 +277,7 @@ ipi_handler(void *arg) u_int cpu, ipi; arg = (void *)((uintptr_t)arg & ~(1 << 16)); - KASSERT((uintptr_t)arg < COUNT_IPI, + KASSERT((uintptr_t)arg < INTR_IPI_COUNT, ("Invalid IPI %ju", (uintptr_t)arg)); cpu = PCPU_GET(cpuid); Modified: head/sys/arm64/include/smp.h ============================================================================== --- head/sys/arm64/include/smp.h Fri Mar 18 16:18:29 2016 (r297028) +++ head/sys/arm64/include/smp.h Fri Mar 18 16:29:58 2016 (r297029) @@ -42,7 +42,7 @@ enum { IPI_STOP, IPI_STOP_HARD, IPI_HARDCLOCK, - COUNT_IPI, + INTR_IPI_COUNT, }; void ipi_all_but_self(u_int ipi); From owner-svn-src-head@freebsd.org Fri Mar 18 16:32:23 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F08F5AD4C9B; Fri, 18 Mar 2016 16:32:23 +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 BDE5A1278; Fri, 18 Mar 2016 16:32:23 +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 u2IGWMm4004997; Fri, 18 Mar 2016 16:32:22 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IGWMDx004996; Fri, 18 Mar 2016 16:32:22 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201603181632.u2IGWMDx004996@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Fri, 18 Mar 2016 16:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297030 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 16:32:24 -0000 Author: andrew Date: Fri Mar 18 16:32:22 2016 New Revision: 297030 URL: https://svnweb.freebsd.org/changeset/base/297030 Log: Move the opt_ files to be included first so their definitions can be used from within all further included files. Obtained from: ABT Systems Ltd Sponsored by: The FreeBSD Foundation Modified: head/sys/arm64/arm64/nexus.c Modified: head/sys/arm64/arm64/nexus.c ============================================================================== --- head/sys/arm64/arm64/nexus.c Fri Mar 18 16:29:58 2016 (r297029) +++ head/sys/arm64/arm64/nexus.c Fri Mar 18 16:32:22 2016 (r297030) @@ -39,6 +39,9 @@ * and I/O memory address space. */ +#include "opt_acpi.h" +#include "opt_platform.h" + #include __FBSDID("$FreeBSD$"); @@ -60,9 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include "opt_acpi.h" -#include "opt_platform.h" - #ifdef FDT #include #include "ofw_bus_if.h" From owner-svn-src-head@freebsd.org Fri Mar 18 18:05:14 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 697AAAD4D4E; Fri, 18 Mar 2016 18:05:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 481C5104F; Fri, 18 Mar 2016 18:05:14 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 59E1DB977; Fri, 18 Mar 2016 14:05:13 -0400 (EDT) From: John Baldwin To: Adrian Chadd Cc: Gleb Smirnoff , Hans Petter Selasky , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r296909 - head/sys/ofed/drivers/infiniband/ulp/ipoib Date: Fri, 18 Mar 2016 10:43:32 -0700 Message-ID: <208354486.x7l0Vtjzkk@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: References: <201603151547.u2FFlQKN078643@repo.freebsd.org> <5463538.GTDDlnsCR6@ralph.baldwin.cx> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Mar 2016 14:05:13 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 18:05:14 -0000 On Wednesday, March 16, 2016 03:37:09 PM Adrian Chadd wrote: > I've fought this problem in USB drivers. Ideally you'd also have the > detach path /also/ take said lock and drain anyone currently doing > anything active (tx, rx, ioctls, net80211 methods, etc) to completion > before continuing. > > A lot of drivers don't do this very well, or at all. There isn't a lock to take in detach to hold over drains. Instead, the various detach APIs (like if_detach) need to drain internally. Only the ifnet layer can keep track of if an ifnet is currently "busy" (any methods currently executing for example). You can't do that in the driver. This is why bus_teardown_intr() does a drain for example (as well as callout_drain()). destroy_dev() also handles this more correctly as it does a drain (and drivers can even provide a d_purge callback to wakeup any waiters inside of cdevsw methods during the drain). if_detach() doesn't do any drain at all and is broken. It has to be fixed in the ifnet layer. Changes in drivers are just band-aids (the current band-aids in this commit and in other NIC drivers previously only hide witness warnings, they do nothing to solve the problem of some thread that is already inside of an if_foo method still running when detach is called, particularly if an if_foo method can sleep). -- John Baldwin From owner-svn-src-head@freebsd.org Fri Mar 18 18:05:13 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2898CAD4D41; Fri, 18 Mar 2016 18:05:13 +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 08464104B; Fri, 18 Mar 2016 18:05:13 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 19C91B93A; Fri, 18 Mar 2016 14:05:12 -0400 (EDT) From: John Baldwin To: Justin Hibbits Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r297000 - in head: . sys/arm/xscale/ixp425 sys/arm/xscale/pxa sys/compat/ndis sys/dev/acpica sys/dev/advansys sys/dev/atkbdc sys/dev/bxe sys/dev/cardbus sys/dev/ctau sys/dev/ed sys/dev/... Date: Fri, 18 Mar 2016 10:49:45 -0700 Message-ID: <2148463.8F4WoXScuZ@ralph.baldwin.cx> User-Agent: KMail/4.14.3 (FreeBSD/10.2-STABLE; KDE/4.14.3; amd64; ; ) In-Reply-To: <201603180128.u2I1SfaM039505@repo.freebsd.org> References: <201603180128.u2I1SfaM039505@repo.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 18 Mar 2016 14:05:12 -0400 (EDT) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 18:05:13 -0000 On Friday, March 18, 2016 01:28:41 AM Justin Hibbits wrote: > Author: jhibbits > Date: Fri Mar 18 01:28:41 2016 > New Revision: 297000 > URL: https://svnweb.freebsd.org/changeset/base/297000 > > Log: > Use uintmax_t (typedef'd to rman_res_t type) for rman ranges. > > On some architectures, u_long isn't large enough for resource definitions. > Particularly, powerpc and arm allow 36-bit (or larger) physical addresses, but > type `long' is only 32-bit. This extends rman's resources to uintmax_t. With > this change, any resource can feasibly be placed anywhere in physical memory > (within the constraints of the driver). > > Why uintmax_t and not something machine dependent, or uint64_t? Though it's > possible for uintmax_t to grow, it's highly unlikely it will become 128-bit on > 32-bit architectures. 64-bit architectures should have plenty of RAM to absorb > the increase on resource sizes if and when this occurs, and the number of > resources on memory-constrained systems should be sufficiently small as to not > pose a drastic overhead. That being said, uintmax_t was chosen for source > clarity. If it's specified as uint64_t, all printf()-like calls would either > need casts to uintmax_t, or be littered with PRI*64 macros. Casts to uintmax_t > aren't horrible, but it would also bake into the API for > resource_list_print_type() either a hidden assumption that entries get cast to > uintmax_t for printing, or these calls would need the PRI*64 macros. Since > source code is meant to be read more often than written, I chose the clearest > path of simply using uintmax_t. > > Tested on a PowerPC p5020-based board, which places all device resources in > 0xfxxxxxxxx, and has 8GB RAM. > Regression tested on qemu-system-i386 > Regression tested on qemu-system-mips (malta profile) > > Tested PAE and devinfo on virtualbox (live CD) > > Special thanks to bz for his testing on ARM. > > Reviewed By: bz, jhb (previous) > Relnotes: Yes > Sponsored by: Alex Perez/Inertial Computing > Differential Revision: https://reviews.freebsd.org/D4544 Thank you for chasing this down to completion. It removes quite a few hacks from the PAE case. Thank you also for being patient when I asked you to split the changes up, rearrange things, etc. :) -- John Baldwin From owner-svn-src-head@freebsd.org Fri Mar 18 19:04:03 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1DDE4AD45EC; Fri, 18 Mar 2016 19:04:03 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E38E21CB1; Fri, 18 Mar 2016 19:04: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 u2IJ42wx051042; Fri, 18 Mar 2016 19:04:02 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IJ42in051041; Fri, 18 Mar 2016 19:04:02 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201603181904.u2IJ42in051041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Fri, 18 Mar 2016 19:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297037 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 19:04:03 -0000 Author: pfg Date: Fri Mar 18 19:04:01 2016 New Revision: 297037 URL: https://svnweb.freebsd.org/changeset/base/297037 Log: aio_qphysio(): Avoid uninitialized pointer read on error. For the !unmap case it may happen that pbuf gets called unreferenced when vm_fault_quick_hold_pages() fails. Initialize it so it doesn't cause trouble. CID: 1352776 Reviewed by: jhb MFC after: 1 week Modified: head/sys/kern/vfs_aio.c Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Fri Mar 18 18:26:07 2016 (r297036) +++ head/sys/kern/vfs_aio.c Fri Mar 18 19:04:01 2016 (r297037) @@ -1226,7 +1226,8 @@ aio_qphysio(struct proc *p, struct kaioc if (!unmap) { job->pbuf = pbuf = (struct buf *)getpbuf(NULL); BUF_KERNPROC(pbuf); - } + } else + pbuf = NULL; AIO_LOCK(ki); if (!unmap) From owner-svn-src-head@freebsd.org Fri Mar 18 19:36:45 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 177EFAD50F8; Fri, 18 Mar 2016 19:36:45 +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 D62A4D73; Fri, 18 Mar 2016 19:36:44 +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 u2IJahQG060369; Fri, 18 Mar 2016 19:36:43 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IJahmf060368; Fri, 18 Mar 2016 19:36:43 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603181936.u2IJahmf060368@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 18 Mar 2016 19:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297038 - head/sys/dev/pci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 19:36:45 -0000 Author: bz Date: Fri Mar 18 19:36:43 2016 New Revision: 297038 URL: https://svnweb.freebsd.org/changeset/base/297038 Log: Convert the printfs here from %lx to %jx as well after r297000 in order to be able to compile this into arm kernels. Sponsored by: DARPA/AFRL Modified: head/sys/dev/pci/pci_host_generic.c Modified: head/sys/dev/pci/pci_host_generic.c ============================================================================== --- head/sys/dev/pci/pci_host_generic.c Fri Mar 18 19:04:01 2016 (r297037) +++ head/sys/dev/pci/pci_host_generic.c Fri Mar 18 19:36:43 2016 (r297038) @@ -540,7 +540,7 @@ generic_pcie_alloc_resource_pcie(device_ if (bootverbose) { device_printf(dev, - "rman_reserve_resource: start=%#lx, end=%#lx, count=%#lx\n", + "rman_reserve_resource: start=%#jx, end=%#jx, count=%#jx\n", start, end, count); } @@ -560,7 +560,7 @@ generic_pcie_alloc_resource_pcie(device_ fail: device_printf(dev, "%s FAIL: type=%d, rid=%d, " - "start=%016lx, end=%016lx, count=%016lx, flags=%x\n", + "start=%016jx, end=%016jx, count=%016jx, flags=%x\n", __func__, type, *rid, start, end, count, flags); return (NULL); @@ -744,7 +744,7 @@ generic_pcie_alloc_resource_ofw(device_t if (i == MAX_RANGES_TUPLES) { device_printf(bus, "Could not map resource " - "%#lx-%#lx\n", start, end); + "%#jx-%#jx\n", start, end); return (NULL); } } From owner-svn-src-head@freebsd.org Fri Mar 18 19:48:50 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF9DFAD5565; Fri, 18 Mar 2016 19:48:50 +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 9DB111531; Fri, 18 Mar 2016 19:48:50 +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 u2IJmnbe063766; Fri, 18 Mar 2016 19:48:49 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IJmndg063765; Fri, 18 Mar 2016 19:48:49 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201603181948.u2IJmndg063765@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Fri, 18 Mar 2016 19:48:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297039 - head/sys/x86/x86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 19:48:50 -0000 Author: jhb Date: Fri Mar 18 19:48:49 2016 New Revision: 297039 URL: https://svnweb.freebsd.org/changeset/base/297039 Log: Check IPI status more frequently when waiting. An IPI cannot be sent via the local APIC if a previous IPI is still being delivered. Attempts to send an IPI will wait for a pending IPI to clear. Prior to r278325 these checks used a spin loop with a hardcoded maximum count which broke AP startup on some systems. However, r278325 also enforced a minimum latency of 5 microseconds if an IPI was still pending which resulted in a measurable performance hit. This change reduces that minimum latency to 1 microsecond. Tested by: stas MFC after: 3 days Modified: head/sys/x86/x86/local_apic.c Modified: head/sys/x86/x86/local_apic.c ============================================================================== --- head/sys/x86/x86/local_apic.c Fri Mar 18 19:36:43 2016 (r297038) +++ head/sys/x86/x86/local_apic.c Fri Mar 18 19:48:49 2016 (r297039) @@ -1641,11 +1641,11 @@ native_lapic_ipi_wait(int delay) return (1); } - 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); } From owner-svn-src-head@freebsd.org Fri Mar 18 20:03:12 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0D891AD5B18; Fri, 18 Mar 2016 20:03:12 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CACD6113D; Fri, 18 Mar 2016 20:03:11 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2IK3BXE069682; Fri, 18 Mar 2016 20:03:11 GMT (envelope-from sjg@FreeBSD.org) Received: (from sjg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IK39FS069664; Fri, 18 Mar 2016 20:03:09 GMT (envelope-from sjg@FreeBSD.org) Message-Id: <201603182003.u2IK39FS069664@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sjg set sender to sjg@FreeBSD.org using -f From: "Simon J. Gerraty" Date: Fri, 18 Mar 2016 20:03:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297040 - in head: contrib/bmake contrib/bmake/mk share/mk usr.bin/bmake X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 20:03:12 -0000 Author: sjg Date: Fri Mar 18 20:03:09 2016 New Revision: 297040 URL: https://svnweb.freebsd.org/changeset/base/297040 Log: Update to bmake-20160315 Archive member handling works again meta mode, treat missing reads as for writes. Update dirdeps.mk - much improved startup time. Update meta.stage.mk - avoid ln when chmod required. Modified: head/contrib/bmake/ChangeLog head/contrib/bmake/Makefile head/contrib/bmake/bmake.1 head/contrib/bmake/bmake.cat1 head/contrib/bmake/make.1 head/contrib/bmake/meta.c head/contrib/bmake/mk/ChangeLog head/contrib/bmake/mk/dirdeps.mk head/contrib/bmake/mk/install-mk head/contrib/bmake/mk/meta.autodep.mk head/contrib/bmake/mk/meta.stage.mk head/contrib/bmake/mk/sys.dependfile.mk head/contrib/bmake/parse.c head/contrib/bmake/suff.c head/contrib/bmake/var.c head/share/mk/dirdeps.mk head/share/mk/meta.stage.mk head/usr.bin/bmake/Makefile Directory Properties: head/contrib/bmake/ (props changed) Modified: head/contrib/bmake/ChangeLog ============================================================================== --- head/contrib/bmake/ChangeLog Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/ChangeLog Fri Mar 18 20:03:09 2016 (r297040) @@ -1,3 +1,20 @@ +2016-03-15 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): 20160315 + Merge with NetBSD make, pick up + o fix handling of archive members + +2016-03-13 Simon J. Gerraty + + * Makefile (_MAKE_VERSION): rename variable to avoid interference + with checks for ${MAKE_VERSION} + +2016-03-10 Simon J. Gerraty + + * Makefile (MAKE_VERSION): 20160310 + Merge with NetBSD make, pick up + o meta.c: treat missing Read file same as Write, incase we Delete it. + 2016-03-07 Simon J. Gerraty * Makefile (MAKE_VERSION): 20160307 Modified: head/contrib/bmake/Makefile ============================================================================== --- head/contrib/bmake/Makefile Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/Makefile Fri Mar 18 20:03:09 2016 (r297040) @@ -1,7 +1,7 @@ -# $Id: Makefile,v 1.55 2016/03/07 22:02:47 sjg Exp $ +# $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $ # Base version on src date -MAKE_VERSION= 20160307 +_MAKE_VERSION= 20160315 PROG= bmake @@ -76,7 +76,7 @@ CFLAGS+= ${CPPFLAGS} CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\" CFLAGS+= -I. -I${srcdir} ${XDEFS} -DMAKE_NATIVE CFLAGS+= ${COPTS.${.ALLSRC:M*.c:T:u}} -COPTS.main.c+= "-DMAKE_VERSION=\"${MAKE_VERSION}\"" +COPTS.main.c+= "-DMAKE_VERSION=\"${_MAKE_VERSION}\"" # meta mode can be useful even without filemon FILEMON_H ?= /usr/include/dev/filemon/filemon.h Modified: head/contrib/bmake/bmake.1 ============================================================================== --- head/contrib/bmake/bmake.1 Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/bmake.1 Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ +.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -685,6 +685,9 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms Modified: head/contrib/bmake/bmake.cat1 ============================================================================== --- head/contrib/bmake/bmake.cat1 Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/bmake.cat1 Fri Mar 18 20:03:09 2016 (r297040) @@ -438,7 +438,9 @@ VVAARRIIAABBLLEE AASSSSIIGG suffixes declared with ..SSUUFFFFIIXXEESS or it will not be recog- nized. - _._T_A_R_G_E_T The name of the target; also known as `_@'. + _._T_A_R_G_E_T The name of the target; also known as `_@'. For compati- + bility with other makes this is an alias for ..AARRCCHHIIVVEE in + archive member rules. The shorter forms (`_>', `_!', `_<', `_%', `_?', `_*', and `_@') are permitted for backward compatibility with historical makefiles and legacy POSIX Modified: head/contrib/bmake/make.1 ============================================================================== --- head/contrib/bmake/make.1 Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/make.1 Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -.\" $NetBSD: make.1,v 1.254 2016/02/20 01:43:28 wiz Exp $ +.\" $NetBSD: make.1,v 1.255 2016/03/14 07:42:15 matthias Exp $ .\" .\" Copyright (c) 1990, 1993 .\" The Regents of the University of California. All rights reserved. @@ -685,6 +685,9 @@ or it will not be recognized. .It Va .TARGET The name of the target; also known as .Ql Va @ . +For compatibility with other makes this is an alias for +.Ic .ARCHIVE +in archive member rules. .El .Pp The shorter forms Modified: head/contrib/bmake/meta.c ============================================================================== --- head/contrib/bmake/meta.c Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/meta.c Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -/* $NetBSD: meta.c,v 1.53 2016/03/07 21:45:43 christos Exp $ */ +/* $NetBSD: meta.c,v 1.54 2016/03/11 07:01:21 sjg Exp $ */ /* * Implement 'meta' mode. @@ -1190,7 +1190,8 @@ meta_oodate(GNode *gn, Boolean oodate) if ((link_src != NULL && lstat(p, &fs) < 0) || (link_src == NULL && stat(p, &fs) < 0)) { - Lst_AtEnd(missingFiles, bmake_strdup(p)); + if (Lst_Find(missingFiles, p, string_match) == NULL) + Lst_AtEnd(missingFiles, bmake_strdup(p)); } break; check_link_src: @@ -1281,9 +1282,8 @@ meta_oodate(GNode *gn, Boolean oodate) * A referenced file outside of CWD is missing. * We cannot catch every eventuality here... */ - if (DEBUG(META)) - fprintf(debug_file, "%s: %d: file '%s' may have moved?...\n", fname, lineno, p); - oodate = TRUE; + if (Lst_Find(missingFiles, p, string_match) == NULL) + Lst_AtEnd(missingFiles, bmake_strdup(p)); } } if (buf[0] == 'E') { Modified: head/contrib/bmake/mk/ChangeLog ============================================================================== --- head/contrib/bmake/mk/ChangeLog Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/ChangeLog Fri Mar 18 20:03:09 2016 (r297040) @@ -1,3 +1,26 @@ +2016-03-15 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160315 + + * meta.stage.mk (LN_CP_SCRIPT): do not ln(1) if we have to chmod(1) + normally only applies to scripts. + + * dirdeps.mk: NO_DIRDEPS_BELOW to supress DIRDEPS below RELDIR as + well as outside it. + +2016-03-10 Simon J. Gerraty + + * install-mk (MK_VERSION): 20160310 + + * dirdeps.mk: use targets rather than a list to track DIRDEPS that + we have processed; the list gets very inefficient as number of + DIRDEPS gets large. + + * sys.dependfile.mk: fix comment wrt MACHINE + + * meta.autodep.mk: ignore staged DPADDs when bootstrapping. + patch from Bryan Drewery + 2016-03-02 Simon J. Gerraty * meta2deps.sh: don't ignore subdirs. Modified: head/contrib/bmake/mk/dirdeps.mk ============================================================================== --- head/contrib/bmake/mk/dirdeps.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/dirdeps.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -# $Id: dirdeps.mk,v 1.59 2016/02/26 23:32:29 sjg Exp $ +# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -135,7 +135,6 @@ start_utc := ${now_utc} # make sure these are empty to start with _DEP_TARGET_SPEC = -_DIRDEP_CHECKED = # If TARGET_SPEC_VARS is other than just MACHINE # it should be set by sys.mk or similar by now. @@ -225,7 +224,7 @@ _DEP_TARGET_SPEC = ${_last_dependfile:${ .endif .if !empty(_last_dependfile) # record that we've read dependfile for this -_DIRDEP_CHECKED += ${_CURDIR}.${TARGET_SPEC} +_dirdeps_checked.${_CURDIR}.${TARGET_SPEC}: .endif .endif @@ -306,8 +305,10 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} .if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) -# confine ourselves to the original dir +# confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* +.elif defined(NO_DIRDEPS_BELOW) +DIRDEPS_FILTER += M${_DEP_RELDIR} .endif # this is what we run below @@ -597,9 +598,9 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${ # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} -.if ${_DIRDEP_CHECKED:M$d} == "" +.if !target(_dirdeps_checked.$d) # once only -_DIRDEP_CHECKED += $d +_dirdeps_checked.$d: .if ${_debug_search} .info checking $d .endif Modified: head/contrib/bmake/mk/install-mk ============================================================================== --- head/contrib/bmake/mk/install-mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/install-mk Fri Mar 18 20:03:09 2016 (r297040) @@ -55,7 +55,7 @@ # Simon J. Gerraty # RCSid: -# $Id: install-mk,v 1.121 2016/02/27 00:23:02 sjg Exp $ +# $Id: install-mk,v 1.123 2016/03/16 00:13:16 sjg Exp $ # # @(#) Copyright (c) 1994 Simon J. Gerraty # @@ -70,7 +70,7 @@ # sjg@crufty.net # -MK_VERSION=20160226 +MK_VERSION=20160315 OWNER= GROUP= MODE=444 Modified: head/contrib/bmake/mk/meta.autodep.mk ============================================================================== --- head/contrib/bmake/mk/meta.autodep.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/meta.autodep.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -# $Id: meta.autodep.mk,v 1.40 2016/02/22 22:44:58 sjg Exp $ +# $Id: meta.autodep.mk,v 1.41 2016/03/11 01:29:38 sjg Exp $ # # @(#) Copyright (c) 2010, Simon J. Gerraty @@ -195,7 +195,7 @@ gendirdeps: ${_DEPENDFILE} # The pseudo machine "host" is used for HOST_TARGET DIRDEPS += \ ${DPADD:M${_OBJTOP}*:H:C,${_OBJTOP}[^/]*/,,:N.:O:u} \ - ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} + ${DPADD:M${_OBJROOT}*:N${_OBJTOP}*:N${STAGE_ROOT:U${_OBJTOP}}/*:H:S,${_OBJROOT},,:C,^([^/]+)/(.*),\2.\1,:S,${HOST_TARGET}$,host,:N.*:O:u} .endif .endif Modified: head/contrib/bmake/mk/meta.stage.mk ============================================================================== --- head/contrib/bmake/mk/meta.stage.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/meta.stage.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -# $Id: meta.stage.mk,v 1.43 2016/02/24 18:46:32 sjg Exp $ +# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -58,7 +58,7 @@ GENDIRDEPS_FILTER += Nnot-empty-is-impor LN_CP_SCRIPT = LnCp() { \ rm -f $$2 2> /dev/null; \ - ln $$1 $$2 2> /dev/null || \ + { [ -z "$$mode" ] && ln $$1 $$2 2> /dev/null; } || \ cp -p $$1 $$2; } # a staging conflict should cause an error Modified: head/contrib/bmake/mk/sys.dependfile.mk ============================================================================== --- head/contrib/bmake/mk/sys.dependfile.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/mk/sys.dependfile.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -# $Id: sys.dependfile.mk,v 1.7 2016/02/20 01:57:39 sjg Exp $ +# $Id: sys.dependfile.mk,v 1.8 2016/03/11 01:34:13 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -48,7 +48,7 @@ _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@$ # MACHINE specific depend files are supported, but *not* default. # If any already exist, we should follow suit. _aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE} -# MACHINE must be the last entry in _aml ;-) +# make sure we restore MACHINE _m := ${MACHINE} _e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@} MACHINE := ${_m} Modified: head/contrib/bmake/parse.c ============================================================================== --- head/contrib/bmake/parse.c Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/parse.c Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -/* $NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $ */ +/* $NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"; +static char rcsid[] = "$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: parse.c,v 1.212 2016/02/19 06:19:06 sjg Exp $"); +__RCSID("$NetBSD: parse.c,v 1.213 2016/03/11 13:54:47 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -1261,6 +1261,7 @@ ParseDoDependency(char *line) goto out; } else { /* Done with this word; on to the next. */ + cp = line; continue; } } Modified: head/contrib/bmake/suff.c ============================================================================== --- head/contrib/bmake/suff.c Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/suff.c Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -/* $NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $ */ +/* $NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"; +static char rcsid[] = "$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94"; #else -__RCSID("$NetBSD: suff.c,v 1.78 2016/02/18 18:29:14 christos Exp $"); +__RCSID("$NetBSD: suff.c,v 1.81 2016/03/15 18:30:14 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -1894,6 +1894,7 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) TARGET, /* Must be first */ PREFIX, /* Must be second */ }; + LstNode ln, nln; /* Next suffix node to check */ int i; /* Index into copy and vals */ Suff *ms; /* Suffix descriptor for member */ char *name; /* Start of member's name */ @@ -1955,6 +1956,20 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) Var_Set(MEMBER, name, gn, 0); Var_Set(ARCHIVE, gn->name, gn, 0); + /* + * Set $@ for compatibility with other makes + */ + Var_Set(TARGET, gn->name, gn, 0); + + /* + * Now we've got the important local variables set, expand any sources + * that still contain variables or wildcards in their names. + */ + for (ln = Lst_First(gn->children); ln != NULL; ln = nln) { + nln = Lst_Succ(ln); + SuffExpandChildren(ln, gn); + } + if (ms != NULL) { /* * Member has a known suffix, so look for a transformation rule from @@ -1962,7 +1977,6 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) * through the entire list, we just look at suffixes to which the * member's suffix may be transformed... */ - LstNode ln; SuffixCmpData sd; /* Search string data */ /* @@ -2002,9 +2016,10 @@ SuffFindArchiveDeps(GNode *gn, Lst slst) /* * Flag the member as such so we remember to look in the archive for - * its modification time. + * its modification time. The OP_JOIN | OP_MADE is needed because this + * target should never get made. */ - mem->type |= OP_MEMBER; + mem->type |= OP_MEMBER | OP_JOIN | OP_MADE; } /*- Modified: head/contrib/bmake/var.c ============================================================================== --- head/contrib/bmake/var.c Fri Mar 18 19:48:49 2016 (r297039) +++ head/contrib/bmake/var.c Fri Mar 18 20:03:09 2016 (r297040) @@ -1,4 +1,4 @@ -/* $NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $ */ +/* $NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,14 +69,14 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"; +static char rcsid[] = "$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"; #else #include #ifndef lint #if 0 static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: var.c,v 1.206 2016/03/07 20:20:35 sjg Exp $"); +__RCSID("$NetBSD: var.c,v 1.207 2016/03/11 15:12:39 matthias Exp $"); #endif #endif /* not lint */ #endif @@ -3699,11 +3699,11 @@ Var_Parse(const char *str, GNode *ctxt, case '@': return UNCONST("$(.TARGET)"); case '%': - return UNCONST("$(.ARCHIVE)"); + return UNCONST("$(.MEMBER)"); case '*': return UNCONST("$(.PREFIX)"); case '!': - return UNCONST("$(.MEMBER)"); + return UNCONST("$(.ARCHIVE)"); } } /* Modified: head/share/mk/dirdeps.mk ============================================================================== --- head/share/mk/dirdeps.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/share/mk/dirdeps.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: dirdeps.mk,v 1.59 2016/02/26 23:32:29 sjg Exp $ +# $Id: dirdeps.mk,v 1.62 2016/03/16 00:11:53 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -136,7 +136,6 @@ start_utc := ${now_utc} # make sure these are empty to start with _DEP_TARGET_SPEC = -_DIRDEP_CHECKED = # If TARGET_SPEC_VARS is other than just MACHINE # it should be set by sys.mk or similar by now. @@ -226,7 +225,7 @@ _DEP_TARGET_SPEC = ${_last_dependfile:${ .endif .if !empty(_last_dependfile) # record that we've read dependfile for this -_DIRDEP_CHECKED += ${_CURDIR}.${TARGET_SPEC} +_dirdeps_checked.${_CURDIR}.${TARGET_SPEC}: .endif .endif @@ -307,8 +306,10 @@ DEP_SKIP_DIR = ${SKIP_DIR} \ NSkipDir = ${DEP_SKIP_DIR:${M_ListToSkip}} .if defined(NO_DIRDEPS) || defined(NODIRDEPS) || defined(WITHOUT_DIRDEPS) -# confine ourselves to the original dir +# confine ourselves to the original dir and below. DIRDEPS_FILTER += M${_DEP_RELDIR}* +.elif defined(NO_DIRDEPS_BELOW) +DIRDEPS_FILTER += M${_DEP_RELDIR} .endif # this is what we run below @@ -598,9 +599,9 @@ ${_this_dir}.$m: ${_build_dirs:M*.$m:N${ # Now find more dependencies - and recurse. .for d in ${_build_all_dirs} -.if ${_DIRDEP_CHECKED:M$d} == "" +.if !target(_dirdeps_checked.$d) # once only -_DIRDEP_CHECKED += $d +_dirdeps_checked.$d: .if ${_debug_search} .info checking $d .endif Modified: head/share/mk/meta.stage.mk ============================================================================== --- head/share/mk/meta.stage.mk Fri Mar 18 19:48:49 2016 (r297039) +++ head/share/mk/meta.stage.mk Fri Mar 18 20:03:09 2016 (r297040) @@ -1,5 +1,5 @@ # $FreeBSD$ -# $Id: meta.stage.mk,v 1.43 2016/02/24 18:46:32 sjg Exp $ +# $Id: meta.stage.mk,v 1.44 2016/03/16 18:21:23 sjg Exp $ # # @(#) Copyright (c) 2011, Simon J. Gerraty # @@ -59,7 +59,7 @@ GENDIRDEPS_FILTER += Nnot-empty-is-impor LN_CP_SCRIPT = LnCp() { \ rm -f $$2 2> /dev/null; \ - ln $$1 $$2 2> /dev/null || \ + { [ -z "$$mode" ] && ln $$1 $$2 2> /dev/null; } || \ cp -p $$1 $$2; } # a staging conflict should cause an error Modified: head/usr.bin/bmake/Makefile ============================================================================== --- head/usr.bin/bmake/Makefile Fri Mar 18 19:48:49 2016 (r297039) +++ head/usr.bin/bmake/Makefile Fri Mar 18 20:03:09 2016 (r297040) @@ -14,10 +14,10 @@ CFLAGS+= -I${.CURDIR} CLEANDIRS+= FreeBSD CLEANFILES+= bootstrap -# $Id: Makefile,v 1.55 2016/03/07 22:02:47 sjg Exp $ +# $Id: Makefile,v 1.58 2016/03/15 23:39:12 sjg Exp $ # Base version on src date -_MAKE_VERSION= 20160307 +_MAKE_VERSION= 20160315 PROG?= ${.CURDIR:T} From owner-svn-src-head@freebsd.org Fri Mar 18 20:04:36 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F840AD5B91; Fri, 18 Mar 2016 20:04:36 +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 EC55F12BF; Fri, 18 Mar 2016 20:04:35 +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 u2IK4ZgK069768; Fri, 18 Mar 2016 20:04:35 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IK4Zki069767; Fri, 18 Mar 2016 20:04:35 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603182004.u2IK4Zki069767@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 18 Mar 2016 20:04:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297041 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 20:04:36 -0000 Author: loos Date: Fri Mar 18 20:04:34 2016 New Revision: 297041 URL: https://svnweb.freebsd.org/changeset/base/297041 Log: Set the destination port in all TX segments. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:03:09 2016 (r297040) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:04:34 2016 (r297041) @@ -1730,8 +1730,13 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) struct cpsw_slot *slot, *prev_slot = NULL; struct cpsw_slot *last_old_slot, *first_new_slot; struct mbuf *m0; - int error, nsegs, seg, added = 0, padlen; + int error, flags, nsegs, seg, added = 0, padlen; + flags = 0; + if (sc->swsc->dualemac) { + flags = CPDMA_BD_TO_PORT | + ((sc->unit + 1) & CPDMA_BD_PORT_MASK); + } /* Pull pending packets from IF queue and prep them for DMA. */ while ((slot = STAILQ_FIRST(&sc->swsc->tx.avail)) != NULL) { IF_DEQUEUE(&sc->ifp->if_snd, m0); @@ -1793,11 +1798,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = segs[0].ds_len; bd.pktlen = m_length(slot->mbuf, NULL) + padlen; - bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER; - if (sc->swsc->dualemac) { - bd.flags |= CPDMA_BD_TO_PORT | - ((sc->unit + 1) & CPDMA_BD_PORT_MASK); - } + bd.flags = CPDMA_BD_SOP | CPDMA_BD_OWNER | flags; for (seg = 1; seg < nsegs; ++seg) { /* Save the previous buffer (which isn't EOP) */ cpsw_cpdma_write_bd(sc->swsc, slot, &bd); @@ -1818,7 +1819,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = segs[seg].ds_len; bd.pktlen = 0; - bd.flags = CPDMA_BD_OWNER; + bd.flags = CPDMA_BD_OWNER | flags; } /* Save the final buffer. */ if (padlen <= 0) @@ -1847,7 +1848,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) bd.bufoff = 0; bd.buflen = padlen; bd.pktlen = 0; - bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER; + bd.flags = CPDMA_BD_EOP | CPDMA_BD_OWNER | flags; cpsw_cpdma_write_bd(sc->swsc, slot, &bd); ++nsegs; } From owner-svn-src-head@freebsd.org Fri Mar 18 20:09:55 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B081EAD5CEA; Fri, 18 Mar 2016 20:09:55 +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 827321518; Fri, 18 Mar 2016 20:09:55 +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 u2IK9sOH069975; Fri, 18 Mar 2016 20:09:54 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IK9s2v069974; Fri, 18 Mar 2016 20:09:54 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603182009.u2IK9s2v069974@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 18 Mar 2016 20:09:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297042 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 20:09:55 -0000 Author: loos Date: Fri Mar 18 20:09:54 2016 New Revision: 297042 URL: https://svnweb.freebsd.org/changeset/base/297042 Log: Increase the arbitrary limit of TX segments. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:04:34 2016 (r297041) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:09:54 2016 (r297042) @@ -153,7 +153,7 @@ static int cpsw_stats_sysctl(SYSCTL_HAND * Packets with more segments than this will be defragmented before * they are queued. */ -#define CPSW_TXFRAGS 8 +#define CPSW_TXFRAGS 16 /* Shared resources. */ static device_method_t cpsw_methods[] = { From owner-svn-src-head@freebsd.org Fri Mar 18 20:24:32 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C287AAD53CC; Fri, 18 Mar 2016 20:24:32 +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 7A9E11F2B; Fri, 18 Mar 2016 20:24:32 +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 u2IKOVBb075713; Fri, 18 Mar 2016 20:24:31 GMT (envelope-from loos@FreeBSD.org) Received: (from loos@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2IKOVfd075710; Fri, 18 Mar 2016 20:24:31 GMT (envelope-from loos@FreeBSD.org) Message-Id: <201603182024.u2IKOVfd075710@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: loos set sender to loos@FreeBSD.org using -f From: Luiz Otavio O Souza Date: Fri, 18 Mar 2016 20:24:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297043 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 20:24:32 -0000 Author: loos Date: Fri Mar 18 20:24:31 2016 New Revision: 297043 URL: https://svnweb.freebsd.org/changeset/base/297043 Log: Count the input and output packets. Sponsored by: Rubicon Communications (Netgate) Modified: head/sys/arm/ti/cpsw/if_cpsw.c head/sys/arm/ti/cpsw/if_cpswvar.h Modified: head/sys/arm/ti/cpsw/if_cpsw.c ============================================================================== --- head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:09:54 2016 (r297042) +++ head/sys/arm/ti/cpsw/if_cpsw.c Fri Mar 18 20:24:31 2016 (r297043) @@ -1196,6 +1196,7 @@ cpsw_rx_teardown_locked(struct cpsw_soft received->m_nextpkt = NULL; ifp = received->m_pkthdr.rcvif; (*ifp->if_input)(ifp, received); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); received = next; } CPSW_GLOBAL_LOCK(sc); @@ -1536,6 +1537,7 @@ cpsw_intr_rx(void *arg) received->m_nextpkt = NULL; ifp = received->m_pkthdr.rcvif; (*ifp->if_input)(ifp, received); + if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1); received = next; } } @@ -1789,6 +1791,7 @@ cpswp_tx_enqueue(struct cpswp_softc *sc) ("Queueing TX packet: %d segments + %d pad bytes", nsegs, padlen)); + slot->ifp = sc->ifp; /* If there is only one segment, the for() loop * gets skipped and the single buffer gets set up * as both SOP and EOP. */ @@ -1913,6 +1916,8 @@ cpsw_tx_dequeue(struct cpsw_softc *sc) bus_dmamap_unload(sc->mbuf_dtag, slot->dmamap); m_freem(slot->mbuf); slot->mbuf = NULL; + if (slot->ifp) + if_inc_counter(slot->ifp, IFCOUNTER_OPACKETS, 1); /* Dequeue any additional buffers used by this packet. */ while (slot != NULL && slot->mbuf == NULL) { Modified: head/sys/arm/ti/cpsw/if_cpswvar.h ============================================================================== --- head/sys/arm/ti/cpsw/if_cpswvar.h Fri Mar 18 20:09:54 2016 (r297042) +++ head/sys/arm/ti/cpsw/if_cpswvar.h Fri Mar 18 20:24:31 2016 (r297043) @@ -43,6 +43,7 @@ struct cpsw_slot { uint32_t bd_offset; /* Offset of corresponding BD within CPPI RAM. */ bus_dmamap_t dmamap; + struct ifnet *ifp; struct mbuf *mbuf; STAILQ_ENTRY(cpsw_slot) next; }; From owner-svn-src-head@freebsd.org Fri Mar 18 23:55:26 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D310BAD59C6; Fri, 18 Mar 2016 23:55:26 +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 A5BBC111A; Fri, 18 Mar 2016 23:55:26 +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 u2INtP1K039125; Fri, 18 Mar 2016 23:55:25 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2INtPfi039124; Fri, 18 Mar 2016 23:55:25 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201603182355.u2INtPfi039124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 18 Mar 2016 23:55:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297047 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 23:55:26 -0000 Author: bz Date: Fri Mar 18 23:55:25 2016 New Revision: 297047 URL: https://svnweb.freebsd.org/changeset/base/297047 Log: Allow pci_host_generic to be compiled into ARM kernels, used, e.g., in simulators. Sponsored by: DARPA/AFRL Modified: head/sys/conf/files.arm Modified: head/sys/conf/files.arm ============================================================================== --- head/sys/conf/files.arm Fri Mar 18 22:52:11 2016 (r297046) +++ head/sys/conf/files.arm Fri Mar 18 23:55:25 2016 (r297047) @@ -103,6 +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/psci/psci.c optional psci dev/psci/psci_arm.S optional psci dev/syscons/scgfbrndr.c optional sc From owner-svn-src-head@freebsd.org Sat Mar 19 03:22:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DBF2AD4429; Sat, 19 Mar 2016 03:22:22 +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 EA7F6EC4; Sat, 19 Mar 2016 03:22:21 +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 u2J3MGFR046974 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 19 Mar 2016 05:22:17 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2J3MGFR046974 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2J3MG1D046973; Sat, 19 Mar 2016 05:22:16 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 19 Mar 2016 05:22:16 +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: <20160319032216.GZ1741@kib.kiev.ua> References: <201603181948.u2IJmndg063765@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603181948.u2IJmndg063765@repo.freebsd.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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 03:22:22 -0000 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. From owner-svn-src-head@freebsd.org Sat Mar 19 04:37:35 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F19F8AD5E6E; Sat, 19 Mar 2016 04:37:34 +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 BF556FFD; Sat, 19 Mar 2016 04:37:34 +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 u2J4bXjg023913; Sat, 19 Mar 2016 04:37:33 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2J4bX6K023912; Sat, 19 Mar 2016 04:37:33 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201603190437.u2J4bX6K023912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sat, 19 Mar 2016 04:37:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297048 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 04:37:35 -0000 Author: adrian Date: Sat Mar 19 04:37:33 2016 New Revision: 297048 URL: https://svnweb.freebsd.org/changeset/base/297048 Log: [net80211] Add VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164 This .. seems inconsistently transmitted from various vendors. Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Fri Mar 18 23:55:25 2016 (r297047) +++ head/sys/net80211/ieee80211.h Sat Mar 19 04:37:33 2016 (r297048) @@ -803,6 +803,39 @@ struct ieee80211_ie_vht_operation { #define IEEE80211_VHTCAP_RX_ANTENNA_PATTERN 0x10000000 #define IEEE80211_VHTCAP_TX_ANTENNA_PATTERN 0x20000000 +/* + * VHT Transmit Power Envelope element - 802.11ac-2013 8.4.2.164 + * + * This defines the maximum transmit power for various bandwidths. + */ +/* + * Count is how many elements follow and what they're for: + * + * 0 - 20 MHz + * 1 - 20+40 MHz + * 2 - 20+40+80 MHz + * 3 - 20+40+80+(160, 80+80) MHz + */ +#define IEEE80211_VHT_TXPWRENV_INFO_COUNT_SHIFT 0 +#define IEEE80211_VHT_TXPWRENV_INFO_COUNT_MASK 0x07 + +/* + * Unit is the tx power representation. It should be EIRP for now; + * other values are reserved. + */ +#define IEEE80211_VHT_TXPWRENV_UNIT_MASK 0x38 +#define IEEE80211_VHT_TXPWRENV_UNIT_SHIFT 3 + +/* This value is within the unit mask/shift above */ +#define IEEE80211_VHT_TXPWRENV_UNIT_EIRP 0 + +struct ieee80211_ie_vht_txpwrenv { + uint8_t ie; + uint8_t len; + uint8_t tx_info; + int8_t tx_elem[0]; /* TX power elements, 1/2 dB, signed */ +}; + /* VHT action codes */ #define WLAN_ACTION_VHT_COMPRESSED_BF 0 #define WLAN_ACTION_VHT_GROUPID_MGMT 1 From owner-svn-src-head@freebsd.org Sat Mar 19 09:20:19 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D49EAD5588; Sat, 19 Mar 2016 09:20:19 +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 5DF1CB23; Sat, 19 Mar 2016 09:20:19 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2J9KIWR008109; Sat, 19 Mar 2016 09:20:18 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2J9KIu0008107; Sat, 19 Mar 2016 09:20:18 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603190920.u2J9KIu0008107@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 19 Mar 2016 09:20:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297049 - 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-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 09:20:19 -0000 Author: mav Date: Sat Mar 19 09:20:18 2016 New Revision: 297049 URL: https://svnweb.freebsd.org/changeset/base/297049 Log: Add IDs for Intel Wellsburg USB controllers. MFC after: 1 week Modified: head/sys/dev/usb/controller/ehci_pci.c head/sys/dev/usb/controller/xhci_pci.c Modified: head/sys/dev/usb/controller/ehci_pci.c ============================================================================== --- head/sys/dev/usb/controller/ehci_pci.c Sat Mar 19 04:37:33 2016 (r297048) +++ head/sys/dev/usb/controller/ehci_pci.c Sat Mar 19 09:20:18 2016 (r297049) @@ -168,6 +168,10 @@ ehci_pci_match(device_t self) return ("Intel Wildcat Point USB 2.0 controller USB-A"); case 0x8cad8086: return ("Intel Wildcat Point USB 2.0 controller USB-B"); + case 0x8d268086: + return ("Intel Wellsburg USB 2.0 controller"); + case 0x8d2d8086: + return ("Intel Wellsburg USB 2.0 controller"); case 0x9c268086: return ("Intel Lynx Point LP USB 2.0 controller USB"); Modified: head/sys/dev/usb/controller/xhci_pci.c ============================================================================== --- head/sys/dev/usb/controller/xhci_pci.c Sat Mar 19 04:37:33 2016 (r297048) +++ head/sys/dev/usb/controller/xhci_pci.c Sat Mar 19 09:20:18 2016 (r297049) @@ -115,6 +115,8 @@ xhci_pci_match(device_t self) return ("Intel Lynx Point USB 3.0 controller"); case 0x8cb18086: return ("Intel Wildcat Point USB 3.0 controller"); + case 0x8d318086: + return ("Intel Wellsburg USB 3.0 controller"); case 0x9cb18086: return ("Broadwell Integrated PCH-LP chipset USB 3.0 controller"); From owner-svn-src-head@freebsd.org Sat Mar 19 11:48:07 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A841AD32E0; Sat, 19 Mar 2016 11:48:07 +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 1B261801; Sat, 19 Mar 2016 11:48:07 +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 u2JBm6JN054037; Sat, 19 Mar 2016 11:48:06 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2JBm6wt054036; Sat, 19 Mar 2016 11:48:06 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201603191148.u2JBm6wt054036@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Sat, 19 Mar 2016 11:48:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297051 - head/sys/rpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 11:48:07 -0000 Author: mav Date: Sat Mar 19 11:48:06 2016 New Revision: 297051 URL: https://svnweb.freebsd.org/changeset/base/297051 Log: Fix incorrect (fortunately bigger) malloc size. Submitted by: pfg MFC after: 1 week Modified: head/sys/rpc/svc.c Modified: head/sys/rpc/svc.c ============================================================================== --- head/sys/rpc/svc.c Sat Mar 19 11:35:53 2016 (r297050) +++ head/sys/rpc/svc.c Sat Mar 19 11:48:06 2016 (r297051) @@ -560,7 +560,7 @@ svc_loss_reg(SVCXPRT *xprt, void (*dispa mtx_unlock(&pool->sp_lock); return (TRUE); } - s = malloc(sizeof (struct svc_callout), M_RPC, M_NOWAIT); + s = malloc(sizeof(struct svc_loss_callout), M_RPC, M_NOWAIT); if (s == NULL) { mtx_unlock(&pool->sp_lock); return (FALSE); From owner-svn-src-head@freebsd.org Sat Mar 19 11:55:22 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E27AD36E8; Sat, 19 Mar 2016 11:55:22 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 79984D17; Sat, 19 Mar 2016 11:55:22 +0000 (UTC) (envelope-from grembo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u2JBtL8A056910; Sat, 19 Mar 2016 11:55:21 GMT (envelope-from grembo@FreeBSD.org) Received: (from grembo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u2JBtL6q056907; Sat, 19 Mar 2016 11:55:21 GMT (envelope-from grembo@FreeBSD.org) Message-Id: <201603191155.u2JBtL6q056907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grembo set sender to grembo@FreeBSD.org using -f From: Michael Gmelin Date: Sat, 19 Mar 2016 11:55:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297052 - in head: lib/libfetch usr.bin/fetch X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2016 11:55:22 -0000 Author: grembo (ports committer) Date: Sat Mar 19 11:55:21 2016 New Revision: 297052 URL: https://svnweb.freebsd.org/changeset/base/297052 Log: Update fetch.1 and fetch.3 to reflect libfetch's actual use of CA bundles Reviewed by: wblock Approved by: wblock MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5558 Modified: head/lib/libfetch/fetch.3 head/usr.bin/fetch/fetch.1 Modified: head/lib/libfetch/fetch.3 ============================================================================== --- head/lib/libfetch/fetch.3 Sat Mar 19 11:48:06 2016 (r297051) +++ head/lib/libfetch/fetch.3 Sat Mar 19 11:55:21 2016 (r297052) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 1998-2013 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2015 +.Dd March 18, 2016 .Dt FETCH 3 .Os .Sh NAME @@ -396,8 +396,15 @@ is currently unimplemented. .Sh HTTPS SCHEME Based on HTTP SCHEME. By default the peer is verified using the CA bundle located in -.Pa /etc/ssl/cert.pem . -The file may contain multiple CA certificates. +.Pa /usr/local/etc/ssl/cert.pem . +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists, and +.Ev SSL_CA_CERT_PATH +has not been set, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. A common source of a current CA bundle is .Pa \%security/ca_root_nss . .Pp @@ -428,10 +435,11 @@ Client certificate based authentication The environment variable .Ev SSL_CLIENT_CERT_FILE should be set to point to a file containing key and client certificate -to be used in PEM format. In case the key is stored in a separate -file, the environment variable +to be used in PEM format. +When a PEM-format key is in a separate file from the client certificate, +the environment variable .Ev SSL_CLIENT_KEY_FILE -can be set to point to the key in PEM format. +can be set to point to the key file. In case the key uses a password, the user will be prompted on standard input (see .Xr PEM 3 ) . @@ -531,7 +539,7 @@ Invalid URL .El .Pp The accompanying error message includes a protocol-specific error code -and message, e.g.\& "File is not available (404 Not Found)" +and message, like "File is not available (404 Not Found)" .Sh ENVIRONMENT .Bl -tag -width ".Ev FETCH_BIND_ADDRESS" .It Ev FETCH_BIND_ADDRESS @@ -648,8 +656,7 @@ for compatibility. Allow SSL version 3 when negotiating the connection (not recommended). .It Ev SSL_CA_CERT_FILE CA certificate bundle containing trusted CA certificates. -Default value: -.Pa /etc/ssl/cert.pem . +Default value: See HTTPS SCHEME above. .It Ev SSL_CA_CERT_PATH Path containing trusted CA hashes. .It Ev SSL_CLIENT_CERT_FILE Modified: head/usr.bin/fetch/fetch.1 ============================================================================== --- head/usr.bin/fetch/fetch.1 Sat Mar 19 11:48:06 2016 (r297051) +++ head/usr.bin/fetch/fetch.1 Sat Mar 19 11:55:21 2016 (r297052) @@ -1,6 +1,6 @@ .\"- .\" Copyright (c) 2000-2014 Dag-Erling Smørgrav -.\" Copyright (c) 2013 Michael Gmelin +.\" Copyright (c) 2013-2016 Michael Gmelin .\" All rights reserved. .\" Portions Copyright (c) 1999 Massachusetts Institute of Technology; used .\" by permission. @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 25, 2015 +.Dd March 18, 2016 .Dt FETCH 1 .Os .Sh NAME @@ -134,11 +134,17 @@ only. [SSL] Path to certificate bundle containing trusted CA certificates. If not specified, -.Pa /etc/ssl/cert.pem +.Pa /usr/local/etc/ssl/cert.pem is used. -The file may contain multiple CA certificates. The port +If this file does not exist, +.Pa /etc/ssl/cert.pem +is used instead. +If neither file exists and no CA path has been configured, +OpenSSL's default CA cert and path settings apply. +The certificate bundle can contain multiple CA certificates. +The .Pa security/ca_root_nss -is a common source of a current CA bundle. +port is a common source of a current CA bundle. .It Fl -ca-path= Ns Ar dir [SSL] The directory @@ -218,10 +224,16 @@ altogether, or a comma- or whitespace-se which proxies should not be used. .It Fl -no-sslv3 [SSL] -Don't allow SSL version 3 when negotiating the connection. +Do not allow SSL version 3 when negotiating the connection. +This option is deprecated and is provided for backward compatibility +only. +SSLv3 is disabled by default. +Set +.Ev SSL_ALLOW_SSL3 +to change this behavior. .It Fl -no-tlsv1 [SSL] -Don't allow TLS version 1 when negotiating the connection. +Do not allow TLS version 1 when negotiating the connection. .It Fl -no-verify-hostname [SSL] Do not verify that the hostname matches the subject of the @@ -351,8 +363,10 @@ for a description of additional environm .Ev SSL_CLIENT_CERT_FILE , .Ev SSL_CLIENT_KEY_FILE , .Ev SSL_CRL_FILE , -.Ev SSL_NO_SSL3 , +.Ev SSL_ALLOW_SSL3 , .Ev SSL_NO_TLS1 , +.Ev SSL_NO_TLS1_1 , +.Ev SSL_NO_TLS1_2 , .Ev SSL_NO_VERIFY_HOSTNAME and .Ev SSL_NO_VERIFY_PEER .