From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 02:15:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3FC48106566B; Sun, 23 Jan 2011 02:15:51 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2425E8FC13; Sun, 23 Jan 2011 02:15:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0N2Fpjv035914; Sun, 23 Jan 2011 02:15:51 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0N2Fp2C035911; Sun, 23 Jan 2011 02:15:51 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101230215.p0N2Fp2C035911@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 23 Jan 2011 02:15:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217740 - stable/8/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 02:15:51 -0000 Author: yongari Date: Sun Jan 23 02:15:50 2011 New Revision: 217740 URL: http://svn.freebsd.org/changeset/base/217740 Log: MFC r217649: Correct wrong definition of PM timer mask and adjust L1/PM timer value. While I'm here enable all clocks before initializing controller. This change should fix lockup issue seen on AR8152 v1.1 PCIe Fast Ethernet controller. PR: kern/154076 Modified: stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/alc/if_alcreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Sat Jan 22 23:44:56 2011 (r217739) +++ stable/8/sys/dev/alc/if_alc.c Sun Jan 23 02:15:50 2011 (r217740) @@ -678,7 +678,7 @@ alc_aspm(struct alc_softc *sc, int media pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; pmcfg &= ~(PM_CFG_L1_ENTRY_TIMER_MASK | PM_CFG_LCKDET_TIMER_MASK); pmcfg |= PM_CFG_MAC_ASPM_CHK; - pmcfg |= PM_CFG_SERDES_ENB | PM_CFG_RBER_ENB; + pmcfg |= (PM_CFG_LCKDET_TIMER_DEFAULT << PM_CFG_LCKDET_TIMER_SHIFT); pmcfg &= ~(PM_CFG_ASPM_L1_ENB | PM_CFG_ASPM_L0S_ENB); if ((sc->alc_flags & ALC_FLAG_APS) != 0) { @@ -3150,6 +3150,9 @@ alc_init_locked(struct alc_softc *sc) alc_init_cmb(sc); alc_init_smb(sc); + /* Enable all clocks. */ + CSR_WRITE_4(sc, ALC_CLK_GATING_CFG, 0); + /* Reprogram the station address. */ bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); CSR_WRITE_4(sc, ALC_PAR0, Modified: stable/8/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/8/sys/dev/alc/if_alcreg.h Sat Jan 22 23:44:56 2011 (r217739) +++ stable/8/sys/dev/alc/if_alcreg.h Sun Jan 23 02:15:50 2011 (r217740) @@ -109,7 +109,7 @@ #define PM_CFG_PCIE_RECV 0x00008000 #define PM_CFG_L1_ENTRY_TIMER_MASK 0x000F0000 #define PM_CFG_PM_REQ_TIMER_MASK 0x00F00000 -#define PM_CFG_LCKDET_TIMER_MASK 0x3F000000 +#define PM_CFG_LCKDET_TIMER_MASK 0x0F000000 #define PM_CFG_EN_BUFS_RX_L0S 0x10000000 #define PM_CFG_SA_DLY_ENB 0x20000000 #define PM_CFG_MAC_ASPM_CHK 0x40000000 @@ -120,8 +120,9 @@ #define PM_CFG_LCKDET_TIMER_SHIFT 24 #define PM_CFG_L0S_ENTRY_TIMER_DEFAULT 6 -#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 12 -#define PM_CFG_PM_REQ_TIMER_DEFAULT 1 +#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 1 +#define PM_CFG_LCKDET_TIMER_DEFAULT 12 +#define PM_CFG_PM_REQ_TIMER_DEFAULT 12 #define ALC_LTSSM_ID_CFG 0x12FC #define LTSSM_ID_WRO_ENB 0x00001000 @@ -724,6 +725,14 @@ #define ALC_TX_MIB_BASE 0x1760 +#define ALC_CLK_GATING_CFG 0x1814 +#define CLK_GATING_DMAW_ENB 0x0001 +#define CLK_GATING_DMAR_ENB 0x0002 +#define CLK_GATING_TXQ_ENB 0x0004 +#define CLK_GATING_RXQ_ENB 0x0008 +#define CLK_GATING_TXMAC_ENB 0x0010 +#define CLK_GATING_RXMAC_ENB 0x0020 + #define ALC_DEBUG_DATA0 0x1900 #define ALC_DEBUG_DATA1 0x1904 From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 02:18:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3AD3106564A; Sun, 23 Jan 2011 02:18:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A82F48FC12; Sun, 23 Jan 2011 02:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0N2II44036513; Sun, 23 Jan 2011 02:18:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0N2IIV7036510; Sun, 23 Jan 2011 02:18:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101230218.p0N2IIV7036510@svn.freebsd.org> From: Pyun YongHyeon Date: Sun, 23 Jan 2011 02:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217741 - stable/7/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 02:18:19 -0000 Author: yongari Date: Sun Jan 23 02:18:18 2011 New Revision: 217741 URL: http://svn.freebsd.org/changeset/base/217741 Log: MFC r217649: Correct wrong definition of PM timer mask and adjust L1/PM timer value. While I'm here enable all clocks before initializing controller. This change should fix lockup issue seen on AR8152 v1.1 PCIe Fast Ethernet controller. PR: kern/154076 Modified: stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/alc/if_alcreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Sun Jan 23 02:15:50 2011 (r217740) +++ stable/7/sys/dev/alc/if_alc.c Sun Jan 23 02:18:18 2011 (r217741) @@ -678,7 +678,7 @@ alc_aspm(struct alc_softc *sc, int media pmcfg &= ~PM_CFG_SERDES_PD_EX_L1; pmcfg &= ~(PM_CFG_L1_ENTRY_TIMER_MASK | PM_CFG_LCKDET_TIMER_MASK); pmcfg |= PM_CFG_MAC_ASPM_CHK; - pmcfg |= PM_CFG_SERDES_ENB | PM_CFG_RBER_ENB; + pmcfg |= (PM_CFG_LCKDET_TIMER_DEFAULT << PM_CFG_LCKDET_TIMER_SHIFT); pmcfg &= ~(PM_CFG_ASPM_L1_ENB | PM_CFG_ASPM_L0S_ENB); if ((sc->alc_flags & ALC_FLAG_APS) != 0) { @@ -3150,6 +3150,9 @@ alc_init_locked(struct alc_softc *sc) alc_init_cmb(sc); alc_init_smb(sc); + /* Enable all clocks. */ + CSR_WRITE_4(sc, ALC_CLK_GATING_CFG, 0); + /* Reprogram the station address. */ bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); CSR_WRITE_4(sc, ALC_PAR0, Modified: stable/7/sys/dev/alc/if_alcreg.h ============================================================================== --- stable/7/sys/dev/alc/if_alcreg.h Sun Jan 23 02:15:50 2011 (r217740) +++ stable/7/sys/dev/alc/if_alcreg.h Sun Jan 23 02:18:18 2011 (r217741) @@ -109,7 +109,7 @@ #define PM_CFG_PCIE_RECV 0x00008000 #define PM_CFG_L1_ENTRY_TIMER_MASK 0x000F0000 #define PM_CFG_PM_REQ_TIMER_MASK 0x00F00000 -#define PM_CFG_LCKDET_TIMER_MASK 0x3F000000 +#define PM_CFG_LCKDET_TIMER_MASK 0x0F000000 #define PM_CFG_EN_BUFS_RX_L0S 0x10000000 #define PM_CFG_SA_DLY_ENB 0x20000000 #define PM_CFG_MAC_ASPM_CHK 0x40000000 @@ -120,8 +120,9 @@ #define PM_CFG_LCKDET_TIMER_SHIFT 24 #define PM_CFG_L0S_ENTRY_TIMER_DEFAULT 6 -#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 12 -#define PM_CFG_PM_REQ_TIMER_DEFAULT 1 +#define PM_CFG_L1_ENTRY_TIMER_DEFAULT 1 +#define PM_CFG_LCKDET_TIMER_DEFAULT 12 +#define PM_CFG_PM_REQ_TIMER_DEFAULT 12 #define ALC_LTSSM_ID_CFG 0x12FC #define LTSSM_ID_WRO_ENB 0x00001000 @@ -724,6 +725,14 @@ #define ALC_TX_MIB_BASE 0x1760 +#define ALC_CLK_GATING_CFG 0x1814 +#define CLK_GATING_DMAW_ENB 0x0001 +#define CLK_GATING_DMAR_ENB 0x0002 +#define CLK_GATING_TXQ_ENB 0x0004 +#define CLK_GATING_RXQ_ENB 0x0008 +#define CLK_GATING_TXMAC_ENB 0x0010 +#define CLK_GATING_RXMAC_ENB 0x0020 + #define ALC_DEBUG_DATA0 0x1900 #define ALC_DEBUG_DATA1 0x1904 From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 03:39:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7FA8106566B; Sun, 23 Jan 2011 03:39:02 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id BBEE08FC16; Sun, 23 Jan 2011 03:39:01 +0000 (UTC) Received: by wyf19 with SMTP id 19so3097033wyf.13 for ; Sat, 22 Jan 2011 19:39:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=qmZpm3IDwB9dTfBy7YiLAvm0B971vQ8u82OR9ol+auQ=; b=VB00DRHZfQp6qKRehIaj2gxE5RPYv/eWsDuzFSVzKoEnGGkr8lYXTiilNV/1HfU3o+ I415rLiXfE8BfvIw4koVDfsk2Ue0PW3KKARFymWRVqQ3JTKYpGszI1ow6drur0BzQpB8 KpSmHkvfAaq31Z4FXtf62Eph0vHblCTWPyYrk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=BPFAJWb/snB4jU7hFi/eysymu1thGNrU8Kfd6JT3LD805UyO4ncP/gvTvFjdT74Axm 1ZcwJpy6Guv9pLA3TKr6W1j32U3jGiGoEt8trD/qKxHLY8oKvr5LQtSaTx7CwZFI2Q5F +aoeBUlrYvoPyFNAsqBlBq15+Ur0nTInilQTA= MIME-Version: 1.0 Received: by 10.216.191.215 with SMTP id g65mr1005952wen.16.1295753940058; Sat, 22 Jan 2011 19:39:00 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Sat, 22 Jan 2011 19:39:00 -0800 (PST) In-Reply-To: <201101222257.p0MMvSZY007310@svn.freebsd.org> References: <201101222257.p0MMvSZY007310@svn.freebsd.org> Date: Sat, 22 Jan 2011 19:39:00 -0800 X-Google-Sender-Auth: G500Ne3HL8DyhERSZjz5yGDOUD8 Message-ID: From: Garrett Cooper To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217733 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 03:39:02 -0000 On Sat, Jan 22, 2011 at 2:57 PM, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Jan 22 22:57:28 2011 > New Revision: 217733 > URL: http://svn.freebsd.org/changeset/base/217733 > > Log: > =A0Properly document what the top-level `make tinderbox` does. > > =A0Reviewed by: =A0jmallett > =A0MFC After: =A0 =A03 days > =A0X-MFC: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0build.7 only As much as I like make universe and tinderbox, for the purpose of development testing would it make sense if there was a tinderbox target that actually died on its first failure? tinderbox and universe seems to be useful when dealing with known breakage or when executing periodic builds, but I don't know think it's as effective with development testing, as for some of the stuff I just want to build on something other than my host arch and another arch that isn't x86 (say arm, mips, powerpc) just to make sure that I didn't break anything endian wise (if the code is that nasty). Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 07:27:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0542D106564A; Sun, 23 Jan 2011 07:27:36 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E8C4B8FC12; Sun, 23 Jan 2011 07:27:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0N7RZ6W047386; Sun, 23 Jan 2011 07:27:35 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0N7RZ9b047384; Sun, 23 Jan 2011 07:27:35 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101230727.p0N7RZ9b047384@svn.freebsd.org> From: Michael Tuexen Date: Sun, 23 Jan 2011 07:27:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217742 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 07:27:36 -0000 Author: tuexen Date: Sun Jan 23 07:27:35 2011 New Revision: 217742 URL: http://svn.freebsd.org/changeset/base/217742 Log: Remove unnecessary checking of variable. MFC after: 3 months. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sun Jan 23 02:18:18 2011 (r217741) +++ head/sys/netinet/sctputil.c Sun Jan 23 07:27:35 2011 (r217742) @@ -1045,18 +1045,8 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->sctp_autoclose_ticks = m->sctp_ep.auto_close_time; - switch (m->sctp_ep.sctp_default_cc_module) { - case SCTP_CC_RFC2581: - case SCTP_CC_HSTCP: - case SCTP_CC_HTCP: - stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; - stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; - break; - default: - stcb->asoc.congestion_control_module = SCTP_CC_RFC2581; - stcb->asoc.cc_functions = sctp_cc_functions[SCTP_CC_RFC2581]; - break; - } + stcb->asoc.congestion_control_module = m->sctp_ep.sctp_default_cc_module; + stcb->asoc.cc_functions = sctp_cc_functions[m->sctp_ep.sctp_default_cc_module]; /* * Now the stream parameters, here we allocate space for all streams From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 09:28:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D993B106566C; Sun, 23 Jan 2011 09:28:58 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe01.c2i.net [212.247.154.2]) by mx1.freebsd.org (Postfix) with ESMTP id 04A868FC0A; Sun, 23 Jan 2011 09:28:57 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=Vlw5OJcoxCC473z5moizI40ESYe+BpcMN2hU0iQoJwI= c=1 sm=1 a=wAPtBiE9dNAA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=6I5d2MoRAAAA:8 a=XsfVMBf67HdGtVWvobEA:9 a=RG7fcWBNKKUUf7mhWDwA:7 a=dWzqfs1UL6GMW1zAd9CRvosge-8A:4 a=pILNOxqGKmIA:10 a=SV7veod9ZcQA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe01.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 78507751; Sun, 23 Jan 2011 10:18:54 +0100 Received-SPF: softfail receiver=mailfe01.swip.net; client-ip=188.126.198.129; envelope-from=hselasky@freebsd.org From: Hans Petter Selasky To: gljennjohn@googlemail.com Date: Sun, 23 Jan 2011 10:19:02 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <201101221352.p0MDqNt3093630@svn.freebsd.org> <20110122160918.373f8670@ernst.jennejohn.org> In-Reply-To: <20110122160918.373f8670@ernst.jennejohn.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201101231019.02603.hselasky@freebsd.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r217718 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 09:28:58 -0000 On Saturday 22 January 2011 16:09:18 Gary Jennejohn wrote: > On Sat, 22 Jan 2011 13:52:23 +0000 (UTC) > > Hans Petter Selasky wrote: > > Author: hselasky > > Date: Sat Jan 22 13:52:23 2011 > > New Revision: 217718 > > URL: http://svn.freebsd.org/changeset/base/217718 > > > > Log: > > Allow USB_HOST_ALIGN to be configured at compile time. This patch is > > necessary for MIPS based RouterStation Pro board and maybe other MIPS > > based boards as well. > > > > Submitted by: Milan Obuch > > Approved by: thompsa (mentor) > > > > Modified: > > head/sys/conf/options > > head/sys/dev/usb/usb_freebsd.h > > > > Modified: head/sys/conf/options > > ========================================================================= > > ===== --- head/sys/conf/options Sat Jan 22 13:18:28 2011 (r217717) > > +++ head/sys/conf/options Sat Jan 22 13:52:23 2011 (r217718) > > @@ -642,6 +642,7 @@ BUS_DEBUG opt_bus.h > > > > # options for USB support > > USB_DEBUG opt_usb.h > > > > +USB_HOST_ALIGN opt_usb.h Sorry I didn't see this option sneaking in during r217631 :-) Anyway, two times is better than one time :-) > > > > USB_REQ_DEBUG opt_usb.h > > USB_VERBOSE opt_usb.h > > USB_EHCI_BIG_ENDIAN_DESC opt_usb.h > > > > Modified: head/sys/dev/usb/usb_freebsd.h > > ========================================================================= > > ===== --- head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:18:28 > > 2011 (r217717) +++ head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:52:23 > > 2011 (r217718) @@ -46,7 +46,12 @@ > > > > #define USB_TD_GET_PROC(td) (td)->td_proc > > #define USB_PROC_GET_GID(td) (td)->p_pgid > > > > +#if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) > > +/* USB_HOST_ALIGN is already defined and valid */ > > Not necessarily valid. What if the user sets it to -24? The compiler > will happily accept that with the above #if-statement. > > IMO you should test for USB_HOST_ALIGN > 0, which should always work. > > Defensive programming is always a good idea. I agree. Does this look OK: #if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) #if (-USB_HOST_ALIGN & USB_HOST_ALIGN) == USB_HOST_ALIGN #error "USB_HOST_ALIGN is not power of two." #endif #if (USB_HOST_ALIGN <= 0) #error "USB_HOST_ALIGN is less than or equal to zero." #endif ... > > > +#else > > +#undef USB_HOST_ALIGN > > > > #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ > > > > +#endif > > > > #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ > > #define USB_BUS_MAX 256 /* units */ > > #define USB_MAX_DEVICES 128 /* units */ --HPS From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 09:47:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DFFF6106564A; Sun, 23 Jan 2011 09:47:33 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe02.c2i.net [212.247.154.34]) by mx1.freebsd.org (Postfix) with ESMTP id 158958FC08; Sun, 23 Jan 2011 09:47:32 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.1 cv=CCOfvygxSj2xAPGFFsF6kM/l7Sx9XnKmxb3UJ56T8ow= c=1 sm=1 a=wAPtBiE9dNAA:10 a=N659UExz7-8A:10 a=CL8lFSKtTFcA:10 a=i9M/sDlu2rpZ9XS819oYzg==:17 a=Bbidpg6wzxJHuU0UpRUA:9 a=LhazZ_DYMTSBASheoYqTHc4f_sMA:4 a=pILNOxqGKmIA:10 a=i9M/sDlu2rpZ9XS819oYzg==:117 Received: from [188.126.198.129] (account mc467741@c2i.net HELO laptop002.hselasky.homeunix.org) by mailfe02.swip.net (CommuniGate Pro SMTP 5.2.19) with ESMTPA id 77758307; Sun, 23 Jan 2011 10:37:29 +0100 From: Hans Petter Selasky To: "gljennjohn@googlemail.com" Date: Sun, 23 Jan 2011 10:37:37 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.2-PRERELEASE; KDE/4.4.5; amd64; ; ) References: <20110122160918.373f8670@ernst.jennejohn.org> <201101231019.02603.hselasky@freebsd.org> In-Reply-To: <201101231019.02603.hselasky@freebsd.org> X-Face: *nPdTl_}RuAI6^PVpA02T?$%Xa^>@hE0uyUIoiha$pC:9TVgl.Oq, NwSZ4V"|LR.+tj}g5 %V,x^qOs~mnU3]Gn; cQLv&.N>TrxmSFf+p6(30a/{)KUU!s}w\IhQBj}[g}bj0I3^glmC( :AuzV9:.hESm-x4h240C`9=w MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Message-Id: <201101231037.37638.hselasky@c2i.net> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r217718 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 09:47:34 -0000 On Sunday 23 January 2011 10:19:02 Hans Petter Selasky wrote: > #if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) > #if (-USB_HOST_ALIGN & USB_HOST_ALIGN) == USB_HOST_ALIGN should be != in this check. > #error "USB_HOST_ALIGN is not power of two." --HPS From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 09:50:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49423106564A; Sun, 23 Jan 2011 09:50:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 386E48FC13; Sun, 23 Jan 2011 09:50:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0N9oeQ4050493; Sun, 23 Jan 2011 09:50:40 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0N9oel9050491; Sun, 23 Jan 2011 09:50:40 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101230950.p0N9oel9050491@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 23 Jan 2011 09:50:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217743 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 09:50:40 -0000 Author: dchagin Date: Sun Jan 23 09:50:39 2011 New Revision: 217743 URL: http://svn.freebsd.org/changeset/base/217743 Log: Style(9) fix. Approved by: kib(mentor) MFC after: 1 month Modified: head/sys/compat/linux/linux_signal.c Modified: head/sys/compat/linux/linux_signal.c ============================================================================== --- head/sys/compat/linux/linux_signal.c Sun Jan 23 07:27:35 2011 (r217742) +++ head/sys/compat/linux/linux_signal.c Sun Jan 23 09:50:39 2011 (r217743) @@ -526,7 +526,7 @@ linux_kill(struct thread *td, struct lin * Allow signal 0 as a means to check for privileges */ if (!LINUX_SIG_VALID(args->signum) && args->signum != 0) - return EINVAL; + return (EINVAL); if (args->signum > 0 && args->signum <= LINUX_SIGTBLSZ) tmp.signum = linux_to_bsd_signal[_SIG_IDX(args->signum)]; From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 10:35:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 1233) id 4A3CD106566C; Sun, 23 Jan 2011 10:35:57 +0000 (UTC) Date: Sun, 23 Jan 2011 10:35:57 +0000 From: Alexander Best To: Adrian Chadd Message-ID: <20110123103556.GA5202@freebsd.org> References: <201101222337.p0MNbg8c008388@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw" Content-Disposition: inline In-Reply-To: <201101222337.p0MNbg8c008388@svn.freebsd.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217738 - head/tools/tools/ath/athstats X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 10:35:57 -0000 --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat Jan 22 11, Adrian Chadd wrote: > Author: adrian > Date: Sat Jan 22 23:37:42 2011 > New Revision: 217738 > URL: http://svn.freebsd.org/changeset/base/217738 > > Log: > Patch the athstats code/Makefile to cross-compile correctly. > > Modified: > head/tools/tools/ath/athstats/Makefile > head/tools/tools/ath/athstats/athstats.c > > Modified: head/tools/tools/ath/athstats/Makefile > ============================================================================== > --- head/tools/tools/ath/athstats/Makefile Sat Jan 22 23:30:01 2011 (r217737) > +++ head/tools/tools/ath/athstats/Makefile Sat Jan 22 23:37:42 2011 (r217738) > @@ -1,28 +1,26 @@ > # $FreeBSD$ > > -PROG= athstats > +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal > > -SRCS= main.c statfoo.c athstats.c > +PROG= athstats > > -.include > +SRCS= main.c statfoo.c athstats.c opt_ah.h ah_osdep.h > > -SRCDIR= ${.CURDIR}/../../../.. > +CLEANFILES+= opt_ah.h > > -CLEANFILES+= opt_ah.h ah_osdep.h > +.include <../Makefile.inc> > > CFLAGS+=-DATH_SUPPORT_ANI > CFLAGS+=-DATH_SUPPORT_TDMA > > -CFLAGS+=-I${.CURDIR} > -CFLAGS+=-I${SRCDIR}/sys/net80211 > - > -.include <../Makefile.inc> > - > -athstats.o: opt_ah.h ah_osdep.h > - > opt_ah.h: > - touch opt_ah.h > + echo "#define AH_DEBUG 1" > opt_ah.h > + echo "#define AH_DEBUG_COUNTRY 1" >> opt_ah.h > + echo "#define AH_SUPPORT_AR5416 1" >> opt_ah.h > + > ah_osdep.h: > echo 'typedef void *HAL_SOFTC;' >ah_osdep.h > echo 'typedef int HAL_BUS_TAG;' >>ah_osdep.h > echo 'typedef void *HAL_BUS_HANDLE;' >>ah_osdep.h > + > +.include > > Modified: head/tools/tools/ath/athstats/athstats.c > ============================================================================== > --- head/tools/tools/ath/athstats/athstats.c Sat Jan 22 23:30:01 2011 (r217737) > +++ head/tools/tools/ath/athstats/athstats.c Sat Jan 22 23:37:42 2011 (r217738) > @@ -29,6 +29,8 @@ > * $FreeBSD$ > */ > > +#include "opt_ah.h" > + > /* > * ath statistics class. > */ -- a13x --GvXjxJ+pjyke8COw Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="athstats.diff" diff --git a/tools/tools/ath/athstats/main.c b/tools/tools/ath/athstats/main.c index 489c0bd..82dc561 100644 --- a/tools/tools/ath/athstats/main.c +++ b/tools/tools/ath/athstats/main.c @@ -114,7 +114,7 @@ main(int argc, char *argv[]) wf->zerostats(wf); break; default: - errx(-1, "usage: %s [-a] [-i ifname] [-l] [-o fmt] [-z] [interval]\n", argv[0]); + errx(-1, "usage: %s [-b] [-i ifname] [-l] [-o fmt] [-z] [interval]\n", argv[0]); /*NOTREACHED*/ } } --GvXjxJ+pjyke8COw-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 10:55:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDE091065673; Sun, 23 Jan 2011 10:55:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 71EB78FC0A; Sun, 23 Jan 2011 10:55:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 7356A41C69F; Sun, 23 Jan 2011 11:55:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id GSdq-lHlE4Zd; Sun, 23 Jan 2011 11:55:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id C557341C690; Sun, 23 Jan 2011 11:55:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 7D5A94448F3; Sun, 23 Jan 2011 10:51:46 +0000 (UTC) Date: Sun, 23 Jan 2011 10:51:45 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Garrett Cooper In-Reply-To: Message-ID: <20110123104812.A3489@maildrop.int.zabbadoz.net> References: <201101222257.p0MMvSZY007310@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-2003245887-1295779905=:3489" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217733 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 10:55:08 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-2003245887-1295779905=:3489 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Sat, 22 Jan 2011, Garrett Cooper wrote: > On Sat, Jan 22, 2011 at 2:57 PM, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Sat Jan 22 22:57:28 2011 >> New Revision: 217733 >> URL: http://svn.freebsd.org/changeset/base/217733 >> >> Log: >> =A0Properly document what the top-level `make tinderbox` does. >> >> =A0Reviewed by: =A0jmallett >> =A0MFC After: =A0 =A03 days >> =A0X-MFC: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0build.7 only > > As much as I like make universe and tinderbox, for the purpose of > development testing would it make sense if there was a tinderbox > target that actually died on its first failure? tinderbox and universe I think not really; if you want to catch errors, you want all of them and not just the first broken kernel if there are 12. > seems to be useful when dealing with known breakage or when executing > periodic builds, but I don't know think it's as effective with > development testing, as for some of the stuff I just want to build on > something other than my host arch and another arch that isn't x86 (say > arm, mips, powerpc) just to make sure that I didn't break anything > endian wise (if the code is that nasty). =09make universe TARGETS=3Darm or =09make universe TARGETS=3D"i386 amd64 sparc64 ia64" works perfectly well (again). Even =09make universe TARGETS=3Dmips TARGET_ARCH=3Dmips64eb KERNCONFS=3DXLR64 should be perfectly fine. /bz --=20 Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html --0-2003245887-1295779905=:3489-- From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 11:08:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79AFD106566B; Sun, 23 Jan 2011 11:08:28 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 674AF8FC12; Sun, 23 Jan 2011 11:08:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NB8SZR053162; Sun, 23 Jan 2011 11:08:28 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NB8S58053144; Sun, 23 Jan 2011 11:08:28 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101231108.p0NB8S58053144@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 23 Jan 2011 11:08:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217744 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 11:08:28 -0000 Author: uqs Date: Sun Jan 23 11:08:28 2011 New Revision: 217744 URL: http://svn.freebsd.org/changeset/base/217744 Log: libkvm code janitoring - make WARNS=6 clean for archs w/o strict alignment requirments - add const, ANSIfy, remove unused vars, cast types for comparison - thanks to differing definitions of VM_MIN_ADDRESS across our archs, we need to trick the compiler to not complain about signedness. We could either fix VM_MIN_ADDRESS to always be a simple integer or make the check conditional on $ARCH. Closes PRs: kern/42386, kern/83364 Reviewed by: bde Modified: head/lib/libkvm/kvm.c head/lib/libkvm/kvm.h head/lib/libkvm/kvm_amd64.c head/lib/libkvm/kvm_arm.c head/lib/libkvm/kvm_cptime.c head/lib/libkvm/kvm_file.c head/lib/libkvm/kvm_getloadavg.c head/lib/libkvm/kvm_getswapinfo.c head/lib/libkvm/kvm_i386.c head/lib/libkvm/kvm_ia64.c head/lib/libkvm/kvm_minidump_amd64.c head/lib/libkvm/kvm_minidump_arm.c head/lib/libkvm/kvm_minidump_i386.c head/lib/libkvm/kvm_minidump_mips.c head/lib/libkvm/kvm_mips.c head/lib/libkvm/kvm_pcpu.c head/lib/libkvm/kvm_powerpc.c head/lib/libkvm/kvm_proc.c head/lib/libkvm/kvm_sparc64.c head/lib/libkvm/kvm_vnet.c Modified: head/lib/libkvm/kvm.c ============================================================================== --- head/lib/libkvm/kvm.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm.c Sun Jan 23 11:08:28 2011 (r217744) @@ -77,8 +77,7 @@ static char sccsid[] = "@(#)kvm.c 8.2 (B int __fdnlist(int, struct nlist *); char * -kvm_geterr(kd) - kvm_t *kd; +kvm_geterr(kvm_t *kd) { return (kd->errbuf); } @@ -103,7 +102,7 @@ _kvm_err(kvm_t *kd, const char *program, (void)fputc('\n', stderr); } else (void)vsnprintf(kd->errbuf, - sizeof(kd->errbuf), (char *)fmt, ap); + sizeof(kd->errbuf), fmt, ap); va_end(ap); } @@ -122,7 +121,7 @@ _kvm_syserr(kvm_t *kd, const char *progr } else { char *cp = kd->errbuf; - (void)vsnprintf(cp, sizeof(kd->errbuf), (char *)fmt, ap); + (void)vsnprintf(cp, sizeof(kd->errbuf), fmt, ap); n = strlen(cp); (void)snprintf(&cp[n], sizeof(kd->errbuf) - n, ": %s", strerror(errno)); @@ -131,25 +130,18 @@ _kvm_syserr(kvm_t *kd, const char *progr } void * -_kvm_malloc(kd, n) - kvm_t *kd; - size_t n; +_kvm_malloc(kvm_t *kd, size_t n) { void *p; if ((p = calloc(n, sizeof(char))) == NULL) - _kvm_err(kd, kd->program, "can't allocate %u bytes: %s", + _kvm_err(kd, kd->program, "can't allocate %zu bytes: %s", n, strerror(errno)); return (p); } static kvm_t * -_kvm_open(kd, uf, mf, flag, errout) - kvm_t *kd; - const char *uf; - const char *mf; - int flag; - char *errout; +_kvm_open(kvm_t *kd, const char *uf, const char *mf, int flag, char *errout) { struct stat st; @@ -242,12 +234,8 @@ failed: } kvm_t * -kvm_openfiles(uf, mf, sf, flag, errout) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - char *errout; +kvm_openfiles(const char *uf, const char *mf, const char *sf __unused, int flag, + char *errout) { kvm_t *kd; @@ -260,12 +248,8 @@ kvm_openfiles(uf, mf, sf, flag, errout) } kvm_t * -kvm_open(uf, mf, sf, flag, errstr) - const char *uf; - const char *mf; - const char *sf __unused; - int flag; - const char *errstr; +kvm_open(const char *uf, const char *mf, const char *sf __unused, int flag, + const char *errstr) { kvm_t *kd; @@ -280,8 +264,7 @@ kvm_open(uf, mf, sf, flag, errstr) } int -kvm_close(kd) - kvm_t *kd; +kvm_close(kvm_t *kd) { int error = 0; @@ -316,8 +299,9 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli { struct nlist *n, *np, *p; char *cp, *ce; + const char *ccp; size_t len; - int unresolved; + int slen, unresolved; /* * Calculate the space we need to malloc for nlist and names. @@ -355,13 +339,13 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli continue; bcopy(p, np, sizeof(struct nlist)); /* Save the new\0orig. name so we can later match it again. */ - len = snprintf(cp, ce - cp, "%s%s%c%s", prefix, + slen = snprintf(cp, ce - cp, "%s%s%c%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name, '\0', p->n_name); - if (len >= ce - cp) + if (slen < 0 || slen >= ce - cp) continue; np->n_name = cp; - cp += len + 1; + cp += slen + 1; np++; unresolved++; } @@ -385,8 +369,8 @@ kvm_fdnlist_prefix(kvm_t *kd, struct nli if (p->n_type != N_UNDF) continue; /* Skip expanded name and compare to orig. one. */ - cp = np->n_name + strlen(np->n_name) + 1; - if (strcmp(cp, p->n_name)) + ccp = np->n_name + strlen(np->n_name) + 1; + if (strcmp(ccp, p->n_name) != 0) continue; /* Update nlist with new, translated results. */ p->n_type = np->n_type; @@ -416,7 +400,8 @@ _kvm_nlist(kvm_t *kd, struct nlist *nl, int nvalid; struct kld_sym_lookup lookup; int error; - char *prefix = "", symname[1024]; /* XXX-BZ symbol name length limit? */ + const char *prefix = ""; + char symname[1024]; /* XXX-BZ symbol name length limit? */ int tried_vnet, tried_dpcpu; /* @@ -458,9 +443,8 @@ again: error = snprintf(symname, sizeof(symname), "%s%s", prefix, (prefix[0] != '\0' && p->n_name[0] == '_') ? (p->n_name + 1) : p->n_name); - if (error >= sizeof(symname)) + if (error < 0 || error >= (int)sizeof(symname)) continue; - lookup.symname = symname; if (lookup.symname[0] == '_') lookup.symname++; @@ -470,11 +454,11 @@ again: p->n_other = 0; p->n_desc = 0; if (_kvm_vnet_initialized(kd, initialize) && - !strcmp(prefix, VNET_SYMPREFIX)) + !strcmp(prefix, VNET_SYMPREFIX) == 0) p->n_value = _kvm_vnet_validaddr(kd, lookup.symvalue); else if (_kvm_dpcpu_initialized(kd, initialize) && - !strcmp(prefix, DPCPU_SYMPREFIX)) + !strcmp(prefix, DPCPU_SYMPREFIX) == 0) p->n_value = _kvm_dpcpu_validaddr(kd, lookup.symvalue); else @@ -511,9 +495,7 @@ again: } int -kvm_nlist(kd, nl) - kvm_t *kd; - struct nlist *nl; +kvm_nlist(kvm_t *kd, struct nlist *nl) { /* @@ -524,13 +506,11 @@ kvm_nlist(kd, nl) } ssize_t -kvm_read(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - void *buf; - size_t len; +kvm_read(kvm_t *kd, u_long kva, void *buf, size_t len) { int cc; + ssize_t cr; + off_t pa; char *cp; if (ISALIVE(kd)) { @@ -540,59 +520,52 @@ kvm_read(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } - cc = read(kd->vmfd, buf, len); - if (cc < 0) { + cr = read(kd->vmfd, buf, len); + if (cr < 0) { _kvm_syserr(kd, 0, "kvm_read"); return (-1); - } else if (cc < len) + } else if (cr < (ssize_t)len) _kvm_err(kd, kd->program, "short read"); - return (cc); - } else { - cp = buf; - while (len > 0) { - off_t pa; - - cc = _kvm_kvatop(kd, kva, &pa); - if (cc == 0) - return (-1); - if (cc > len) - cc = len; - errno = 0; - if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { - _kvm_syserr(kd, 0, _PATH_MEM); - break; - } - cc = read(kd->pmfd, cp, cc); - if (cc < 0) { - _kvm_syserr(kd, kd->program, "kvm_read"); - break; - } - /* - * If kvm_kvatop returns a bogus value or our core - * file is truncated, we might wind up seeking beyond - * the end of the core file in which case the read will - * return 0 (EOF). - */ - if (cc == 0) - break; - cp += cc; - kva += cc; - len -= cc; + return (cr); + } + + cp = buf; + while (len > 0) { + cc = _kvm_kvatop(kd, kva, &pa); + if (cc == 0) + return (-1); + if (cc > (ssize_t)len) + cc = len; + errno = 0; + if (lseek(kd->pmfd, pa, 0) == -1 && errno != 0) { + _kvm_syserr(kd, 0, _PATH_MEM); + break; + } + cr = read(kd->pmfd, cp, cc); + if (cr < 0) { + _kvm_syserr(kd, kd->program, "kvm_read"); + break; } - return (cp - (char *)buf); + /* + * If kvm_kvatop returns a bogus value or our core file is + * truncated, we might wind up seeking beyond the end of the + * core file in which case the read will return 0 (EOF). + */ + if (cr == 0) + break; + cp += cr; + kva += cr; + len -= cr; } - /* NOTREACHED */ + + return (cp - (char *)buf); } ssize_t -kvm_write(kd, kva, buf, len) - kvm_t *kd; - u_long kva; - const void *buf; - size_t len; +kvm_write(kvm_t *kd, u_long kva, const void *buf, size_t len) { int cc; @@ -602,14 +575,14 @@ kvm_write(kd, kva, buf, len) */ errno = 0; if (lseek(kd->vmfd, (off_t)kva, 0) == -1 && errno != 0) { - _kvm_err(kd, 0, "invalid address (%x)", kva); + _kvm_err(kd, 0, "invalid address (%lx)", kva); return (-1); } cc = write(kd->vmfd, buf, len); if (cc < 0) { _kvm_syserr(kd, 0, "kvm_write"); return (-1); - } else if (cc < len) + } else if ((size_t)cc < len) _kvm_err(kd, kd->program, "short write"); return (cc); } else { Modified: head/lib/libkvm/kvm.h ============================================================================== --- head/lib/libkvm/kvm.h Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm.h Sun Jan 23 11:08:28 2011 (r217744) @@ -88,7 +88,7 @@ kvm_t *kvm_openfiles (const char *, const char *, const char *, int, char *); ssize_t kvm_read(kvm_t *, unsigned long, void *, size_t); ssize_t kvm_uread - (kvm_t *, struct kinfo_proc *, unsigned long, char *, size_t); + (kvm_t *, const struct kinfo_proc *, unsigned long, char *, size_t); ssize_t kvm_write(kvm_t *, unsigned long, const void *, size_t); __END_DECLS Modified: head/lib/libkvm/kvm_amd64.c ============================================================================== --- head/lib/libkvm/kvm_amd64.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_amd64.c Sun Jan 23 11:08:28 2011 (r217744) @@ -147,7 +147,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; pml4_entry_t *PML4; @@ -176,23 +176,23 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no kernbase"); return (-1); } - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "KPML4phys"; - nlist[1].n_name = 0; + nl[0].n_name = "KPML4phys"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist - no KPML4phys"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, sizeof(pa)) != + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); return (-1); @@ -222,7 +222,6 @@ _kvm_vatop(kvm_t *kd, u_long va, off_t * u_long pdpeindex; u_long pdeindex; u_long pteindex; - int i; u_long a; off_t ofs; size_t s; Modified: head/lib/libkvm/kvm_arm.c ============================================================================== --- head/lib/libkvm/kvm_arm.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_arm.c Sun Jan 23 11:08:28 2011 (r217744) @@ -124,7 +124,7 @@ int _kvm_initvtop(kvm_t *kd) { struct vmstate *vm; - struct nlist nlist[2]; + struct nlist nl[2]; u_long kernbase, physaddr, pa; pd_entry_t *l1pt; Elf32_Ehdr *ehdr; @@ -154,25 +154,25 @@ _kvm_initvtop(kvm_t *kd) hdrsz = ehdr->e_phoff + ehdr->e_phentsize * ehdr->e_phnum; if (_kvm_maphdrs(kd, hdrsz) == -1) return (-1); - nlist[0].n_name = "kernbase"; - nlist[1].n_name = NULL; - if (kvm_nlist(kd, nlist) != 0) + nl[0].n_name = "kernbase"; + nl[1].n_name = NULL; + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "physaddr"; - if (kvm_nlist(kd, nlist) != 0) { + nl[0].n_name = "physaddr"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "couldn't get phys addr"); return (-1); } - physaddr = nlist[0].n_value; - nlist[0].n_name = "kernel_l1pa"; - if (kvm_nlist(kd, nlist) != 0) { + physaddr = nl[0].n_value; + nl[0].n_name = "kernel_l1pa"; + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase + physaddr), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase + physaddr), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read kernel_l1pa"); return (-1); @@ -205,7 +205,6 @@ _kvm_initvtop(kvm_t *kd) int _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { - u_long offset = va & (PAGE_SIZE - 1); struct vmstate *vm = kd->vmst; pd_entry_t pd; pt_entry_t pte; @@ -244,7 +243,7 @@ _kvm_kvatop(kvm_t *kd, u_long va, off_t *pa = (pte & L2_S_FRAME) | (va & L2_S_OFFSET); return (_kvm_pa2off(kd, *pa, pa, PAGE_SIZE)); invalid: - _kvm_err(kd, 0, "Invalid address (%x)", va); + _kvm_err(kd, 0, "Invalid address (%lx)", va); return 0; } @@ -253,16 +252,15 @@ invalid: * not just those for a kernel crash dump. Some architectures * have to deal with these NOT being constants! (i.e. m68k) */ +#ifdef FBSD_NOT_YET int -_kvm_mdopen(kd) - kvm_t *kd; +_kvm_mdopen(kvm_t *kd) { -#ifdef FBSD_NOT_YET kd->usrstack = USRSTACK; kd->min_uva = VM_MIN_ADDRESS; kd->max_uva = VM_MAXUSER_ADDRESS; -#endif return (0); } +#endif Modified: head/lib/libkvm/kvm_cptime.c ============================================================================== --- head/lib/libkvm/kvm_cptime.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_cptime.c Sun Jan 23 11:08:28 2011 (r217744) @@ -44,8 +44,8 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_cp_time_nl[] = { - { "_cp_time" }, /* (deprecated) */ - { NULL }, + { .n_name = "_cp_time" }, /* (deprecated) */ + { .n_name = NULL }, }; #define NL_CP_TIME 0 @@ -59,6 +59,7 @@ _kvm_cp_time_init(kvm_t *kd) if (kvm_nlist(kd, kvm_cp_time_nl) < 0) return (-1); kvm_cp_time_cached = 1; + return (0); } static int Modified: head/lib/libkvm/kvm_file.c ============================================================================== --- head/lib/libkvm/kvm_file.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_file.c Sun Jan 23 11:08:28 2011 (r217744) @@ -69,16 +69,14 @@ static char sccsid[] = "@(#)kvm_file.c 8 (kvm_read(kd, addr, obj, sizeof(*obj)) != sizeof(*obj)) #define KREADN(kd, addr, obj, cnt) \ - (kvm_read(kd, addr, obj, (cnt)) != (cnt)) + (kvm_read(kd, addr, obj, (cnt)) != (ssize_t)(cnt)) /* * Get file structures. */ static int -kvm_deadfiles(kd, op, arg, allproc_o, nprocs) - kvm_t *kd; - int op, arg, nprocs; - long allproc_o; +kvm_deadfiles(kvm_t *kd, int op __unused, int arg __unused, long allproc_o, + int nprocs __unused) { struct proc proc; struct filedesc filed; @@ -88,7 +86,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np struct proc *p; char *where = kd->argspc; - if (buflen < sizeof (struct file *) + sizeof (struct file)) + if (buflen < (int)(sizeof(struct file *) + sizeof(struct file))) return (0); if (KREAD(kd, allproc_o, &p)) { _kvm_err(kd, kd->program, "cannot read allproc"); @@ -96,7 +94,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } for (; p != NULL; p = LIST_NEXT(&proc, p_list)) { if (KREAD(kd, (u_long)p, &proc)) { - _kvm_err(kd, kd->program, "can't read proc at %x", p); + _kvm_err(kd, kd->program, "can't read proc at %p", p); goto fail; } if (proc.p_state == PRS_NEW) @@ -104,7 +102,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np if (proc.p_fd == NULL) continue; if (KREAD(kd, (u_long)p->p_fd, &filed)) { - _kvm_err(kd, kd->program, "can't read filedesc at %x", + _kvm_err(kd, kd->program, "can't read filedesc at %p", p->p_fd); goto fail; } @@ -118,7 +116,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np } if (KREADN(kd, (u_long)filed.fd_ofiles, ofiles, ocnt * sizeof(struct file *))) { - _kvm_err(kd, kd->program, "can't read ofiles at %x", + _kvm_err(kd, kd->program, "can't read ofiles at %p", filed.fd_ofiles); return (0); } @@ -135,7 +133,7 @@ kvm_deadfiles(kd, op, arg, allproc_o, np where += sizeof (fp); once = 1; } - if (buflen < sizeof (struct file)) + if (buflen < (int)sizeof(struct file)) goto fail; if (KREAD(kd, (long)fp, ((struct file *)where))) { _kvm_err(kd, kd->program, "can't read kfp"); @@ -156,10 +154,7 @@ fail: } char * -kvm_getfiles(kd, op, arg, cnt) - kvm_t *kd; - int op, arg; - int *cnt; +kvm_getfiles(kvm_t *kd, int op, int arg, int *cnt) { int mib[2], st, n, nfiles, nprocs; size_t size; @@ -177,7 +172,7 @@ kvm_getfiles(kd, op, arg, cnt) } if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); @@ -214,7 +209,7 @@ kvm_getfiles(kd, op, arg, cnt) size = sizeof(void *) + (nfiles + 10) * sizeof(struct file); if (kd->argspc == 0) kd->argspc = (char *)_kvm_malloc(kd, size); - else if (kd->arglen < size) + else if (kd->arglen < (int)size) kd->argspc = (char *)_kvm_realloc(kd, kd->argspc, size); if (kd->argspc == 0) return (0); Modified: head/lib/libkvm/kvm_getloadavg.c ============================================================================== --- head/lib/libkvm/kvm_getloadavg.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_getloadavg.c Sun Jan 23 11:08:28 2011 (r217744) @@ -48,11 +48,11 @@ static char sccsid[] = "@(#)kvm_getloada #include "kvm_private.h" static struct nlist nl[] = { - { "_averunnable" }, + { .n_name = "_averunnable" }, #define X_AVERUNNABLE 0 - { "_fscale" }, + { .n_name = "_fscale" }, #define X_FSCALE 1 - { "" }, + { .n_name = "" }, }; /* @@ -62,10 +62,7 @@ static struct nlist nl[] = { * Return number of samples retrieved, or -1 on error. */ int -kvm_getloadavg(kd, loadavg, nelem) - kvm_t *kd; - double loadavg[]; - int nelem; +kvm_getloadavg(kvm_t *kd, double loadavg[], int nelem) { struct loadavg loadinfo; struct nlist *p; @@ -95,7 +92,7 @@ kvm_getloadavg(kd, loadavg, nelem) if (!KREAD(kd, nl[X_FSCALE].n_value, &fscale)) loadinfo.fscale = fscale; - nelem = MIN(nelem, sizeof(loadinfo.ldavg) / sizeof(fixpt_t)); + nelem = MIN(nelem, (int)(sizeof(loadinfo.ldavg) / sizeof(fixpt_t))); for (i = 0; i < nelem; i++) loadavg[i] = (double) loadinfo.ldavg[i] / loadinfo.fscale; return (nelem); Modified: head/lib/libkvm/kvm_getswapinfo.c ============================================================================== --- head/lib/libkvm/kvm_getswapinfo.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_getswapinfo.c Sun Jan 23 11:08:28 2011 (r217744) @@ -51,9 +51,9 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_swap_nl[] = { - { "_swtailq" }, /* list of swap devices and sizes */ - { "_dmmax" }, /* maximum size of a swap block */ - { NULL } + { .n_name = "_swtailq" }, /* list of swap devices and sizes */ + { .n_name = "_dmmax" }, /* maximum size of a swap block */ + { .n_name = NULL } }; #define NL_SWTAILQ 0 @@ -66,7 +66,7 @@ static int dmmax; static int kvm_getswapinfo_kvm(kvm_t *, struct kvm_swap *, int, int); static int kvm_getswapinfo_sysctl(kvm_t *, struct kvm_swap *, int, int); static int nlist_init(kvm_t *); -static int getsysctl(kvm_t *, char *, void *, size_t); +static int getsysctl(kvm_t *, const char *, void *, size_t); #define KREAD(kd, addr, obj) \ (kvm_read(kd, addr, (char *)(obj), sizeof(*obj)) != sizeof(*obj)) @@ -90,12 +90,8 @@ static int getsysctl(kvm_t *, char *, v } int -kvm_getswapinfo( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, int flags) +{ /* * clear cache @@ -113,12 +109,9 @@ kvm_getswapinfo( } int -kvm_getswapinfo_kvm( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_kvm(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int i, ttl; TAILQ_HEAD(, swdevt) swtailq; struct swdevt *sp, swinfo; @@ -161,12 +154,9 @@ kvm_getswapinfo_kvm( #define SWI_MAXMIB 3 int -kvm_getswapinfo_sysctl( - kvm_t *kd, - struct kvm_swap *swap_ary, - int swap_max, - int flags -) { +kvm_getswapinfo_sysctl(kvm_t *kd, struct kvm_swap *swap_ary, int swap_max, + int flags) +{ int ti, ttl; size_t mibi, len; int soid[SWI_MAXMIB]; @@ -229,8 +219,6 @@ kvm_getswapinfo_sysctl( static int nlist_init(kvm_t *kd) { - TAILQ_HEAD(, swdevt) swtailq; - struct swdevt *sp, swinfo; if (kvm_swap_nl_cached) return (1); @@ -257,12 +245,8 @@ nlist_init(kvm_t *kd) } static int -getsysctl ( - kvm_t *kd, - char *name, - void *ptr, - size_t len -) { +getsysctl(kvm_t *kd, const char *name, void *ptr, size_t len) +{ size_t nlen = len; if (sysctlbyname(name, ptr, &nlen, NULL, 0) == -1) { _kvm_err(kd, kd->program, "cannot read sysctl %s:%s", name, Modified: head/lib/libkvm/kvm_i386.c ============================================================================== --- head/lib/libkvm/kvm_i386.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_i386.c Sun Jan 23 11:08:28 2011 (r217744) @@ -153,7 +153,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; u_long pa; u_long kernbase; char *PTD; @@ -183,21 +183,21 @@ _kvm_initvtop(kvm_t *kd) return (-1); } - nlist[0].n_name = "kernbase"; - nlist[1].n_name = 0; + nl[0].n_name = "kernbase"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) + if (kvm_nlist(kd, nl) != 0) kernbase = KERNBASE; /* for old kernels */ else - kernbase = nlist[0].n_value; + kernbase = nl[0].n_value; - nlist[0].n_name = "IdlePDPT"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePDPT"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) == 0) { + if (kvm_nlist(kd, nl) == 0) { uint64_t pa64; - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePDPT"); return (-1); @@ -220,14 +220,14 @@ _kvm_initvtop(kvm_t *kd) kd->vmst->PTD = PTD; kd->vmst->pae = 1; } else { - nlist[0].n_name = "IdlePTD"; - nlist[1].n_name = 0; + nl[0].n_name = "IdlePTD"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value - kernbase), &pa, + if (kvm_read(kd, (nl[0].n_value - kernbase), &pa, sizeof(pa)) != sizeof(pa)) { _kvm_err(kd, kd->program, "cannot read IdlePTD"); return (-1); Modified: head/lib/libkvm/kvm_ia64.c ============================================================================== --- head/lib/libkvm/kvm_ia64.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_ia64.c Sun Jan 23 11:08:28 2011 (r217744) @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -123,7 +124,7 @@ _kvm_freevtop(kvm_t *kd) int _kvm_initvtop(kvm_t *kd) { - struct nlist nlist[2]; + struct nlist nl[2]; uint64_t va; Elf64_Ehdr *ehdr; size_t hdrsz; @@ -150,15 +151,15 @@ _kvm_initvtop(kvm_t *kd) * addresses/values. */ - nlist[0].n_name = "ia64_kptdir"; - nlist[1].n_name = 0; + nl[0].n_name = "ia64_kptdir"; + nl[1].n_name = 0; - if (kvm_nlist(kd, nlist) != 0) { + if (kvm_nlist(kd, nl) != 0) { _kvm_err(kd, kd->program, "bad namelist"); return (-1); } - if (kvm_read(kd, (nlist[0].n_value), &va, sizeof(va)) != sizeof(va)) { + if (kvm_read(kd, (nl[0].n_value), &va, sizeof(va)) != sizeof(va)) { _kvm_err(kd, kd->program, "cannot read kptdir"); return (-1); } Modified: head/lib/libkvm/kvm_minidump_amd64.c ============================================================================== --- head/lib/libkvm/kvm_minidump_amd64.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_minidump_amd64.c Sun Jan 23 11:08:28 2011 (r217744) @@ -136,7 +136,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -207,7 +206,6 @@ _kvm_minidump_vatop_v1(kvm_t *kd, u_long u_long offset; pt_entry_t pte; u_long pteindex; - int i; u_long a; off_t ofs; @@ -258,7 +256,6 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va pd_entry_t pte; u_long pteindex; u_long pdeindex; - int i; u_long a; off_t ofs; Modified: head/lib/libkvm/kvm_minidump_arm.c ============================================================================== --- head/lib/libkvm/kvm_minidump_arm.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_minidump_arm.c Sun Jan 23 11:08:28 2011 (r217744) @@ -138,7 +138,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -179,7 +178,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); @@ -194,7 +193,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { + (ssize_t)vmst->hdr.ptesize) { _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); return (-1); @@ -216,7 +215,6 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v u_long offset, pteindex, a; off_t ofs; uint32_t *ptemap; - int i; if (ISALIVE(kd)) { _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); Modified: head/lib/libkvm/kvm_minidump_i386.c ============================================================================== --- head/lib/libkvm/kvm_minidump_i386.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_minidump_i386.c Sun Jan 23 11:08:28 2011 (r217744) @@ -138,7 +138,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -173,7 +172,7 @@ _kvm_minidump_initvtop(kvm_t *kd) return (-1); } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); } @@ -185,7 +184,7 @@ _kvm_minidump_initvtop(kvm_t *kd) return (-1); } if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { + (ssize_t)vmst->hdr.ptesize) { _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); return (-1); } @@ -204,7 +203,6 @@ _kvm_minidump_vatop_pae(kvm_t *kd, u_lon uint64_t offset; uint64_t pte; u_long pteindex; - int i; uint64_t a; off_t ofs; uint64_t *ptemap; @@ -245,7 +243,6 @@ _kvm_minidump_vatop(kvm_t *kd, u_long va u_long offset; pt_entry_t pte; u_long pteindex; - int i; u_long a; off_t ofs; uint32_t *ptemap; Modified: head/lib/libkvm/kvm_minidump_mips.c ============================================================================== --- head/lib/libkvm/kvm_minidump_mips.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_minidump_mips.c Sun Jan 23 11:08:28 2011 (r217744) @@ -140,7 +140,6 @@ _kvm_minidump_freevtop(kvm_t *kd) int _kvm_minidump_initvtop(kvm_t *kd) { - u_long pa; struct vmstate *vmst; off_t off; @@ -182,7 +181,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->bitmap, vmst->hdr.bitmapsize, off) != - vmst->hdr.bitmapsize) { + (ssize_t)vmst->hdr.bitmapsize) { _kvm_err(kd, kd->program, "cannot read %d bytes for page bitmap", vmst->hdr.bitmapsize); return (-1); @@ -197,7 +196,7 @@ _kvm_minidump_initvtop(kvm_t *kd) } if (pread(kd->pmfd, vmst->ptemap, vmst->hdr.ptesize, off) != - vmst->hdr.ptesize) { + (ssize_t)vmst->hdr.ptesize) { _kvm_err(kd, kd->program, "cannot read %d bytes for ptemap", vmst->hdr.ptesize); return (-1); @@ -219,7 +218,6 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v u_long offset, pteindex, a; off_t ofs; pt_entry_t *ptemap; - int i; if (ISALIVE(kd)) { _kvm_err(kd, 0, "kvm_kvatop called in live kernel!"); @@ -238,9 +236,9 @@ _kvm_minidump_kvatop(kvm_t *kd, u_long v a = (MIPS_XKPHYS_TO_PHYS(va)); else #endif - if (va >= MIPS_KSEG0_START && va < MIPS_KSEG0_END) + if (va >= (u_long)MIPS_KSEG0_START && va < (u_long)MIPS_KSEG0_END) a = (MIPS_KSEG0_TO_PHYS(va)); - else if (va >= MIPS_KSEG1_START && va < MIPS_KSEG1_END) + else if (va >= (u_long)MIPS_KSEG1_START && va < (u_long)MIPS_KSEG1_END) a = (MIPS_KSEG1_TO_PHYS(va)); else if (va >= vm->hdr.kernbase) { pteindex = (va - vm->hdr.kernbase) >> PAGE_SHIFT; Modified: head/lib/libkvm/kvm_mips.c ============================================================================== --- head/lib/libkvm/kvm_mips.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_mips.c Sun Jan 23 11:08:28 2011 (r217744) @@ -94,12 +94,9 @@ _kvm_initvtop(kvm_t *kd) } int -_kvm_kvatop(kvm_t *kd, u_long va , off_t *pa) +_kvm_kvatop(kvm_t *kd, u_long va, off_t *pa) { - u_long offset = va & (PAGE_SIZE - 1); - struct vmstate *vm = kd->vmst; - if (kd->vmst->minidump) return _kvm_minidump_kvatop(kd, va, pa); @@ -113,9 +110,11 @@ _kvm_kvatop(kvm_t *kd, u_long va , off_t * not just those for a kernel crash dump. Some architectures * have to deal with these NOT being constants! (i.e. m68k) */ +#ifdef FBSD_NOT_YET int _kvm_mdopen(kvm_t *kd __unused) { return (0); } +#endif Modified: head/lib/libkvm/kvm_pcpu.c ============================================================================== --- head/lib/libkvm/kvm_pcpu.c Sun Jan 23 09:50:39 2011 (r217743) +++ head/lib/libkvm/kvm_pcpu.c Sun Jan 23 11:08:28 2011 (r217744) @@ -48,9 +48,9 @@ __FBSDID("$FreeBSD$"); #include "kvm_private.h" static struct nlist kvm_pcpu_nl[] = { - { "_cpuid_to_pcpu" }, - { "_mp_maxcpus" }, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 11:08:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 356E410656A3; Sun, 23 Jan 2011 11:08:37 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 242D58FC14; Sun, 23 Jan 2011 11:08:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NB8buW053204; Sun, 23 Jan 2011 11:08:37 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NB8bl9053201; Sun, 23 Jan 2011 11:08:37 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101231108.p0NB8bl9053201@svn.freebsd.org> From: Ulrich Spoerlein Date: Sun, 23 Jan 2011 11:08:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217745 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 11:08:37 -0000 Author: uqs Date: Sun Jan 23 11:08:36 2011 New Revision: 217745 URL: http://svn.freebsd.org/changeset/base/217745 Log: libkvm: fix process runtime calculation on crashdumps Fix a long standing bug, where the procs ticks where assumed to be in us. Instead, read cpu_tick_frequency from the kernel and use the same logic to convert runtime. This is still too optimistic in that it assumes cpu_tick_frequency is available and fixed. Since this function is only called on crashdumps, I think we can live with that. Testing has shown the values to be correct for different kern.hz inside Virtualbox. Bump WARNS. Alignment issues on some archs mean this is still at 3. Reviewed by: bde Modified: head/lib/libkvm/Makefile head/lib/libkvm/kvm_proc.c Modified: head/lib/libkvm/Makefile ============================================================================== --- head/lib/libkvm/Makefile Sun Jan 23 11:08:28 2011 (r217744) +++ head/lib/libkvm/Makefile Sun Jan 23 11:08:36 2011 (r217745) @@ -15,7 +15,7 @@ KVM_ARCH=${MACHINE_ARCH} KVM_ARCH=${MACHINE_CPUARCH} .endif -WARNS?= 0 +WARNS?= 3 SRCS= kvm.c kvm_${KVM_ARCH}.c kvm_cptime.c kvm_file.c kvm_getloadavg.c \ kvm_getswapinfo.c kvm_pcpu.c kvm_proc.c kvm_vnet.c Modified: head/lib/libkvm/kvm_proc.c ============================================================================== --- head/lib/libkvm/kvm_proc.c Sun Jan 23 11:08:28 2011 (r217744) +++ head/lib/libkvm/kvm_proc.c Sun Jan 23 11:08:36 2011 (r217745) @@ -88,6 +88,25 @@ __FBSDID("$FreeBSD$"); static int ticks; static int hz; +static uint64_t cpu_tick_frequency; + +/* + * From sys/kern/kern_tc.c. Depends on cpu_tick_frequency, which is + * read/initialized before this function is ever called. + */ +static uint64_t +cputick2usec(uint64_t tick) +{ + + if (cpu_tick_frequency == 0) + return (0); + if (tick > 18446744073709551) /* floor(2^64 / 1000) */ + return (tick / (cpu_tick_frequency / 1000000)); + else if (tick > 18446744073709) /* floor(2^64 / 1000000) */ + return ((tick * 1000) / (cpu_tick_frequency / 1000)); + else + return ((tick * 1000000) / cpu_tick_frequency); +} /* * Read proc's from memory file into buffer bp, which has space to hold @@ -113,7 +132,6 @@ kvm_proclist(kvm_t *kd, int what, int ar struct thread mtd; struct proc proc; struct proc pproc; - struct timeval tv; struct sysentvec sysent; char svname[KI_EMULNAMELEN]; @@ -367,15 +385,7 @@ nopgrp: kp->ki_lockname, LOCKNAMELEN); kp->ki_lockname[LOCKNAMELEN] = 0; } - /* - * XXX: This is plain wrong, rux_runtime has nothing - * to do with struct bintime, rux_runtime is just a 64-bit - * integer counter of cputicks. What we need here is a way - * to convert cputicks to usecs. The kernel does it in - * kern/kern_tc.c, but the function can't be just copied. - */ - bintime2timeval(&proc.p_rux.rux_runtime, &tv); - kp->ki_runtime = (u_int64_t)tv.tv_sec * 1000000 + tv.tv_usec; + kp->ki_runtime = cputick2usec(proc.p_rux.rux_runtime); kp->ki_pid = proc.p_pid; kp->ki_siglist = proc.p_siglist; SIGSETOR(kp->ki_siglist, mtd.td_siglist); @@ -542,14 +552,15 @@ kvm_getprocs(kvm_t *kd, int op, int arg, liveout: nprocs = size == 0 ? 0 : size / kd->procbase->ki_structsize; } else { - struct nlist nl[6], *p; + struct nlist nl[7], *p; nl[0].n_name = "_nprocs"; nl[1].n_name = "_allproc"; nl[2].n_name = "_zombproc"; nl[3].n_name = "_ticks"; nl[4].n_name = "_hz"; - nl[5].n_name = 0; + nl[5].n_name = "_cpu_tick_frequency"; + nl[6].n_name = 0; if (kvm_nlist(kd, nl) != 0) { for (p = nl; p->n_type != 0; ++p) @@ -570,6 +581,11 @@ liveout: _kvm_err(kd, kd->program, "can't read hz"); return (0); } + if (KREAD(kd, nl[5].n_value, &cpu_tick_frequency)) { + _kvm_err(kd, kd->program, + "can't read cpu_tick_frequency"); + return (0); + } size = nprocs * sizeof(struct kinfo_proc); kd->procbase = (struct kinfo_proc *)_kvm_malloc(kd, size); if (kd->procbase == 0) From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 11:08:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F401510656D7; Sun, 23 Jan 2011 11:08:39 +0000 (UTC) (envelope-from keramida@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E2E798FC15; Sun, 23 Jan 2011 11:08:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NB8dJn053241; Sun, 23 Jan 2011 11:08:39 GMT (envelope-from keramida@svn.freebsd.org) Received: (from keramida@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NB8d3K053239; Sun, 23 Jan 2011 11:08:39 GMT (envelope-from keramida@svn.freebsd.org) Message-Id: <201101231108.p0NB8d3K053239@svn.freebsd.org> From: Giorgos Keramidas Date: Sun, 23 Jan 2011 11:08:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217746 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 11:08:40 -0000 Author: keramida (doc committer) Date: Sun Jan 23 11:08:39 2011 New Revision: 217746 URL: http://svn.freebsd.org/changeset/base/217746 Log: Touch up the sample memory usage numbers a bit, to avoid wrapping on terminal boundary. While here add definition for 'G' and fix the indentation of 'K' units. Submitted by: plunket PR: docs/153614 MFC after: 3 days Modified: head/usr.bin/top/top.local.1 Modified: head/usr.bin/top/top.local.1 ============================================================================== --- head/usr.bin/top/top.local.1 Sun Jan 23 11:08:36 2011 (r217745) +++ head/usr.bin/top/top.local.1 Sun Jan 23 11:08:39 2011 (r217746) @@ -5,16 +5,19 @@ The '-H' option will toggle the display of kernel visible thread contexts. At runtime the 'H' key will toggle this mode. The default is OFF. -.SH DESCRIPTION OF MEMORY -Mem: 9220K Active, 1032K Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free +.SH DESCRIPTION OF MEMORY +Mem: 9220K Active, 1M Inact, 3284K Wired, 1M Cache, 2M Buf, 1320K Free Swap: 91M Total, 79M Free, 13% Inuse, 80K In, 104K Out - +.TP .B K: Kilobyte .TP .B M: Megabyte .TP +.B G: +Gigabyte +.TP .B %: 1/100 .TP From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 12:06:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0F8EE1065673; Sun, 23 Jan 2011 12:06:47 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 08B5B8FC17; Sun, 23 Jan 2011 12:06:45 +0000 (UTC) Received: by bwz12 with SMTP id 12so2937323bwz.13 for ; Sun, 23 Jan 2011 04:06:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:reply-to:x-mailer:mime-version:content-type :content-transfer-encoding; bh=9SNhwn54WZvx5i75eZkagfwEcZHap9lC6gt8k3/AeBk=; b=Np1SYfEg0h8aBRzcNAcRFvKbJC9qCcfw37rS+N3ogZzEtgb91iK66unxTq1ZuLI6Nm sfzSclReuuI6Do8q67wDxNKJvvJDI0Ln6c/Evon4HuOVJZQos3m6mZUcVki3KVWUoo2U JMDom9zQUTPZs54Nzc76lSC+pcbehDi+c1nVM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=HjDwD/cQOwC1mWUunx4uckqbDRVUgSZc9a3+us2npzBppDd49ptisjETT93SME1LFZ TM0LHp20hPu/E+sGKlkq2TqPJLNUO3RbdWgjU5SqZlAZlreOX89jSzCUARVi0E1xbW2U 5WAHgqT97+JEEBURLrgAGNYoQ1v7jbRIX4Xzs= Received: by 10.204.66.79 with SMTP id m15mr2512266bki.124.1295784404451; Sun, 23 Jan 2011 04:06:44 -0800 (PST) Received: from ernst.jennejohn.org (p578E2276.dip.t-dialin.net [87.142.34.118]) by mx.google.com with ESMTPS id rc9sm4084668bkb.2.2011.01.23.04.06.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Jan 2011 04:06:43 -0800 (PST) Date: Sun, 23 Jan 2011 13:06:41 +0100 From: Gary Jennejohn To: Hans Petter Selasky Message-ID: <20110123130641.7653ea79@ernst.jennejohn.org> In-Reply-To: <201101231019.02603.hselasky@freebsd.org> References: <201101221352.p0MDqNt3093630@svn.freebsd.org> <20110122160918.373f8670@ernst.jennejohn.org> <201101231019.02603.hselasky@freebsd.org> X-Mailer: Claws Mail 3.7.8 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" Subject: Re: svn commit: r217718 - in head/sys: conf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 12:06:47 -0000 On Sun, 23 Jan 2011 10:19:02 +0100 Hans Petter Selasky wrote: > On Saturday 22 January 2011 16:09:18 Gary Jennejohn wrote: > > On Sat, 22 Jan 2011 13:52:23 +0000 (UTC) > > > > Hans Petter Selasky wrote: > > > Author: hselasky > > > Date: Sat Jan 22 13:52:23 2011 > > > New Revision: 217718 > > > URL: http://svn.freebsd.org/changeset/base/217718 > > > > > > Log: > > > Allow USB_HOST_ALIGN to be configured at compile time. This patch is > > > necessary for MIPS based RouterStation Pro board and maybe other MIPS > > > based boards as well. > > > > > > Submitted by: Milan Obuch > > > Approved by: thompsa (mentor) > > > > > > Modified: > > > head/sys/conf/options > > > head/sys/dev/usb/usb_freebsd.h > > > > > > Modified: head/sys/conf/options > > > ========================================================================= > > > ===== --- head/sys/conf/options Sat Jan 22 13:18:28 2011 (r217717) > > > +++ head/sys/conf/options Sat Jan 22 13:52:23 2011 (r217718) > > > @@ -642,6 +642,7 @@ BUS_DEBUG opt_bus.h > > > > > > # options for USB support > > > USB_DEBUG opt_usb.h > > > > > > +USB_HOST_ALIGN opt_usb.h > > Sorry I didn't see this option sneaking in during r217631 :-) Anyway, two > times is better than one time :-) > > > > > > > USB_REQ_DEBUG opt_usb.h > > > USB_VERBOSE opt_usb.h > > > USB_EHCI_BIG_ENDIAN_DESC opt_usb.h > > > > > > Modified: head/sys/dev/usb/usb_freebsd.h > > > ========================================================================= > > > ===== --- head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:18:28 > > > 2011 (r217717) +++ head/sys/dev/usb/usb_freebsd.h Sat Jan 22 13:52:23 > > > 2011 (r217718) @@ -46,7 +46,12 @@ > > > > > > #define USB_TD_GET_PROC(td) (td)->td_proc > > > #define USB_PROC_GET_GID(td) (td)->p_pgid > > > > > > +#if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) > > > +/* USB_HOST_ALIGN is already defined and valid */ > > > > Not necessarily valid. What if the user sets it to -24? The compiler > > will happily accept that with the above #if-statement. > > > > IMO you should test for USB_HOST_ALIGN > 0, which should always work. > > > > Defensive programming is always a good idea. > > I agree. > > Does this look OK: > > #if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) > #if (-USB_HOST_ALIGN & USB_HOST_ALIGN) == USB_HOST_ALIGN > #error "USB_HOST_ALIGN is not power of two." > #endif > #if (USB_HOST_ALIGN <= 0) > #error "USB_HOST_ALIGN is less than or equal to zero." > #endif > > ... Looks OK to me. Rather convoluted, but the #else down below makes that necessary, I guess. > > > > > +#else > > > +#undef USB_HOST_ALIGN > > > > > > #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ > > > > > > +#endif > > > > > > #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ > > > #define USB_BUS_MAX 256 /* units */ > > > #define USB_MAX_DEVICES 128 /* units */ > -- Gary Jennejohn From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 12:44:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DEF31065670; Sun, 23 Jan 2011 12:44:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D4408FC0A; Sun, 23 Jan 2011 12:44:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NCiHEl055536; Sun, 23 Jan 2011 12:44:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NCiH5m055534; Sun, 23 Jan 2011 12:44:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101231244.p0NCiH5m055534@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 23 Jan 2011 12:44:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217747 - head/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 12:44:17 -0000 Author: kib Date: Sun Jan 23 12:44:17 2011 New Revision: 217747 URL: http://svn.freebsd.org/changeset/base/217747 Log: Fix typo. MFC after: 3 days Modified: head/sys/sys/pioctl.h Modified: head/sys/sys/pioctl.h ============================================================================== --- head/sys/sys/pioctl.h Sun Jan 23 11:08:39 2011 (r217746) +++ head/sys/sys/pioctl.h Sun Jan 23 12:44:17 2011 (r217747) @@ -69,7 +69,7 @@ struct procfs_status { /* * If PF_LINGER is set in procp->p_pfsflags, then the last close - * of a /proc//mem file will nto clear out the stops and continue + * of a /proc//mem file will not clear out the stops and continue * the process. */ From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 13:00:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B3E31065674; Sun, 23 Jan 2011 13:00:25 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 602BB8FC0C; Sun, 23 Jan 2011 13:00:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ND0PmD055938; Sun, 23 Jan 2011 13:00:25 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ND0PZi055936; Sun, 23 Jan 2011 13:00:25 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101231300.p0ND0PZi055936@svn.freebsd.org> From: Lawrence Stewart Date: Sun, 23 Jan 2011 13:00:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217748 - head/sys/netinet/cc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 13:00:25 -0000 Author: lstewart Date: Sun Jan 23 13:00:25 2011 New Revision: 217748 URL: http://svn.freebsd.org/changeset/base/217748 Log: An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK when a write to the buffer causes it to overflow. We therefore can't hold the CC list rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_AUTOEXTEND. Switch to a fixed length sbuf which should be of sufficient size except in the very unlikely event that the sysctl is being processed as one or more new algorithms are loaded. If that happens, we accept the race and may fail the sysctl gracefully if there is insufficient room to print the names of all the algorithms. This should address a WITNESS warning and the potential panic that would occur if the sbuf call to malloc did sleep whilst holding the CC list rwlock. Sponsored by: FreeBSD Foundation Reported by: Nick Hibma Reviewed by: bz MFC after: 3 weeks X-MFC with: r215166 Modified: head/sys/netinet/cc/cc.c Modified: head/sys/netinet/cc/cc.c ============================================================================== --- head/sys/netinet/cc/cc.c Sun Jan 23 12:44:17 2011 (r217747) +++ head/sys/netinet/cc/cc.c Sun Jan 23 13:00:25 2011 (r217748) @@ -128,20 +128,37 @@ cc_list_available(SYSCTL_HANDLER_ARGS) { struct cc_algo *algo; struct sbuf *s; - int err, first; + int err, first, nalgos; - err = 0; + err = nalgos = 0; first = 1; - s = sbuf_new(NULL, NULL, TCP_CA_NAME_MAX, SBUF_AUTOEXTEND); + + CC_LIST_RLOCK(); + STAILQ_FOREACH(algo, &cc_list, entries) { + nalgos++; + } + CC_LIST_RUNLOCK(); + + s = sbuf_new(NULL, NULL, nalgos * TCP_CA_NAME_MAX, SBUF_FIXEDLEN); if (s == NULL) return (ENOMEM); + /* + * It is theoretically possible for the CC list to have grown in size + * since the call to sbuf_new() and therefore for the sbuf to be too + * small. If this were to happen (incredibly unlikely), the sbuf will + * reach an overflow condition, sbuf_printf() will return an error and + * the sysctl will fail gracefully. + */ CC_LIST_RLOCK(); STAILQ_FOREACH(algo, &cc_list, entries) { err = sbuf_printf(s, first ? "%s" : ", %s", algo->name); - if (err) + if (err) { + /* Sbuf overflow condition. */ + err = EOVERFLOW; break; + } first = 0; } CC_LIST_RUNLOCK(); From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 14:09:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43B66106564A; Sun, 23 Jan 2011 14:09:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32AAA8FC14; Sun, 23 Jan 2011 14:09:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NE901i057451; Sun, 23 Jan 2011 14:09:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NE90Zc057449; Sun, 23 Jan 2011 14:09:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201101231409.p0NE90Zc057449@svn.freebsd.org> From: Ed Maste Date: Sun, 23 Jan 2011 14:09:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217749 - head/gnu/usr.bin/gdb/kgdb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:09:00 -0000 Author: emaste Date: Sun Jan 23 14:08:59 2011 New Revision: 217749 URL: http://svn.freebsd.org/changeset/base/217749 Log: Use string literal format strings to quiet clang warnings. Modified: head/gnu/usr.bin/gdb/kgdb/main.c Modified: head/gnu/usr.bin/gdb/kgdb/main.c ============================================================================== --- head/gnu/usr.bin/gdb/kgdb/main.c Sun Jan 23 13:00:25 2011 (r217748) +++ head/gnu/usr.bin/gdb/kgdb/main.c Sun Jan 23 14:08:59 2011 (r217749) @@ -129,7 +129,7 @@ kernel_from_dumpnr(int nr) snprintf(path, sizeof(path), "%s/info.%d", crashdir, nr); info = fopen(path, "r"); if (info == NULL) { - warn(path); + warn("%s", path); return; } while (fgets(path, sizeof(path), info) != NULL) { @@ -408,7 +408,7 @@ main(int argc, char *argv[]) if (dumpnr >= 0) { snprintf(path, sizeof(path), "%s/vmcore.%d", crashdir, dumpnr); if (stat(path, &st) == -1) - err(1, path); + err(1, "%s", path); if (!S_ISREG(st.st_mode)) errx(1, "%s: not a regular file", path); vmcore = strdup(path); From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 14:22:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25E0F106564A; Sun, 23 Jan 2011 14:22:27 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14EC08FC19; Sun, 23 Jan 2011 14:22:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NEMQFk057829; Sun, 23 Jan 2011 14:22:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NEMQjZ057827; Sun, 23 Jan 2011 14:22:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101231422.p0NEMQjZ057827@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 23 Jan 2011 14:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217750 - head/sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:22:27 -0000 Author: jilles Date: Sun Jan 23 14:22:26 2011 New Revision: 217750 URL: http://svn.freebsd.org/changeset/base/217750 Log: init: Only run /etc/rc.shutdown if /etc/rc was run. It does not make sense to shut down daemons that were not started. In particular, this fixes loss of mixer settings when shutting down using shutdown(8), init(8) or ctrl+alt+del from single-user mode. If /etc/rc reboots, /etc/rc.shutdown is not run. Also fix segfaults and other erratic behaviour if init receives SIGHUP or SIGTSTP while in single-user mode. This commit does not attempt to fix any badness with signal handlers (assumption that pointers can be read and written atomically, EINTR race condition). I believe it does not make this badness any worse. Silence on: -arch@ Modified: head/sbin/init/init.c Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sun Jan 23 14:08:59 2011 (r217749) +++ head/sbin/init/init.c Sun Jan 23 14:22:26 2011 (r217750) @@ -122,6 +122,7 @@ static state_func_t multi_user(void); static state_func_t clean_ttys(void); static state_func_t catatonia(void); static state_func_t death(void); +static state_func_t death_single(void); static state_func_t run_script(const char *); @@ -136,6 +137,7 @@ int devfs; static void transition(state_t); static state_t requested_transition; +static state_t current_state = death_single; static void setctty(const char *); static const char *get_shell(void); @@ -559,8 +561,9 @@ static void transition(state_t s) { + current_state = s; for (;;) - s = (state_t) (*s)(); + current_state = (state_t) (*current_state)(); } /* @@ -796,7 +799,7 @@ runcom(void) * Returns 0 on success, otherwise the next transition to enter: * - single_user if fork/execv/waitpid failed, or if the script * terminated with a signal or exit code != 0. - * - death if a SIGTERM was delivered to init(8). + * - death_single if a SIGTERM was delivered to init(8). */ static state_func_t run_script(const char *script) @@ -852,8 +855,8 @@ run_script(const char *script) if ((wpid = waitpid(-1, &status, WUNTRACED)) != -1) collect_child(wpid); if (wpid == -1) { - if (requested_transition == death) - return (state_func_t) death; + if (requested_transition == death_single) + return (state_func_t) death_single; if (errno == EINTR) continue; warning("wait for %s on %s failed: %m; going to " @@ -1306,7 +1309,9 @@ transition_handler(int sig) switch (sig) { case SIGHUP: - requested_transition = clean_ttys; + if (current_state == read_ttys || current_state == multi_user || + current_state == clean_ttys || current_state == catatonia) + requested_transition = clean_ttys; break; case SIGUSR2: howto = RB_POWEROFF; @@ -1315,10 +1320,17 @@ transition_handler(int sig) case SIGINT: Reboot = TRUE; case SIGTERM: - requested_transition = death; + if (current_state == read_ttys || current_state == multi_user || + current_state == clean_ttys || current_state == catatonia) + requested_transition = death; + else + requested_transition = death_single; break; case SIGTSTP: - requested_transition = catatonia; + if (current_state == runcom || current_state == read_ttys || + current_state == clean_ttys || + current_state == multi_user || current_state == catatonia) + requested_transition = catatonia; break; default: requested_transition = 0; @@ -1494,9 +1506,6 @@ death(void) { struct utmpx utx; session_t *sp; - int i; - pid_t pid; - static const int death_sigs[2] = { SIGTERM, SIGKILL }; /* NB: should send a message to the session logger to avoid blocking. */ utx.ut_type = SHUTDOWN_TIME; @@ -1518,6 +1527,22 @@ death(void) /* Try to run the rc.shutdown script within a period of time */ runshutdown(); + return (state_func_t) death_single; +} + +/* + * Do what is necessary to reinitialize single user mode or reboot + * from an incomplete state. + */ +static state_func_t +death_single(void) +{ + int i; + pid_t pid; + static const int death_sigs[2] = { SIGTERM, SIGKILL }; + + revoke(_PATH_CONSOLE); + for (i = 0; i < 2; ++i) { if (kill(-1, death_sigs[i]) == -1 && errno == ESRCH) return (state_func_t) single_user; From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 14:30:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915F9106566C; Sun, 23 Jan 2011 14:30:35 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E31D8FC18; Sun, 23 Jan 2011 14:30:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NEUZ8u058091; Sun, 23 Jan 2011 14:30:35 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NEUZAU058089; Sun, 23 Jan 2011 14:30:35 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101231430.p0NEUZAU058089@svn.freebsd.org> From: Adrian Chadd Date: Sun, 23 Jan 2011 14:30:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217751 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:30:35 -0000 Author: adrian Date: Sun Jan 23 14:30:35 2011 New Revision: 217751 URL: http://svn.freebsd.org/changeset/base/217751 Log: Update the AR9280v2 inivals to match what is in Linux ath9k. This repairs the behaviour of my AR9280 - both radio chains now seem to correctly be receiving. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini Sun Jan 23 14:22:26 2011 (r217750) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280v2.ini Sun Jan 23 14:30:35 2011 (r217751) @@ -1,6 +1,5 @@ /* - * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting - * Copyright (c) 2002-2008 Atheros Communications, Inc. + * Copyright (c) 2010 Atheros Communications Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +15,6 @@ * * $FreeBSD$ */ -/* Auto Generated PCI Register Writes. Created: 10/15/08 */ static const uint32_t ar9280Modes_v2[][6] = { /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ @@ -26,51 +24,50 @@ static const uint32_t ar9280Modes_v2[][6 { 0x000010f0, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000008 }, { 0x00008014, 0x03e803e8, 0x07d007d0, 0x10801600, 0x08400b00, 0x06e006e0 }, { 0x0000801c, 0x128d8027, 0x128d804f, 0x12e00057, 0x12e0002b, 0x0988004f }, + { 0x00008120, 0x08f04800, 0x08f04800, 0x08f04810, 0x08f04810, 0x08f04810 }, + { 0x000081d0, 0x00003210, 0x00003210, 0x0000320a, 0x0000320a, 0x0000320a }, { 0x00008318, 0x00003e80, 0x00007d00, 0x00006880, 0x00003440, 0x00006880 }, { 0x00009804, 0x00000300, 0x000003c4, 0x000003c4, 0x00000300, 0x00000303 }, { 0x00009820, 0x02020200, 0x02020200, 0x02020200, 0x02020200, 0x02020200 }, - { 0x00009824, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, + { 0x00009824, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e, 0x01000e0e }, { 0x00009828, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001, 0x0a020001 }, { 0x00009834, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e, 0x00000e0e }, { 0x00009838, 0x00000007, 0x00000007, 0x00000007, 0x00000007, 0x00000007 }, { 0x00009840, 0x206a022e, 0x206a022e, 0x206a012e, 0x206a012e, 0x206a012e }, { 0x00009844, 0x0372161e, 0x0372161e, 0x037216a0, 0x037216a0, 0x037216a0 }, - { 0x00009850, 0x6c4000e2, 0x6c4000e2, 0x6d4000e2, 0x6c4000e2, 0x6c4000e2 }, + { 0x00009850, 0x6c4000e2, 0x6d4000e2, 0x6d4000e2, 0x6c4000e2, 0x6c4000e2 }, { 0x00009858, 0x7ec88d2e, 0x7ec88d2e, 0x7ec84d2e, 0x7ec84d2e, 0x7ec84d2e }, - { 0x0000985c, 0x31395d5e, 0x31395d5e, 0x3139605e, 0x31395d5e, 0x31395d5e }, + { 0x0000985c, 0x31395d5e, 0x3139605e, 0x3139605e, 0x31395d5e, 0x31395d5e }, { 0x00009860, 0x00048d18, 0x00048d18, 0x00048d20, 0x00048d20, 0x00048d18 }, { 0x00009864, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00, 0x0001ce00 }, { 0x00009868, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0, 0x5ac640d0 }, { 0x0000986c, 0x06903081, 0x06903081, 0x06903881, 0x06903881, 0x06903881 }, { 0x00009914, 0x000007d0, 0x00000fa0, 0x00001130, 0x00000898, 0x000007d0 }, - { 0x00009918, 0x0000000a, 0x00000014, 0x00000016, 0x0000000b, 0x00000016 }, + { 0x00009918, 0x0000000a, 0x00000014, 0x00000268, 0x0000000b, 0x00000016 }, { 0x00009924, 0xd00a8a0b, 0xd00a8a0b, 0xd00a8a0d, 0xd00a8a0d, 0xd00a8a0d }, { 0x00009944, 0xffbc1010, 0xffbc1010, 0xffbc1010, 0xffbc1010, 0xffbc1010 }, { 0x00009960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 }, { 0x0000a960, 0x00000010, 0x00000010, 0x00000010, 0x00000010, 0x00000010 }, { 0x00009964, 0x00000210, 0x00000210, 0x00000210, 0x00000210, 0x00000210 }, + { 0x0000c968, 0x000003b5, 0x000003b5, 0x000003ce, 0x000003ce, 0x000003ce }, { 0x000099b8, 0x0000001c, 0x0000001c, 0x0000001c, 0x0000001c, 0x0000001c }, { 0x000099bc, 0x00000a00, 0x00000a00, 0x00000c00, 0x00000c00, 0x00000c00 }, { 0x000099c0, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4, 0x05eea6d4 }, - { 0x000099c4, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77, 0x06336f77 }, - { 0x000099c8, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329, 0x60f65329 }, - { 0x000099cc, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8, 0x08f186c8 }, - { 0x000099d0, 0x00046384, 0x00046384, 0x00046384, 0x00046384, 0x00046384 }, - { 0x000099d4, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, - { 0x000099d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000a204, 0x00000444, 0x00000444, 0x00000444, 0x00000444, 0x00000444 }, { 0x0000a20c, 0x00000014, 0x00000014, 0x0001f019, 0x0001f019, 0x0001f019 }, { 0x0000b20c, 0x00000014, 0x00000014, 0x0001f019, 0x0001f019, 0x0001f019 }, { 0x0000a21c, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a, 0x1883800a }, { 0x0000a230, 0x00000000, 0x00000000, 0x00000210, 0x00000108, 0x00000000 }, + { 0x0000a23c, 0x13c88000, 0x13c88000, 0x13c88001, 0x13c88000, 0x13c88000 }, { 0x0000a250, 0x001ff000, 0x001ff000, 0x0004a000, 0x0004a000, 0x0004a000 }, - { 0x0000a274, 0x0a19c652, 0x0a19c652, 0x0a1aa652, 0x0a1aa652, 0x0a1aa652 }, { 0x0000a358, 0x7999aa02, 0x7999aa02, 0x7999aa0e, 0x7999aa0e, 0x7999aa0e }, + { 0x0000a388, 0x0c000000, 0x0c000000, 0x08000000, 0x0c000000, 0x0c000000 }, { 0x0000a3d8, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x00007894, 0x5a508000, 0x5a508000, 0x5a508000, 0x5a508000, 0x5a508000 }, }; static const uint32_t ar9280Common_v2[][2] = { + /* Addr allmodes */ { 0x0000000c, 0x00000000 }, { 0x00000030, 0x00020015 }, { 0x00000034, 0x00000005 }, @@ -196,7 +193,6 @@ static const uint32_t ar9280Common_v2[][ { 0x00008110, 0x00000168 }, { 0x00008118, 0x000100aa }, { 0x0000811c, 0x00003210 }, - { 0x00008120, 0x08f04800 }, { 0x00008124, 0x00000000 }, { 0x00008128, 0x00000000 }, { 0x0000812c, 0x00000000 }, @@ -212,7 +208,6 @@ static const uint32_t ar9280Common_v2[][ { 0x00008178, 0x00000100 }, { 0x0000817c, 0x00000000 }, { 0x000081c0, 0x00000000 }, - { 0x000081d0, 0x00003210 }, { 0x000081ec, 0x00000000 }, { 0x000081f0, 0x00000000 }, { 0x000081f4, 0x00000000 }, @@ -243,7 +238,7 @@ static const uint32_t ar9280Common_v2[][ { 0x00008258, 0x00000000 }, { 0x0000825c, 0x400000ff }, { 0x00008260, 0x00080922 }, - { 0x00008264, 0xa8a00010 }, + { 0x00008264, 0x88a00010 }, { 0x00008270, 0x00000000 }, { 0x00008274, 0x40000000 }, { 0x00008278, 0x003e4180 }, @@ -263,7 +258,7 @@ static const uint32_t ar9280Common_v2[][ { 0x00008338, 0x00ff0000 }, { 0x0000833c, 0x00000000 }, { 0x00008340, 0x000107ff }, - { 0x00008344, 0x00581043 }, + { 0x00008344, 0x00481043 }, { 0x00009808, 0x00000000 }, { 0x0000980c, 0xafa68e30 }, { 0x00009810, 0xfd14e000 }, @@ -294,8 +289,7 @@ static const uint32_t ar9280Common_v2[][ { 0x00009958, 0x2108ecff }, { 0x00009940, 0x14750604 }, { 0x0000c95c, 0x004b6a8e }, - { 0x00009968, 0x000003ce }, - { 0x00009970, 0x190fb515 }, + { 0x00009970, 0x190fb514 }, { 0x00009974, 0x00000000 }, { 0x00009978, 0x00000001 }, { 0x0000997c, 0x00000000 }, @@ -313,6 +307,12 @@ static const uint32_t ar9280Common_v2[][ { 0x000099ac, 0x006f0000 }, { 0x000099b0, 0x03051000 }, { 0x000099b4, 0x00000820 }, + { 0x000099c4, 0x06336f77 }, + { 0x000099c8, 0x6af6532f }, + { 0x000099cc, 0x08f186c8 }, + { 0x000099d0, 0x00046384 }, + { 0x000099d4, 0x00000000 }, + { 0x000099d8, 0x00000000 }, { 0x000099dc, 0x00000000 }, { 0x000099e0, 0x00000000 }, { 0x000099e4, 0xaaaaaaaa }, @@ -330,7 +330,6 @@ static const uint32_t ar9280Common_v2[][ { 0x0000a22c, 0x233f7180 }, { 0x0000a234, 0x20202020 }, { 0x0000a238, 0x20202020 }, - { 0x0000a23c, 0x13c88000 }, { 0x0000a240, 0x38490a20 }, { 0x0000a244, 0x00007bb6 }, { 0x0000a248, 0x0fff3ffc }, @@ -340,8 +339,8 @@ static const uint32_t ar9280Common_v2[][ { 0x0000a25c, 0x0f0f0f01 }, { 0x0000a260, 0xdfa91f01 }, { 0x0000a268, 0x00000000 }, - { 0x0000a26c, 0x0ebae9c6 }, - { 0x0000b26c, 0x0ebae9c6 }, + { 0x0000a26c, 0x0e79e5c6 }, + { 0x0000b26c, 0x0e79e5c6 }, { 0x0000d270, 0x00820820 }, { 0x0000a278, 0x1ce739ce }, { 0x0000d35c, 0x07ffffef }, @@ -355,7 +354,6 @@ static const uint32_t ar9280Common_v2[][ { 0x0000d37c, 0x7fffffe2 }, { 0x0000d380, 0x7f3c7bba }, { 0x0000d384, 0xf3307ff0 }, - { 0x0000a388, 0x0c000000 }, { 0x0000a38c, 0x20202020 }, { 0x0000a390, 0x20202020 }, { 0x0000a394, 0x1ce739ce }, @@ -379,23 +377,18 @@ static const uint32_t ar9280Common_v2[][ { 0x0000a3e0, 0x000001ce }, { 0x0000a3e4, 0x00000000 }, { 0x0000a3e8, 0x18c43433 }, - { 0x0000a3ec, 0x00f70081 }, { 0x00007800, 0x00040000 }, { 0x00007804, 0xdb005012 }, { 0x00007808, 0x04924914 }, { 0x0000780c, 0x21084210 }, { 0x00007810, 0x6d801300 }, { 0x00007818, 0x07e41000 }, - { 0x0000781c, 0x00392000 }, - { 0x00007820, 0x92592480 }, { 0x00007824, 0x00040000 }, { 0x00007828, 0xdb005012 }, { 0x0000782c, 0x04924914 }, { 0x00007830, 0x21084210 }, { 0x00007834, 0x6d801300 }, { 0x0000783c, 0x07e40000 }, - { 0x00007840, 0x00392000 }, - { 0x00007844, 0x92592480 }, { 0x00007848, 0x00100000 }, { 0x0000784c, 0x773f0567 }, { 0x00007850, 0x54214514 }, @@ -418,7 +411,7 @@ static const uint32_t ar9280Common_v2[][ }; static const uint32_t ar9280Modes_fast_clock_v2[][3] = { - /* Address 5G-HT20 5G-HT40 */ + /* Addr 5G_HT20 5G_HT40 */ { 0x00001030, 0x00000268, 0x000004d0 }, { 0x00001070, 0x0000018c, 0x00000318 }, { 0x000010b0, 0x00000fd0, 0x00001fa0 }, @@ -426,13 +419,12 @@ static const uint32_t ar9280Modes_fast_c { 0x0000801c, 0x148ec02b, 0x148ec057 }, { 0x00008318, 0x000044c0, 0x00008980 }, { 0x00009820, 0x02020200, 0x02020200 }, - { 0x00009824, 0x00000f0f, 0x00000f0f }, + { 0x00009824, 0x01000f0f, 0x01000f0f }, { 0x00009828, 0x0b020001, 0x0b020001 }, { 0x00009834, 0x00000f0f, 0x00000f0f }, { 0x00009844, 0x03721821, 0x03721821 }, { 0x00009914, 0x00000898, 0x00001130 }, { 0x00009918, 0x0000000b, 0x00000016 }, - { 0x00009944, 0xdfbc1210, 0xdfbc1210 }, }; static const uint32_t ar9280Modes_backoff_23db_rxgain_v2[][6] = { @@ -486,96 +478,96 @@ static const uint32_t ar9280Modes_backof { 0x00009ab8, 0x0000af84, 0x0000af84, 0x00008b08, 0x00008b08, 0x00008b08 }, { 0x00009abc, 0x0000af88, 0x0000af88, 0x00008b0c, 0x00008b0c, 0x00008b0c }, { 0x00009ac0, 0x0000af8c, 0x0000af8c, 0x00008b10, 0x00008b10, 0x00008b10 }, - { 0x00009ac4, 0x0000af90, 0x0000af90, 0x00008b14, 0x00008b14, 0x00008b14 }, - { 0x00009ac8, 0x0000af94, 0x0000af94, 0x00008b01, 0x00008b01, 0x00008b01 }, - { 0x00009acc, 0x0000b380, 0x0000b380, 0x00008b05, 0x00008b05, 0x00008b05 }, - { 0x00009ad0, 0x0000b384, 0x0000b384, 0x00008b09, 0x00008b09, 0x00008b09 }, - { 0x00009ad4, 0x0000b388, 0x0000b388, 0x00008b0d, 0x00008b0d, 0x00008b0d }, - { 0x00009ad8, 0x0000b38c, 0x0000b38c, 0x00008b11, 0x00008b11, 0x00008b11 }, - { 0x00009adc, 0x0000b390, 0x0000b390, 0x00008b15, 0x00008b15, 0x00008b15 }, - { 0x00009ae0, 0x0000b394, 0x0000b394, 0x00008b02, 0x00008b02, 0x00008b02 }, - { 0x00009ae4, 0x0000b398, 0x0000b398, 0x00008b06, 0x00008b06, 0x00008b06 }, - { 0x00009ae8, 0x0000b780, 0x0000b780, 0x00008b0a, 0x00008b0a, 0x00008b0a }, - { 0x00009aec, 0x0000b784, 0x0000b784, 0x00008b0e, 0x00008b0e, 0x00008b0e }, - { 0x00009af0, 0x0000b788, 0x0000b788, 0x00008b12, 0x00008b12, 0x00008b12 }, - { 0x00009af4, 0x0000b78c, 0x0000b78c, 0x00008b16, 0x00008b16, 0x00008b16 }, - { 0x00009af8, 0x0000b790, 0x0000b790, 0x00008b03, 0x00008b03, 0x00008b03 }, - { 0x00009afc, 0x0000b794, 0x0000b794, 0x00008b07, 0x00008b07, 0x00008b07 }, - { 0x00009b00, 0x0000b798, 0x0000b798, 0x00008b0b, 0x00008b0b, 0x00008b0b }, - { 0x00009b04, 0x0000d784, 0x0000d784, 0x00008b0f, 0x00008b0f, 0x00008b0f }, - { 0x00009b08, 0x0000d788, 0x0000d788, 0x00008b13, 0x00008b13, 0x00008b13 }, - { 0x00009b0c, 0x0000d78c, 0x0000d78c, 0x00008b17, 0x00008b17, 0x00008b17 }, - { 0x00009b10, 0x0000d790, 0x0000d790, 0x00008b23, 0x00008b23, 0x00008b23 }, - { 0x00009b14, 0x0000f780, 0x0000f780, 0x00008b27, 0x00008b27, 0x00008b27 }, - { 0x00009b18, 0x0000f784, 0x0000f784, 0x00008b2b, 0x00008b2b, 0x00008b2b }, - { 0x00009b1c, 0x0000f788, 0x0000f788, 0x00008b2f, 0x00008b2f, 0x00008b2f }, - { 0x00009b20, 0x0000f78c, 0x0000f78c, 0x00008b33, 0x00008b33, 0x00008b33 }, - { 0x00009b24, 0x0000f790, 0x0000f790, 0x00008b37, 0x00008b37, 0x00008b37 }, - { 0x00009b28, 0x0000f794, 0x0000f794, 0x00008b43, 0x00008b43, 0x00008b43 }, - { 0x00009b2c, 0x0000f7a4, 0x0000f7a4, 0x00008b47, 0x00008b47, 0x00008b47 }, - { 0x00009b30, 0x0000f7a8, 0x0000f7a8, 0x00008b4b, 0x00008b4b, 0x00008b4b }, - { 0x00009b34, 0x0000f7ac, 0x0000f7ac, 0x00008b4f, 0x00008b4f, 0x00008b4f }, - { 0x00009b38, 0x0000f7b0, 0x0000f7b0, 0x00008b53, 0x00008b53, 0x00008b53 }, - { 0x00009b3c, 0x0000f7b4, 0x0000f7b4, 0x00008b57, 0x00008b57, 0x00008b57 }, - { 0x00009b40, 0x0000f7a1, 0x0000f7a1, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b44, 0x0000f7a5, 0x0000f7a5, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b48, 0x0000f7a9, 0x0000f7a9, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b4c, 0x0000f7ad, 0x0000f7ad, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b50, 0x0000f7b1, 0x0000f7b1, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b54, 0x0000f7b5, 0x0000f7b5, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b58, 0x0000f7c5, 0x0000f7c5, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b5c, 0x0000f7c9, 0x0000f7c9, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b60, 0x0000f7cd, 0x0000f7cd, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b64, 0x0000f7d1, 0x0000f7d1, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b68, 0x0000f7d5, 0x0000f7d5, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b6c, 0x0000f7c2, 0x0000f7c2, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b70, 0x0000f7c6, 0x0000f7c6, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b74, 0x0000f7ca, 0x0000f7ca, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b78, 0x0000f7ce, 0x0000f7ce, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b7c, 0x0000f7d2, 0x0000f7d2, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b80, 0x0000f7d6, 0x0000f7d6, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b84, 0x0000f7c3, 0x0000f7c3, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b88, 0x0000f7c7, 0x0000f7c7, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b8c, 0x0000f7cb, 0x0000f7cb, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b90, 0x0000f7d3, 0x0000f7d3, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b94, 0x0000f7d7, 0x0000f7d7, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b98, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009b9c, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009ba0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009ba4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009ba8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bac, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bb0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bb4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bb8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bbc, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bc0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bc4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bc8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bcc, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bd0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bd4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bd8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bdc, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009be0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009be4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009be8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bec, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bf0, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bf4, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bf8, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009bfc, 0x0000f7db, 0x0000f7db, 0x00008b5b, 0x00008b5b, 0x00008b5b }, - { 0x00009848, 0x00001066, 0x00001066, 0x00001050, 0x00001050, 0x00001050 }, - { 0x0000a848, 0x00001066, 0x00001066, 0x00001050, 0x00001050, 0x00001050 }, + { 0x00009ac4, 0x0000af90, 0x0000af90, 0x00008b80, 0x00008b80, 0x00008b80 }, + { 0x00009ac8, 0x0000af94, 0x0000af94, 0x00008b84, 0x00008b84, 0x00008b84 }, + { 0x00009acc, 0x0000b380, 0x0000b380, 0x00008b88, 0x00008b88, 0x00008b88 }, + { 0x00009ad0, 0x0000b384, 0x0000b384, 0x00008b8c, 0x00008b8c, 0x00008b8c }, + { 0x00009ad4, 0x0000b388, 0x0000b388, 0x00008b90, 0x00008b90, 0x00008b90 }, + { 0x00009ad8, 0x0000b38c, 0x0000b38c, 0x00008b94, 0x00008b94, 0x00008b94 }, + { 0x00009adc, 0x0000b390, 0x0000b390, 0x00008b98, 0x00008b98, 0x00008b98 }, + { 0x00009ae0, 0x0000b394, 0x0000b394, 0x00008ba4, 0x00008ba4, 0x00008ba4 }, + { 0x00009ae4, 0x0000b398, 0x0000b398, 0x00008ba8, 0x00008ba8, 0x00008ba8 }, + { 0x00009ae8, 0x0000b780, 0x0000b780, 0x00008bac, 0x00008bac, 0x00008bac }, + { 0x00009aec, 0x0000b784, 0x0000b784, 0x00008bb0, 0x00008bb0, 0x00008bb0 }, + { 0x00009af0, 0x0000b788, 0x0000b788, 0x00008bb4, 0x00008bb4, 0x00008bb4 }, + { 0x00009af4, 0x0000b78c, 0x0000b78c, 0x00008ba1, 0x00008ba1, 0x00008ba1 }, + { 0x00009af8, 0x0000b790, 0x0000b790, 0x00008ba5, 0x00008ba5, 0x00008ba5 }, + { 0x00009afc, 0x0000b794, 0x0000b794, 0x00008ba9, 0x00008ba9, 0x00008ba9 }, + { 0x00009b00, 0x0000b798, 0x0000b798, 0x00008bad, 0x00008bad, 0x00008bad }, + { 0x00009b04, 0x0000d784, 0x0000d784, 0x00008bb1, 0x00008bb1, 0x00008bb1 }, + { 0x00009b08, 0x0000d788, 0x0000d788, 0x00008bb5, 0x00008bb5, 0x00008bb5 }, + { 0x00009b0c, 0x0000d78c, 0x0000d78c, 0x00008ba2, 0x00008ba2, 0x00008ba2 }, + { 0x00009b10, 0x0000d790, 0x0000d790, 0x00008ba6, 0x00008ba6, 0x00008ba6 }, + { 0x00009b14, 0x0000f780, 0x0000f780, 0x00008baa, 0x00008baa, 0x00008baa }, + { 0x00009b18, 0x0000f784, 0x0000f784, 0x00008bae, 0x00008bae, 0x00008bae }, + { 0x00009b1c, 0x0000f788, 0x0000f788, 0x00008bb2, 0x00008bb2, 0x00008bb2 }, + { 0x00009b20, 0x0000f78c, 0x0000f78c, 0x00008bb6, 0x00008bb6, 0x00008bb6 }, + { 0x00009b24, 0x0000f790, 0x0000f790, 0x00008ba3, 0x00008ba3, 0x00008ba3 }, + { 0x00009b28, 0x0000f794, 0x0000f794, 0x00008ba7, 0x00008ba7, 0x00008ba7 }, + { 0x00009b2c, 0x0000f7a4, 0x0000f7a4, 0x00008bab, 0x00008bab, 0x00008bab }, + { 0x00009b30, 0x0000f7a8, 0x0000f7a8, 0x00008baf, 0x00008baf, 0x00008baf }, + { 0x00009b34, 0x0000f7ac, 0x0000f7ac, 0x00008bb3, 0x00008bb3, 0x00008bb3 }, + { 0x00009b38, 0x0000f7b0, 0x0000f7b0, 0x00008bb7, 0x00008bb7, 0x00008bb7 }, + { 0x00009b3c, 0x0000f7b4, 0x0000f7b4, 0x00008bc3, 0x00008bc3, 0x00008bc3 }, + { 0x00009b40, 0x0000f7a1, 0x0000f7a1, 0x00008bc7, 0x00008bc7, 0x00008bc7 }, + { 0x00009b44, 0x0000f7a5, 0x0000f7a5, 0x00008bcb, 0x00008bcb, 0x00008bcb }, + { 0x00009b48, 0x0000f7a9, 0x0000f7a9, 0x00008bcf, 0x00008bcf, 0x00008bcf }, + { 0x00009b4c, 0x0000f7ad, 0x0000f7ad, 0x00008bd3, 0x00008bd3, 0x00008bd3 }, + { 0x00009b50, 0x0000f7b1, 0x0000f7b1, 0x00008bd7, 0x00008bd7, 0x00008bd7 }, + { 0x00009b54, 0x0000f7b5, 0x0000f7b5, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b58, 0x0000f7c5, 0x0000f7c5, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b5c, 0x0000f7c9, 0x0000f7c9, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b60, 0x0000f7cd, 0x0000f7cd, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b64, 0x0000f7d1, 0x0000f7d1, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b68, 0x0000f7d5, 0x0000f7d5, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b6c, 0x0000f7c2, 0x0000f7c2, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b70, 0x0000f7c6, 0x0000f7c6, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b74, 0x0000f7ca, 0x0000f7ca, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b78, 0x0000f7ce, 0x0000f7ce, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b7c, 0x0000f7d2, 0x0000f7d2, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b80, 0x0000f7d6, 0x0000f7d6, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b84, 0x0000f7c3, 0x0000f7c3, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b88, 0x0000f7c7, 0x0000f7c7, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b8c, 0x0000f7cb, 0x0000f7cb, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b90, 0x0000f7d3, 0x0000f7d3, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b94, 0x0000f7d7, 0x0000f7d7, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b98, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009b9c, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009ba0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009ba4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009ba8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bac, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bb0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bb4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bb8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bbc, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bc0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bc4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bc8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bcc, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bd0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bd4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bd8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bdc, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009be0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009be4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009be8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bec, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bf0, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bf4, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bf8, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009bfc, 0x0000f7db, 0x0000f7db, 0x00008bdb, 0x00008bdb, 0x00008bdb }, + { 0x00009848, 0x00001066, 0x00001066, 0x00001055, 0x00001055, 0x00001055 }, + { 0x0000a848, 0x00001066, 0x00001066, 0x00001055, 0x00001055, 0x00001055 }, }; static const uint32_t ar9280Modes_original_rxgain_v2[][6] = { /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ - { 0x00009a00, 0x00008184, 0x00008184, 0x00000290, 0x00000290, 0x00000290 }, - { 0x00009a04, 0x00008188, 0x00008188, 0x00000300, 0x00000300, 0x00000300 }, - { 0x00009a08, 0x0000818c, 0x0000818c, 0x00000304, 0x00000304, 0x00000304 }, - { 0x00009a0c, 0x00008190, 0x00008190, 0x00000308, 0x00000308, 0x00000308 }, - { 0x00009a10, 0x00008194, 0x00008194, 0x0000030c, 0x0000030c, 0x0000030c }, + { 0x00009a00, 0x00008184, 0x00008184, 0x00008000, 0x00008000, 0x00008000 }, + { 0x00009a04, 0x00008188, 0x00008188, 0x00008000, 0x00008000, 0x00008000 }, + { 0x00009a08, 0x0000818c, 0x0000818c, 0x00008000, 0x00008000, 0x00008000 }, + { 0x00009a0c, 0x00008190, 0x00008190, 0x00008000, 0x00008000, 0x00008000 }, + { 0x00009a10, 0x00008194, 0x00008194, 0x00008000, 0x00008000, 0x00008000 }, { 0x00009a14, 0x00008200, 0x00008200, 0x00008000, 0x00008000, 0x00008000 }, { 0x00009a18, 0x00008204, 0x00008204, 0x00008004, 0x00008004, 0x00008004 }, { 0x00009a1c, 0x00008208, 0x00008208, 0x00008008, 0x00008008, 0x00008008 }, @@ -839,6 +831,8 @@ static const uint32_t ar9280Modes_backof static const uint32_t ar9280Modes_high_power_tx_gain_v2[][6] = { /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ + { 0x0000a274, 0x0a19e652, 0x0a19e652, 0x0a1aa652, 0x0a1aa652, 0x0a1aa652 }, + { 0x0000a27c, 0x050739ce, 0x050739ce, 0x050739ce, 0x050739ce, 0x050739ce }, { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000a304, 0x00003002, 0x00003002, 0x00004002, 0x00004002, 0x00004002 }, { 0x0000a308, 0x00006004, 0x00006004, 0x00007008, 0x00007008, 0x00007008 }, @@ -848,26 +842,32 @@ static const uint32_t ar9280Modes_high_p { 0x0000a318, 0x0001504a, 0x0001504a, 0x0001820a, 0x0001820a, 0x0001820a }, { 0x0000a31c, 0x0001904c, 0x0001904c, 0x0001b211, 0x0001b211, 0x0001b211 }, { 0x0000a320, 0x0001c04e, 0x0001c04e, 0x0001e213, 0x0001e213, 0x0001e213 }, - { 0x0000a324, 0x00020092, 0x00020092, 0x00022411, 0x00022411, 0x00022411 }, - { 0x0000a328, 0x0002410a, 0x0002410a, 0x00025413, 0x00025413, 0x00025413 }, - { 0x0000a32c, 0x0002710c, 0x0002710c, 0x00029811, 0x00029811, 0x00029811 }, - { 0x0000a330, 0x0002b18b, 0x0002b18b, 0x0002c813, 0x0002c813, 0x0002c813 }, - { 0x0000a334, 0x0002e1cc, 0x0002e1cc, 0x00030a14, 0x00030a14, 0x00030a14 }, - { 0x0000a338, 0x000321ec, 0x000321ec, 0x00035a50, 0x00035a50, 0x00035a50 }, - { 0x0000a33c, 0x000321ec, 0x000321ec, 0x00039c4c, 0x00039c4c, 0x00039c4c }, - { 0x0000a340, 0x000321ec, 0x000321ec, 0x0003de8a, 0x0003de8a, 0x0003de8a }, - { 0x0000a344, 0x000321ec, 0x000321ec, 0x00042e92, 0x00042e92, 0x00042e92 }, - { 0x0000a348, 0x000321ec, 0x000321ec, 0x00046ed2, 0x00046ed2, 0x00046ed2 }, - { 0x0000a34c, 0x000321ec, 0x000321ec, 0x0004bed5, 0x0004bed5, 0x0004bed5 }, - { 0x0000a350, 0x000321ec, 0x000321ec, 0x0004ff54, 0x0004ff54, 0x0004ff54 }, - { 0x0000a354, 0x000321ec, 0x000321ec, 0x00053fd5, 0x00053fd5, 0x00053fd5 }, + { 0x0000a324, 0x00021092, 0x00021092, 0x00022411, 0x00022411, 0x00022411 }, + { 0x0000a328, 0x0002510a, 0x0002510a, 0x00025413, 0x00025413, 0x00025413 }, + { 0x0000a32c, 0x0002910c, 0x0002910c, 0x00029811, 0x00029811, 0x00029811 }, + { 0x0000a330, 0x0002c18b, 0x0002c18b, 0x0002c813, 0x0002c813, 0x0002c813 }, + { 0x0000a334, 0x0002f1cc, 0x0002f1cc, 0x00030a14, 0x00030a14, 0x00030a14 }, + { 0x0000a338, 0x000321eb, 0x000321eb, 0x00035a50, 0x00035a50, 0x00035a50 }, + { 0x0000a33c, 0x000341ec, 0x000341ec, 0x00039c4c, 0x00039c4c, 0x00039c4c }, + { 0x0000a340, 0x000341ec, 0x000341ec, 0x0003de8a, 0x0003de8a, 0x0003de8a }, + { 0x0000a344, 0x000341ec, 0x000341ec, 0x00042e92, 0x00042e92, 0x00042e92 }, + { 0x0000a348, 0x000341ec, 0x000341ec, 0x00046ed2, 0x00046ed2, 0x00046ed2 }, + { 0x0000a34c, 0x000341ec, 0x000341ec, 0x0004bed5, 0x0004bed5, 0x0004bed5 }, + { 0x0000a350, 0x000341ec, 0x000341ec, 0x0004ff54, 0x0004ff54, 0x0004ff54 }, + { 0x0000a354, 0x000341ec, 0x000341ec, 0x00055fd5, 0x00055fd5, 0x00055fd5 }, + { 0x0000a3ec, 0x00f70081, 0x00f70081, 0x00f70081, 0x00f70081, 0x00f70081 }, { 0x00007814, 0x00198eff, 0x00198eff, 0x00198eff, 0x00198eff, 0x00198eff }, { 0x00007838, 0x00198eff, 0x00198eff, 0x00198eff, 0x00198eff, 0x00198eff }, - { 0x0000a27c, 0x050739ce, 0x050739ce, 0x050739ce, 0x050739ce, 0x050739ce }, + { 0x0000781c, 0x00172000, 0x00172000, 0x00172000, 0x00172000, 0x00172000 }, + { 0x00007840, 0x00172000, 0x00172000, 0x00172000, 0x00172000, 0x00172000 }, + { 0x00007820, 0xf258a480, 0xf258a480, 0xf258a480, 0xf258a480, 0xf258a480 }, + { 0x00007844, 0xf258a480, 0xf258a480, 0xf258a480, 0xf258a480, 0xf258a480 }, }; static const uint32_t ar9280Modes_original_tx_gain_v2[][6] = { /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ + { 0x0000a274, 0x0a19c652, 0x0a19c652, 0x0a1aa652, 0x0a1aa652, 0x0a1aa652 }, + { 0x0000a27c, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce }, { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, { 0x0000a304, 0x00003002, 0x00003002, 0x00003002, 0x00003002, 0x00003002 }, { 0x0000a308, 0x00006004, 0x00006004, 0x00008009, 0x00008009, 0x00008009 }, @@ -890,14 +890,17 @@ static const uint32_t ar9280Modes_origin { 0x0000a34c, 0x000321ec, 0x000321ec, 0x00046e8a, 0x00046e8a, 0x00046e8a }, { 0x0000a350, 0x000321ec, 0x000321ec, 0x00049ec9, 0x00049ec9, 0x00049ec9 }, { 0x0000a354, 0x000321ec, 0x000321ec, 0x0004bf42, 0x0004bf42, 0x0004bf42 }, + { 0x0000a3ec, 0x00f70081, 0x00f70081, 0x00f70081, 0x00f70081, 0x00f70081 }, { 0x00007814, 0x0019beff, 0x0019beff, 0x0019beff, 0x0019beff, 0x0019beff }, { 0x00007838, 0x0019beff, 0x0019beff, 0x0019beff, 0x0019beff, 0x0019beff }, - { 0x0000a27c, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce, 0x050701ce }, + { 0x0000781c, 0x00392000, 0x00392000, 0x00392000, 0x00392000, 0x00392000 }, + { 0x00007840, 0x00392000, 0x00392000, 0x00392000, 0x00392000, 0x00392000 }, + { 0x00007820, 0x92592480, 0x92592480, 0x92592480, 0x92592480, 0x92592480 }, + { 0x00007844, 0x92592480, 0x92592480, 0x92592480, 0x92592480, 0x92592480 }, }; -/* Auto generated PCI-E PHY config for Merlin with CLKREQ de-asserted in L1 mode. */ -/* In L1 mode, deassert CLKREQ, power consumption will be lower than leaving CLKREQ asserted. */ -static const uint32_t ar9280PciePhy_clkreq_off_L1_v2[][2] = { +static const uint32_t ar9280PciePhy_clkreq_off_L1_merlin[][2] = { + /* Addr allmodes */ {0x00004040, 0x9248fd00 }, {0x00004040, 0x24924924 }, {0x00004040, 0xa8000019 }, @@ -910,9 +913,8 @@ static const uint32_t ar9280PciePhy_clkr {0x00004044, 0x00000000 }, }; -/* Auto generated PCI-E PHY config for Merlin with CLKREQ always asserted in L1 mode */ -/* In L1 mode leave CLKREQ asserted, power consumption will be little high. */ static const uint32_t ar9280PciePhy_clkreq_always_on_L1_v2[][2] = { + /* Addr allmodes */ {0x00004040, 0x9248fd00 }, {0x00004040, 0x24924924 }, {0x00004040, 0xa8000019 }, @@ -925,17 +927,3 @@ static const uint32_t ar9280PciePhy_clkr {0x00004044, 0x00000000 }, }; -/* Auto generated PCI-E PHY config for Merlin with WOW */ -static const uint32_t ar9280PciePhy_AWOW_merlin[][2] = { - {0x00004040, 0x9248fd00 }, - {0x00004040, 0x24924924 }, - {0x00004040, 0xa8000019 }, - {0x00004040, 0x13160820 }, - {0x00004040, 0xe5980560 }, - {0x00004040, 0xc01ddffd }, - {0x00004040, 0x1aaabe41 }, - {0x00004040, 0xbe105554 }, - {0x00004040, 0x00043007 }, - {0x00004044, 0x00000000 }, -}; - From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 14:49:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C078106566B; Sun, 23 Jan 2011 14:49:51 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2AE4F8FC14; Sun, 23 Jan 2011 14:49:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NEnp02058583; Sun, 23 Jan 2011 14:49:51 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NEnpt1058581; Sun, 23 Jan 2011 14:49:51 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101231449.p0NEnpt1058581@svn.freebsd.org> From: Adrian Chadd Date: Sun, 23 Jan 2011 14:49:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217752 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:49:51 -0000 Author: adrian Date: Sun Jan 23 14:49:50 2011 New Revision: 217752 URL: http://svn.freebsd.org/changeset/base/217752 Log: Enable the 11n PHY by default whether or not 11n is configured. The linux ath9k driver and (from what I've been told) the atheros reference driver does this; it then leaves discarding 11n frames to the 802.11 layer. Whilst I'm here, merge in a fix from ath9k which maintains a turbo register setting when enabling the 11n register; and remove an un-needed (duplicate) flag setting. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Jan 23 14:30:35 2011 (r217751) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Sun Jan 23 14:49:50 2011 (r217752) @@ -2138,22 +2138,28 @@ interpolate(uint16_t target, uint16_t sr return rv; } +/* + * The linux ath9k driver and (from what I've been told) the reference + * Atheros driver enables the 11n PHY by default whether or not it's + * configured. + */ static void ar5416Set11nRegs(struct ath_hal *ah, const struct ieee80211_channel *chan) { uint32_t phymode; + uint32_t enableDacFifo = 0; HAL_HT_MACMODE macmode; /* MAC - 20/40 mode */ - if (!IEEE80211_IS_CHAN_HT(chan)) - return; + if (AR_SREV_KITE_10_OR_LATER(ah)) + enableDacFifo = (OS_REG_READ(ah, AR_PHY_TURBO) & AR_PHY_FC_ENABLE_DAC_FIFO); /* Enable 11n HT, 20 MHz */ phymode = AR_PHY_FC_HT_EN | AR_PHY_FC_SHORT_GI_40 - | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH; + | AR_PHY_FC_SINGLE_HT_LTF1 | AR_PHY_FC_WALSH | enableDacFifo; /* Configure baseband for dynamic 20/40 operation */ if (IEEE80211_IS_CHAN_HT40(chan)) { - phymode |= AR_PHY_FC_DYN2040_EN | AR_PHY_FC_SHORT_GI_40; + phymode |= AR_PHY_FC_DYN2040_EN; /* Configure control (primary) channel at +-10MHz */ if (IEEE80211_IS_CHAN_HT40U(chan)) From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 14:54:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41880106566B; Sun, 23 Jan 2011 14:54:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30CE08FC12; Sun, 23 Jan 2011 14:54:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NEskIO058717; Sun, 23 Jan 2011 14:54:46 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NEsks6058715; Sun, 23 Jan 2011 14:54:46 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101231454.p0NEsks6058715@svn.freebsd.org> From: Jilles Tjoelker Date: Sun, 23 Jan 2011 14:54:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217753 - head/sbin/init X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 14:54:46 -0000 Author: jilles Date: Sun Jan 23 14:54:45 2011 New Revision: 217753 URL: http://svn.freebsd.org/changeset/base/217753 Log: init(8): Document that login(1) is now responsible for recording logouts. init(8) only uses utmpx for recording reboots and shutdowns. Modified: head/sbin/init/init.8 Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Sun Jan 23 14:49:50 2011 (r217752) +++ head/sbin/init/init.8 Sun Jan 23 14:54:45 2011 (r217753) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd September 15, 2005 +.Dd January 23, 2011 .Dt INIT 8 .Os .Sh NAME @@ -146,11 +146,11 @@ executes a shell for that user. When this shell dies, either because the user logged out or an abnormal termination occurred (a signal), -the -.Nm -utility wakes up and records the logout in the the user accounting +.Nm login +records the logout in the the user accounting database (see -.Xr getutxent 3 ). +.Xr getutxent 3) +and terminates. The cycle is then restarted by .Nm From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 15:39:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1C7AE106564A; Sun, 23 Jan 2011 15:39:56 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id BB5E68FC08; Sun, 23 Jan 2011 15:39:55 +0000 (UTC) Received: by iwn39 with SMTP id 39so3315911iwn.13 for ; Sun, 23 Jan 2011 07:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=aX9RyIpukijFNLWSMt3OqGMKxrGUOwuoZING8K3TAoo=; b=hKtO7AOX0bUJtztr/EXqFb4sCrdwkZdNjnzmk3v5aTEAyjAj8agEiLhyTINHge6mqG WcJXvJSEsYmzlKGGo/autp4RDLEBlH1v0oUFemO3bXKi3wTzv14Cm3WaUZ54tRShiffp kYHxvTpULSniePnYSvst+OPE+PuJ2b9NVNivQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=thK3d5D9FuL6Jcb/rOzsB12h9VwkdLJ9XXJyl+sgIK/rDmG5bmHS4DcuBzJFoGe9RW 1zfj9Z6iVAPjpVo6tXA43+L25c2LyUKQcJ46M1d7D/ROgy+qUe2SlJex1IqSMVmsyV/2 D0uZqGPO7oWcl/vu0H+nOKBVqUBybfXMhUHo8= MIME-Version: 1.0 Received: by 10.231.161.15 with SMTP id p15mr3478731ibx.104.1295797194510; Sun, 23 Jan 2011 07:39:54 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Sun, 23 Jan 2011 07:39:54 -0800 (PST) In-Reply-To: <201101231300.p0ND0PZi055936@svn.freebsd.org> References: <201101231300.p0ND0PZi055936@svn.freebsd.org> Date: Sun, 23 Jan 2011 07:39:54 -0800 X-Google-Sender-Auth: jyf0BRFmdKLKO0QRMe2CRrhfyd0 Message-ID: From: mdf@FreeBSD.org To: Lawrence Stewart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217748 - head/sys/netinet/cc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 15:39:56 -0000 For sbuf use for a sysctl you can use sbuf_init_for_sysctl() which will, instead of growing, push the current data out using SYSCTL_OUT to a wired user buffer. There's a few examples in the vm/ code. This can sometimes significantly simplify the code since there's no need to worry about held mutex/rwlock anymore. Thanks, matthew On Sun, Jan 23, 2011 at 5:00 AM, Lawrence Stewart wr= ote: > Author: lstewart > Date: Sun Jan 23 13:00:25 2011 > New Revision: 217748 > URL: http://svn.freebsd.org/changeset/base/217748 > > Log: > =A0An sbuf configured with SBUF_AUTOEXTEND will call malloc with M_WAITOK= when a > =A0write to the buffer causes it to overflow. We therefore can't hold the= CC list > =A0rwlock over a call to sbuf_printf() for an sbuf configured with SBUF_A= UTOEXTEND. > > =A0Switch to a fixed length sbuf which should be of sufficient size excep= t in the > =A0very unlikely event that the sysctl is being processed as one or more = new > =A0algorithms are loaded. If that happens, we accept the race and may fai= l the > =A0sysctl gracefully if there is insufficient room to print the names of = all the > =A0algorithms. > > =A0This should address a WITNESS warning and the potential panic that wou= ld occur > =A0if the sbuf call to malloc did sleep whilst holding the CC list rwlock= . > > =A0Sponsored by: FreeBSD Foundation > =A0Reported by: =A0Nick Hibma > =A0Reviewed by: =A0bz > =A0MFC after: =A0 =A03 weeks > =A0X-MFC with: =A0 r215166 > > Modified: > =A0head/sys/netinet/cc/cc.c > > Modified: head/sys/netinet/cc/cc.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/cc/cc.c =A0 =A0Sun Jan 23 12:44:17 2011 =A0 =A0 =A0 = =A0(r217747) > +++ head/sys/netinet/cc/cc.c =A0 =A0Sun Jan 23 13:00:25 2011 =A0 =A0 =A0 = =A0(r217748) > @@ -128,20 +128,37 @@ cc_list_available(SYSCTL_HANDLER_ARGS) > =A0{ > =A0 =A0 =A0 =A0struct cc_algo *algo; > =A0 =A0 =A0 =A0struct sbuf *s; > - =A0 =A0 =A0 int err, first; > + =A0 =A0 =A0 int err, first, nalgos; > > - =A0 =A0 =A0 err =3D 0; > + =A0 =A0 =A0 err =3D nalgos =3D 0; > =A0 =A0 =A0 =A0first =3D 1; > - =A0 =A0 =A0 s =3D sbuf_new(NULL, NULL, TCP_CA_NAME_MAX, SBUF_AUTOEXTEND= ); > + > + =A0 =A0 =A0 CC_LIST_RLOCK(); > + =A0 =A0 =A0 STAILQ_FOREACH(algo, &cc_list, entries) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 nalgos++; > + =A0 =A0 =A0 } > + =A0 =A0 =A0 CC_LIST_RUNLOCK(); > + > + =A0 =A0 =A0 s =3D sbuf_new(NULL, NULL, nalgos * TCP_CA_NAME_MAX, SBUF_F= IXEDLEN); > > =A0 =A0 =A0 =A0if (s =3D=3D NULL) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return (ENOMEM); > > + =A0 =A0 =A0 /* > + =A0 =A0 =A0 =A0* It is theoretically possible for the CC list to have g= rown in size > + =A0 =A0 =A0 =A0* since the call to sbuf_new() and therefore for the sbu= f to be too > + =A0 =A0 =A0 =A0* small. If this were to happen (incredibly unlikely), t= he sbuf will > + =A0 =A0 =A0 =A0* reach an overflow condition, sbuf_printf() will return= an error and > + =A0 =A0 =A0 =A0* the sysctl will fail gracefully. > + =A0 =A0 =A0 =A0*/ > =A0 =A0 =A0 =A0CC_LIST_RLOCK(); > =A0 =A0 =A0 =A0STAILQ_FOREACH(algo, &cc_list, entries) { > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0err =3D sbuf_printf(s, first ? "%s" : ", %= s", algo->name); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (err) > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (err) { > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Sbuf overflow condition.= */ > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 err =3D EOVERFLOW; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0first =3D 0; > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0CC_LIST_RUNLOCK(); > From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 16:28:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EBCA1065674; Sun, 23 Jan 2011 16:28:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8298FC1C; Sun, 23 Jan 2011 16:28:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NGSi6O060933; Sun, 23 Jan 2011 16:28:44 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NGSiOB060931; Sun, 23 Jan 2011 16:28:44 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101231628.p0NGSiOB060931@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sun, 23 Jan 2011 16:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217754 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 16:28:44 -0000 Author: bz Date: Sun Jan 23 16:28:44 2011 New Revision: 217754 URL: http://svn.freebsd.org/changeset/base/217754 Log: For `make tinderbox` there is no need to print the extra commands. MFC after: 5 days Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sun Jan 23 14:54:45 2011 (r217753) +++ head/Makefile Sun Jan 23 16:28:44 2011 (r217754) @@ -275,7 +275,7 @@ make: .PHONY ${MMAKE} install DESTDIR=${MAKEPATH} BINDIR= tinderbox: - cd ${.CURDIR} && \ + @cd ${.CURDIR} && \ DOING_TINDERBOX=YES ${MAKE} JFLAG=${JFLAG} universe # @@ -317,7 +317,7 @@ universe_prologue: @echo ">>> make universe started on ${STARTTIME}" @echo "--------------------------------------------------------------" .if defined(DOING_TINDERBOX) - rm -f ${FAILFILE} + @rm -f ${FAILFILE} .endif .for target in ${TARGETS} universe: universe_${target} From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 17:13:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2658E106564A; Sun, 23 Jan 2011 17:13:30 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15A6F8FC1A; Sun, 23 Jan 2011 17:13:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NHDTUo062078; Sun, 23 Jan 2011 17:13:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NHDTvg062076; Sun, 23 Jan 2011 17:13:29 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101231713.p0NHDTvg062076@svn.freebsd.org> From: Josh Paetzel Date: Sun, 23 Jan 2011 17:13:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217755 - head/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 17:13:30 -0000 Author: jpaetzel Date: Sun Jan 23 17:13:29 2011 New Revision: 217755 URL: http://svn.freebsd.org/changeset/base/217755 Log: This script parses output of userland tools. In the case of a faulted zpool the output causes the script to bail out with syntax errors. Since a scrub of a faulted zpool is pointless, just skip over any pools marked as such. PR: conf/150228 Submitted by: jpaetzel Approved by: kib (mentor) MFC after: 3 days MFC note: only for RELENG_8 Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 16:28:44 2011 (r217754) +++ head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 17:13:29 2011 (r217755) @@ -24,13 +24,17 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - zpool list ${pool} >/dev/null 2>&1 + _status=$(zpool list ${pool} | sed -n -e '$p') if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi + if echo ${_status} | grep -q FAULTED; then + echo "Skipping faulted pool: ${pool}" + continue + fi # successful only if there is at least one pool to scrub rc=0 From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 17:20:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02032106564A; Sun, 23 Jan 2011 17:20:12 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E53168FC08; Sun, 23 Jan 2011 17:20:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NHKBbf062240; Sun, 23 Jan 2011 17:20:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NHKBDO062238; Sun, 23 Jan 2011 17:20:11 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101231720.p0NHKBDO062238@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 23 Jan 2011 17:20:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217756 - head/sys/powerpc/powermac X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 17:20:12 -0000 Author: nwhitehorn Date: Sun Jan 23 17:20:11 2011 New Revision: 217756 URL: http://svn.freebsd.org/changeset/base/217756 Log: Disable ATAPI DMA unconditionally on Apple Kauai ATA controllers, like it is on the MacIO ones. It appears to be unreliable on all DBDMA-based controllers for unknown reasons, which should be figured out eventually. Tested by: Torfinn Ingolfsen MFC after: 1 week Modified: head/sys/powerpc/powermac/ata_kauai.c Modified: head/sys/powerpc/powermac/ata_kauai.c ============================================================================== --- head/sys/powerpc/powermac/ata_kauai.c Sun Jan 23 17:13:29 2011 (r217755) +++ head/sys/powerpc/powermac/ata_kauai.c Sun Jan 23 17:20:11 2011 (r217756) @@ -217,10 +217,8 @@ ata_kauai_probe(device_t dev) ch = &sc->sc_ch.sc_ch; compatstring = ofw_bus_get_compat(dev); - if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) { - ch->flags |= ATA_NO_ATAPI_DMA; + if (compatstring != NULL && strcmp(compatstring,"shasta-ata") == 0) sc->shasta = 1; - } /* Pre-K2 controllers apparently need this hack */ if (!sc->shasta && @@ -246,8 +244,11 @@ ata_kauai_probe(device_t dev) ch->r_io[ATA_CONTROL].offset = ATA_KAUAI_ALTOFFSET; ata_default_registers(dev); - ch->unit = 0; - ch->flags |= ATA_USE_16BIT; + ch->unit = 0; + ch->flags |= ATA_USE_16BIT; + + /* XXX: ATAPI DMA is unreliable. We should find out why. */ + ch->flags |= ATA_NO_ATAPI_DMA; ata_generic_hw(dev); return (ata_probe(dev)); From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 17:35:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4812106566C; Sun, 23 Jan 2011 17:35:14 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 718078FC17; Sun, 23 Jan 2011 17:35:14 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 582AA1DD625; Sun, 23 Jan 2011 18:35:13 +0100 (CET) Received: by turtle.stack.nl (Postfix, from userid 1677) id 4BC2F17104; Sun, 23 Jan 2011 18:35:13 +0100 (CET) Date: Sun, 23 Jan 2011 18:35:13 +0100 From: Jilles Tjoelker To: Josh Paetzel Message-ID: <20110123173513.GB9898@stack.nl> References: <201101231713.p0NHDTvg062076@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101231713.p0NHDTvg062076@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217755 - head/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 17:35:14 -0000 On Sun, Jan 23, 2011 at 05:13:29PM +0000, Josh Paetzel wrote: > Author: jpaetzel > Date: Sun Jan 23 17:13:29 2011 > New Revision: 217755 > URL: http://svn.freebsd.org/changeset/base/217755 > > Log: > This script parses output of userland tools. In the case of a faulted > zpool the output causes the script to bail out with syntax errors. > Since a scrub of a faulted zpool is pointless, just skip over any pools > marked as such. > > PR: conf/150228 > Submitted by: jpaetzel > Approved by: kib (mentor) > MFC after: 3 days > MFC note: only for RELENG_8 > > Modified: > head/etc/periodic/daily/800.scrub-zfs > > Modified: head/etc/periodic/daily/800.scrub-zfs > ============================================================================== > --- head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 16:28:44 2011 (r217754) > +++ head/etc/periodic/daily/800.scrub-zfs Sun Jan 23 17:13:29 2011 (r217755) > @@ -24,13 +24,17 @@ case "$daily_scrub_zfs_enable" in > > for pool in ${daily_scrub_zfs_pools}; do > # sanity check > - zpool list ${pool} >/dev/null 2>&1 > + _status=$(zpool list ${pool} | sed -n -e '$p') > if [ $? -ne 0 ]; then > echo " WARNING: pool '${pool}' specified in" > echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" > echo " does not exist" > continue > fi The above 'if' block never executes anymore now, since $? is sed's exit status which is always 0. Consider _status=$(zpool list "${pool}") if [ $? -ne 0 ]; then ... fi _status=${_status##*$newline} With somewhere at the top of the script newline=' ' # one newline and no other whitespace Note that this changed code will give the last non-empty line, while your sed code gives the last line even if it is empty. I think it does not make a difference. > + if echo ${_status} | grep -q FAULTED; then > + echo "Skipping faulted pool: ${pool}" > + continue > + fi Faster and more resilient to special characters: case ${_status} in *FAULTED*) echo "Skipping faulted pool: ${pool}" continue ;; esac > # successful only if there is at least one pool to scrub > rc=0 -- Jilles Tjoelker From owner-svn-src-all@FreeBSD.ORG Sun Jan 23 19:36:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 188D5106566C; Sun, 23 Jan 2011 19:36:29 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 065638FC0A; Sun, 23 Jan 2011 19:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0NJaTdD065294; Sun, 23 Jan 2011 19:36:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0NJaSHF065284; Sun, 23 Jan 2011 19:36:28 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101231936.p0NJaSHF065284@svn.freebsd.org> From: Michael Tuexen Date: Sun, 23 Jan 2011 19:36:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217760 - in head/sys: conf netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Jan 2011 19:36:29 -0000 Author: tuexen Date: Sun Jan 23 19:36:28 2011 New Revision: 217760 URL: http://svn.freebsd.org/changeset/base/217760 Log: Add stream scheduling support. This work is based on a patch received from Robin Seggelmann. MFC after: 3 months. Added: head/sys/netinet/sctp_ss_functions.c (contents, props changed) Modified: head/sys/conf/files head/sys/netinet/sctp.h head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.c head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_timer.c head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_usrreq.c head/sys/netinet/sctputil.c Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/conf/files Sun Jan 23 19:36:28 2011 (r217760) @@ -2638,6 +2638,7 @@ netinet/sctp_input.c optional inet sctp netinet/sctp_output.c optional inet sctp netinet/sctp_pcb.c optional inet sctp netinet/sctp_peeloff.c optional inet sctp +netinet/sctp_ss_functions.c optional inet sctp netinet/sctp_sysctl.c optional inet sctp netinet/sctp_timer.c optional inet sctp netinet/sctp_usrreq.c optional inet sctp Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp.h Sun Jan 23 19:36:28 2011 (r217760) @@ -158,6 +158,9 @@ struct sctp_paramhdr { #define SCTP_CMT_USE_DAC 0x00001201 /* JRS - Pluggable Congestion Control Socket option */ #define SCTP_PLUGGABLE_CC 0x00001202 +/* RS - Pluggable Stream Scheduling Socket option */ +#define SCTP_PLUGGABLE_SS 0x00001203 +#define SCTP_SS_VALUE 0x00001204 /* read only */ #define SCTP_GET_SNDBUF_USE 0x00001101 @@ -253,6 +256,22 @@ struct sctp_paramhdr { /* HTCP Congestion Control */ #define SCTP_CC_HTCP 0x00000002 +/* RS - Supported stream scheduling modules for pluggable + * stream scheduling + */ +/* Default simple round-robin */ +#define SCTP_SS_DEFAULT 0x00000000 +/* Real round-robin */ +#define SCTP_SS_ROUND_ROBIN 0x00000001 +/* Real round-robin per packet */ +#define SCTP_SS_ROUND_ROBIN_PACKET 0x00000002 +/* Priority */ +#define SCTP_SS_PRIORITY 0x00000003 +/* Fair Bandwidth */ +#define SCTP_SS_FAIR_BANDWITH 0x00000004 +/* First-come, first-serve */ +#define SCTP_SS_FIRST_COME 0x00000005 + /* fragment interleave constants * setting must be one of these or Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp_input.c Sun Jan 23 19:36:28 2011 (r217760) @@ -193,8 +193,8 @@ int sctp_is_there_unsent_data(struct sctp_tcb *stcb) { int unsent_data = 0; - struct sctp_stream_queue_pending *sp, *nsp; - struct sctp_stream_out *strq; + unsigned int i; + struct sctp_stream_queue_pending *sp; struct sctp_association *asoc; /* @@ -205,9 +205,14 @@ sctp_is_there_unsent_data(struct sctp_tc */ asoc = &stcb->asoc; SCTP_TCB_SEND_LOCK(stcb); - TAILQ_FOREACH(strq, &asoc->out_wheel, next_spoke) { - /* sa_ignore FREED_MEMORY */ - TAILQ_FOREACH_SAFE(sp, &strq->outqueue, next, nsp) { + if (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { + /* Check to see if some data queued */ + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + /* sa_ignore FREED_MEMORY */ + sp = TAILQ_FIRST(&stcb->asoc.strmout[i].outqueue); + if (sp == NULL) { + continue; + } if ((sp->msg_is_complete) && (sp->length == 0) && (sp->sender_all_done)) { @@ -224,8 +229,8 @@ sctp_is_there_unsent_data(struct sctp_tc sp->msg_is_complete, sp->put_last_out); } - atomic_subtract_int(&asoc->stream_queue_cnt, 1); - TAILQ_REMOVE(&strq->outqueue, sp, next); + atomic_subtract_int(&stcb->asoc.stream_queue_cnt, 1); + TAILQ_REMOVE(&stcb->asoc.strmout[i].outqueue, sp, next); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -957,7 +962,7 @@ sctp_handle_shutdown_ack(struct sctp_shu /* are the queues empty? */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } /* stop the timer */ @@ -3031,7 +3036,7 @@ sctp_handle_shutdown_complete(struct sct /* are the queues empty? they should be */ if (!TAILQ_EMPTY(&asoc->send_queue) || !TAILQ_EMPTY(&asoc->sent_queue) || - !TAILQ_EMPTY(&asoc->out_wheel)) { + !stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { sctp_report_all_outbound(stcb, 0, SCTP_SO_NOT_LOCKED); } } Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp_output.c Sun Jan 23 19:36:28 2011 (r217760) @@ -5616,52 +5616,6 @@ do_a_abort: } -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holds_lock) -{ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if ((strq->next_spoke.tqe_next == NULL) && - (strq->next_spoke.tqe_prev == NULL)) { - TAILQ_INSERT_TAIL(&asoc->out_wheel, strq, next_spoke); - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - -void -sctp_remove_from_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, - int holds_lock) -{ - /* take off and then setup so we know it is not on the wheel */ - if (holds_lock == 0) { - SCTP_TCB_SEND_LOCK(stcb); - } - if (TAILQ_EMPTY(&strq->outqueue)) { - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, next_spoke); - if (asoc->last_out_stream == NULL) { - asoc->last_out_stream = TAILQ_LAST(&asoc->out_wheel, sctpwheel_listhead); - } - if (asoc->last_out_stream == strq) { - asoc->last_out_stream = NULL; - } - } - TAILQ_REMOVE(&asoc->out_wheel, strq, next_spoke); - strq->next_spoke.tqe_next = NULL; - strq->next_spoke.tqe_prev = NULL; - } - if (holds_lock == 0) { - SCTP_TCB_SEND_UNLOCK(stcb); - } -} - static void sctp_prune_prsctp(struct sctp_tcb *stcb, struct sctp_association *asoc, @@ -5924,11 +5878,7 @@ sctp_msg_append(struct sctp_tcb *stcb, sp->strseq = strm->next_sequence_sent; strm->next_sequence_sent++; } - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, &stcb->asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, &stcb->asoc, strm, sp, 1); m = NULL; SCTP_TCB_SEND_UNLOCK(stcb); out_now: @@ -6743,6 +6693,7 @@ one_more_time: } atomic_subtract_int(&asoc->stream_queue_cnt, 1); TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7152,6 +7103,7 @@ dont_do_it: send_lock_up = 1; } TAILQ_REMOVE(&strq->outqueue, sp, next); + stcb->asoc.ss_functions.sctp_ss_remove_from_stream(stcb, asoc, strq, sp, send_lock_up); if (sp->net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7181,24 +7133,6 @@ out_of: } -static struct sctp_stream_out * -sctp_select_a_stream(struct sctp_tcb *stcb, struct sctp_association *asoc) -{ - struct sctp_stream_out *strq; - - /* Find the next stream to use */ - if (asoc->last_out_stream == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } else { - strq = TAILQ_NEXT(asoc->last_out_stream, next_spoke); - if (strq == NULL) { - strq = TAILQ_FIRST(&asoc->out_wheel); - } - } - return (strq); -} - - static void sctp_fill_outqueue(struct sctp_tcb *stcb, struct sctp_nets *net, int frag_point, int eeor_mode, int *quit_now) @@ -7207,7 +7141,6 @@ sctp_fill_outqueue(struct sctp_tcb *stcb struct sctp_stream_out *strq, *strqn; int goal_mtu, moved_how_much, total_moved = 0, bail = 0; int locked, giveup; - struct sctp_stream_queue_pending *sp; SCTP_TCB_LOCK_ASSERT(stcb); asoc = &stcb->asoc; @@ -7231,46 +7164,17 @@ sctp_fill_outqueue(struct sctp_tcb *stcb strq = asoc->locked_on_sending; locked = 1; } else { - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); locked = 0; } strqn = strq; while ((goal_mtu > 0) && strq) { - sp = TAILQ_FIRST(&strq->outqueue); - if (sp == NULL) { - break; - } - /** - * Honor the users' choice if given. If not given, - * pull it only to the primary path in case of not using - * CMT. - */ - if (((sp->net != NULL) && - (sp->net != net)) || - ((sp->net == NULL) && - (asoc->sctp_cmt_on_off == 0) && - (asoc->primary_destination != net))) { - /* Do not pull to this network */ - if (locked) { - break; - } else { - strq = sctp_select_a_stream(stcb, asoc); - if (strq == NULL) - /* none left */ - break; - if (strqn == strq) { - /* I have circled */ - break; - } - continue; - } - } giveup = 0; bail = 0; moved_how_much = sctp_move_to_outqueue(stcb, strq, goal_mtu, frag_point, &locked, &giveup, eeor_mode, &bail); if (moved_how_much) - asoc->last_out_stream = strq; + stcb->asoc.ss_functions.sctp_ss_scheduled(stcb, net, asoc, strq, moved_how_much); if (locked) { asoc->locked_on_sending = strq; @@ -7279,23 +7183,10 @@ sctp_fill_outqueue(struct sctp_tcb *stcb break; } else { asoc->locked_on_sending = NULL; - if (TAILQ_EMPTY(&strq->outqueue)) { - if (strq == strqn) { - /* Must move start to next one */ - strqn = TAILQ_NEXT(strq, next_spoke); - if (strqn == NULL) { - strqn = TAILQ_FIRST(&asoc->out_wheel); - if (strqn == NULL) { - break; - } - } - } - sctp_remove_from_wheel(stcb, asoc, strq, 0); - } if ((giveup) || bail) { break; } - strq = sctp_select_a_stream(stcb, asoc); + strq = stcb->asoc.ss_functions.sctp_ss_select_stream(stcb, net, asoc); if (strq == NULL) { break; } @@ -7307,6 +7198,8 @@ sctp_fill_outqueue(struct sctp_tcb *stcb if (bail) *quit_now = 1; + stcb->asoc.ss_functions.sctp_ss_packet_done(stcb, net, asoc); + if (total_moved == 0) { if ((stcb->asoc.sctp_cmt_on_off == 0) && (net == stcb->asoc.primary_destination)) { @@ -7335,16 +7228,16 @@ void sctp_move_chunks_from_net(struct sctp_tcb *stcb, struct sctp_nets *net) { struct sctp_association *asoc; - struct sctp_stream_out *outs; struct sctp_tmit_chunk *chk; struct sctp_stream_queue_pending *sp; + unsigned int i; if (net == NULL) { return; } asoc = &stcb->asoc; - TAILQ_FOREACH(outs, &asoc->out_wheel, next_spoke) { - TAILQ_FOREACH(sp, &outs->outqueue, next) { + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + TAILQ_FOREACH(sp, &stcb->asoc.strmout[i].outqueue, next) { if (sp->net == net) { sctp_free_remote_addr(sp->net); sp->net = NULL; @@ -7437,7 +7330,7 @@ sctp_med_chunk_output(struct sctp_inpcb if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { *reason_code = 9; return (0); } @@ -7454,7 +7347,8 @@ sctp_med_chunk_output(struct sctp_inpcb max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; else max_send_per_dest = 0; - if ((no_data_chunks == 0) && (!TAILQ_EMPTY(&asoc->out_wheel))) { + if ((no_data_chunks == 0) && + (!stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc))) { TAILQ_FOREACH(net, &asoc->nets, sctp_next) { /* * This for loop we are in takes in each net, if @@ -9638,7 +9532,7 @@ sctp_chunk_output(struct sctp_inpcb *inp } if (TAILQ_EMPTY(&asoc->control_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && - TAILQ_EMPTY(&asoc->out_wheel)) { + stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { /* Nothing left to send */ break; } @@ -12447,8 +12341,7 @@ sctp_lower_sosend(struct socket *so, TAILQ_INIT(&asoc->strmout[i].outqueue); asoc->strmout[i].stream_no = i; asoc->strmout[i].last_msg_incomplete = 0; - asoc->strmout[i].next_spoke.tqe_next = 0; - asoc->strmout[i].next_spoke.tqe_prev = 0; + asoc->ss_functions.sctp_ss_init_stream(&asoc->strmout[i]); } } } @@ -12841,11 +12734,7 @@ skip_preblock: SCTP_STAT_INCR(sctps_sends_with_unord); } TAILQ_INSERT_TAIL(&strm->outqueue, sp, next); - if ((strm->next_spoke.tqe_next == NULL) && - (strm->next_spoke.tqe_prev == NULL)) { - /* Not on wheel, insert */ - sctp_insert_on_wheel(stcb, asoc, strm, 1); - } + stcb->asoc.ss_functions.sctp_ss_add_to_stream(stcb, asoc, strm, sp, 1); SCTP_TCB_SEND_UNLOCK(stcb); } else { SCTP_TCB_SEND_LOCK(stcb); Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp_output.h Sun Jan 23 19:36:28 2011 (r217760) @@ -135,11 +135,6 @@ int sctp_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct thread *, int); -void -sctp_insert_on_wheel(struct sctp_tcb *stcb, - struct sctp_association *asoc, - struct sctp_stream_out *strq, int holdslock); - void sctp_chunk_output(struct sctp_inpcb *, struct sctp_tcb *, int, int #if !defined(__APPLE__) && !defined(SCTP_SO_LOCK_TESTING) Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp_pcb.c Sun Jan 23 19:36:28 2011 (r217760) @@ -2517,6 +2517,7 @@ sctp_inpcb_alloc(struct socket *so, uint m->sctp_sws_receiver = SCTP_SWS_RECEIVER_DEF; m->max_burst = SCTP_BASE_SYSCTL(sctp_max_burst_default); m->sctp_default_cc_module = SCTP_BASE_SYSCTL(sctp_default_cc_module); + m->sctp_default_ss_module = SCTP_BASE_SYSCTL(sctp_default_ss_module); /* number of streams to pre-open on a association */ m->pre_open_stream_count = SCTP_BASE_SYSCTL(sctp_nr_outgoing_streams_default); Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Sun Jan 23 18:43:16 2011 (r217759) +++ head/sys/netinet/sctp_pcb.h Sun Jan 23 19:36:28 2011 (r217760) @@ -276,6 +276,7 @@ struct sctp_pcb { uint32_t sctp_sws_receiver; uint32_t sctp_default_cc_module; + uint32_t sctp_default_ss_module; /* authentication related fields */ struct sctp_keyhead shared_keys; sctp_auth_chklist_t *local_auth_chunks; Added: head/sys/netinet/sctp_ss_functions.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/sctp_ss_functions.c Sun Jan 23 19:36:28 2011 (r217760) @@ -0,0 +1,914 @@ +/*- + * Copyright (c) 2010, by Randall Stewart & Michael Tuexen, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * a) Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * b) 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. + * + * c) Neither the name of Cisco Systems, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include + +/* + * Default simple round-robin algorithm. + * Just interates the streams in the order they appear. + */ + +static void +sctp_ss_default_add(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_remove(struct sctp_tcb *, struct sctp_association *, + struct sctp_stream_out *, + struct sctp_stream_queue_pending *, int); + +static void +sctp_ss_default_init(struct sctp_tcb *stcb, struct sctp_association *asoc, + int holds_lock) +{ + uint16_t i; + + TAILQ_INIT(&asoc->ss_data.out_wheel); + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_add(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + sctp_ss_default_remove(stcb, &stcb->asoc, + &stcb->asoc.strmout[i], + NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_default_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + return; +} + +static void +sctp_ss_default_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, + strq, ss_params.rr.next_spoke); + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static int +sctp_ss_default_is_empty(struct sctp_tcb *stcb, struct sctp_association *asoc) +{ + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + return (1); + } else { + return (0); + } +} + +static void +sctp_ss_default_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, + sctpwheel_listhead, + ss_params.rr.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.rr.next_spoke.tqe_next = NULL; + strq->ss_params.rr.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + + +static struct sctp_stream_out * +sctp_ss_default_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +default_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto default_again; + } + } + } + return (strq); +} + +static void +sctp_ss_default_scheduled(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc, + struct sctp_stream_out *strq, int moved_how_much) +{ + asoc->last_out_stream = strq; + return; +} + +static void +sctp_ss_default_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + /* Nothing to be done here */ + return; +} + +static int +sctp_ss_default_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + /* Nothing to be done here */ + return (-1); +} + +static int +sctp_ss_default_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + /* Nothing to be done here */ + return (-1); +} + +/* + * Real round-robin algorithm. + * Always interates the streams in ascending order. + */ +static void +sctp_ss_rr_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && (strqt->stream_no < strq->stream_no)) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +/* + * Real round-robin per packet algorithm. + * Always interates the streams in ascending order and + * only fills messages of the same stream in a packet. + */ +static void +sctp_ss_rrp_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, + struct sctp_stream_queue_pending *sp, int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.rr.next_spoke.tqe_next == NULL) && + (strq->ss_params.rr.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->stream_no < strq->stream_no) { + strqt = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.rr.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_rrp_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; + if (strqt != NULL && !TAILQ_EMPTY(&strqt->outqueue)) { + return (strqt); + } +rrp_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto rrp_again; + } + } + } + return (strq); +} + +static void +sctp_ss_rrp_packet_done(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt; + + strqt = asoc->last_out_stream; +rrp_pd_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strq = TAILQ_NEXT(strqt, ss_params.rr.next_spoke); + if (strq == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if ((strq != NULL) && TAILQ_FIRST(&strq->outqueue) && + (net != NULL && TAILQ_FIRST(&strq->outqueue)->net != net) && + (SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0)) { + if (strq == asoc->last_out_stream) { + strq = NULL; + } else { + strqt = strq; + goto rrp_pd_again; + } + } + asoc->last_out_stream = strq; + return; +} + + +/* + * Priority algorithm. + * Always prefers streams based on their priority id. + */ +static void +sctp_ss_prio_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) + stcb->asoc.strmout[i].ss_params.prio.priority = 0; + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_prio_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + strq->ss_params.prio.priority = 0; + return; +} + +static void +sctp_ss_prio_add(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + struct sctp_stream_out *strqt; + + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if ((strq->ss_params.prio.next_spoke.tqe_next == NULL) && + (strq->ss_params.prio.next_spoke.tqe_prev == NULL)) { + + if (TAILQ_EMPTY(&asoc->ss_data.out_wheel)) { + TAILQ_INSERT_HEAD(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } else { + strqt = TAILQ_FIRST(&asoc->ss_data.out_wheel); + while (strqt != NULL && strqt->ss_params.prio.priority < strq->ss_params.prio.priority) { + strqt = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } + if (strqt != NULL) { + TAILQ_INSERT_BEFORE(strqt, strq, ss_params.prio.next_spoke); + } else { + TAILQ_INSERT_TAIL(&asoc->ss_data.out_wheel, strq, ss_params.prio.next_spoke); + } + } + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static void +sctp_ss_prio_remove(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, struct sctp_stream_queue_pending *sp, + int holds_lock) +{ + /* take off and then setup so we know it is not on the wheel */ + if (holds_lock == 0) { + SCTP_TCB_SEND_LOCK(stcb); + } + if (TAILQ_EMPTY(&strq->outqueue)) { + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = TAILQ_PREV(asoc->last_out_stream, sctpwheel_listhead, + ss_params.prio.next_spoke); + if (asoc->last_out_stream == NULL) { + asoc->last_out_stream = TAILQ_LAST(&asoc->ss_data.out_wheel, + sctpwheel_listhead); + } + if (asoc->last_out_stream == strq) { + asoc->last_out_stream = NULL; + } + } + TAILQ_REMOVE(&asoc->ss_data.out_wheel, strq, ss_params.rr.next_spoke); + strq->ss_params.prio.next_spoke.tqe_next = NULL; + strq->ss_params.prio.next_spoke.tqe_prev = NULL; + } + if (holds_lock == 0) { + SCTP_TCB_SEND_UNLOCK(stcb); + } + return; +} + +static struct sctp_stream_out * +sctp_ss_prio_select(struct sctp_tcb *stcb, struct sctp_nets *net, + struct sctp_association *asoc) +{ + struct sctp_stream_out *strq, *strqt, *strqn; + + strqt = asoc->last_out_stream; +prio_again: + /* Find the next stream to use */ + if (strqt == NULL) { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } else { + strqn = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + if (strqn != NULL && + strqn->ss_params.prio.priority == strqt->ss_params.prio.priority) { + strq = TAILQ_NEXT(strqt, ss_params.prio.next_spoke); + } else { + strq = TAILQ_FIRST(&asoc->ss_data.out_wheel); + } + } + + /* + * If CMT is off, we must validate that the stream in question has + * the first item pointed towards are network destionation requested + * by the caller. Note that if we turn out to be locked to a stream + * (assigning TSN's then we must stop, since we cannot look for + * another stream with data to send to that destination). In CMT's + * case, by skipping this check, we will send one data packet + * towards the requested net. + */ + if (net != NULL && strq != NULL && + SCTP_BASE_SYSCTL(sctp_cmt_on_off) == 0) { + if (TAILQ_FIRST(&strq->outqueue) && + TAILQ_FIRST(&strq->outqueue)->net != NULL && + TAILQ_FIRST(&strq->outqueue)->net != net) { + if (strq == asoc->last_out_stream) { + return (NULL); + } else { + strqt = strq; + goto prio_again; + } + } + } + return (strq); +} + +static int +sctp_ss_prio_get_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t * value) +{ + if (strq == NULL) { + return (-1); + } + *value = strq->ss_params.prio.priority; + return (1); +} + +static int +sctp_ss_prio_set_value(struct sctp_tcb *stcb, struct sctp_association *asoc, + struct sctp_stream_out *strq, uint16_t value) +{ + if (strq == NULL) { + return (-1); + } + strq->ss_params.prio.priority = value; + sctp_ss_prio_remove(stcb, asoc, strq, NULL, 1); + sctp_ss_prio_add(stcb, asoc, strq, NULL, 1); + return (1); +} + +/* + * Fair bandwidth algorithm. + * Maintains an equal troughput per stream. + */ +static void +sctp_ss_fb_clear(struct sctp_tcb *stcb, struct sctp_association *asoc, + int clear_values, int holds_lock) +{ + uint16_t i; + + for (i = 0; i < stcb->asoc.streamoutcnt; i++) { + if (!TAILQ_EMPTY(&stcb->asoc.strmout[i].outqueue)) { + if (clear_values) { + stcb->asoc.strmout[i].ss_params.fb.rounds = -1; + } + sctp_ss_default_remove(stcb, &stcb->asoc, &stcb->asoc.strmout[i], NULL, holds_lock); + } + } + return; +} + +static void +sctp_ss_fb_init_stream(struct sctp_stream_out *strq) +{ + strq->ss_params.fb.next_spoke.tqe_next = NULL; + strq->ss_params.fb.next_spoke.tqe_prev = NULL; + strq->ss_params.fb.rounds = -1; + return; +} + +static void +sctp_ss_fb_add(struct sctp_tcb *stcb, struct sctp_association *asoc, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 00:01:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9BF2106566B; Mon, 24 Jan 2011 00:01:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 98F7B8FC0A; Mon, 24 Jan 2011 00:01:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O016Li071652; Mon, 24 Jan 2011 00:01:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O016fZ071650; Mon, 24 Jan 2011 00:01:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101240001.p0O016fZ071650@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 24 Jan 2011 00:01:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217766 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 00:01:06 -0000 Author: yongari Date: Mon Jan 24 00:01:06 2011 New Revision: 217766 URL: http://svn.freebsd.org/changeset/base/217766 Log: Apply TX interrupt moderation to all RTL810xE PCIe Fast Ethernet controllers. Experimentation with RTL8102E, RTL8103E and RTL8105E showed dramatic decrement of TX completion interrupts under high TX load(e.g. from 147k interrupts/second to 10k interrupts/second) With this change, TX interrupt moderation is applied to all controllers except RTL8139C+. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Sun Jan 23 23:17:37 2011 (r217765) +++ head/sys/dev/re/if_re.c Mon Jan 24 00:01:06 2011 (r217766) @@ -2943,20 +2943,8 @@ re_init_locked(struct rl_softc *sc) /* Configure interrupt moderation. */ if (sc->rl_type == RL_8169) { - switch (sc->rl_hwrev->rl_rev) { - case RL_HWREV_8100E: - case RL_HWREV_8101E: - case RL_HWREV_8102E: - case RL_HWREV_8102EL: - case RL_HWREV_8102EL_SPIN1: - case RL_HWREV_8103E: - CSR_WRITE_2(sc, RL_INTRMOD, 0); - break; - default: - /* Magic from vendor. */ - CSR_WRITE_2(sc, RL_INTRMOD, 0x5100); - break; - } + /* Magic from vendor. */ + CSR_WRITE_2(sc, RL_INTRMOD, 0x5100); } #ifdef DEVICE_POLLING From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 02:44:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A07C1106566C; Mon, 24 Jan 2011 02:44:42 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 0975A8FC14; Mon, 24 Jan 2011 02:44:41 +0000 (UTC) Received: by qwj9 with SMTP id 9so3431259qwj.13 for ; Sun, 23 Jan 2011 18:44:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=gvdUdkOP/AJqh9LYu5/gZmcyzxWbDUVsnkeDpCQyPTs=; b=Ycgvh+4SUi1jhNqjUO4WrWuquE6Al5Cw8BzVzgiuQy7e0GCXe5dK/XVGIJ5Xplw7EZ kV38j7gHqCLLcRmtQdb/Q/6pHAxLnK9lrS2CLetsEoEZrWcGxBy7GUQa5mBBBfuDvJoe OkKYDLk25Xz4/h5NZrL+IGhioJGur1zrnD+8M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=o3YiCZcZD4WqWL0jdwsaw0nDhaA4W7a6L1SZYYMXxiK4gHUsHosS9A7E93g+suj4eC 7U0Hk7Ur3DCBY1kC460nQsKQ2sEzN1Yj8gj0xCEh9e/y33kx9KL9z0tNQyEwgqUhPgab MCcNZThs8hOKdH1rAp5Q5wOSqU1YCvOcFI5wY= MIME-Version: 1.0 Received: by 10.229.211.138 with SMTP id go10mr3290146qcb.195.1295837080560; Sun, 23 Jan 2011 18:44:40 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.229.102.87 with HTTP; Sun, 23 Jan 2011 18:44:40 -0800 (PST) In-Reply-To: <201101231108.p0NB8d3K053239@svn.freebsd.org> References: <201101231108.p0NB8d3K053239@svn.freebsd.org> Date: Mon, 24 Jan 2011 05:44:40 +0300 X-Google-Sender-Auth: H08aqEFh9eVO930WlG8T_Og4QVU Message-ID: From: Sergey Kandaurov To: Giorgos Keramidas Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217746 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 02:44:42 -0000 On 23 January 2011 14:08, Giorgos Keramidas wrote: > Author: keramida (doc committer) > Date: Sun Jan 23 11:08:39 2011 > New Revision: 217746 > URL: http://svn.freebsd.org/changeset/base/217746 > > Log: > =A0Touch up the sample memory usage numbers a bit, to avoid wrapping > =A0on terminal boundary. =A0While here add definition for 'G' and fix > =A0the indentation of 'K' units. > Thanks! (d'oh, I completely forgot about it) --=20 wbr, pluknet From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 03:50:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDBC21065674; Mon, 24 Jan 2011 03:50:42 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id D54F78FC14; Mon, 24 Jan 2011 03:50:41 +0000 (UTC) Received: by wyf19 with SMTP id 19so3688172wyf.13 for ; Sun, 23 Jan 2011 19:50:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Sc1rIENu18rFb1+ktILd54vXwmVdolaHVxmJEYICxSM=; b=VeCvzcTtZ8yKfxtiWtRGLY0CEsLzdQHq2X8N3S++mZYUPb7ZW1qwrTJNDGtZF7cEHF jNhpfhhFNIrR/p72coRNjdm+TqwwAbpE8pgzcAcYhhpARL7lF8IWf9cJdFYXPgCl1k6T egAPDujPB4SCKPtSMi2TF0JjNcRsAnnXg748k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=H5EeVNqn9O2LEXjtdztBur0IKtumCtYrr3b9j/x4RY5iPNu2jw0S5+vqxKWRLz6cuW fyB/S+X6xuft1ah+YWTmcy0A9N6yKon8Bf6pW07HtLSFQG5K6XS6dWej+ZdboVU9xINl ku/bFND3jDm+dbizmTcWMEWrA/OYcFhqHODMM= MIME-Version: 1.0 Received: by 10.216.185.142 with SMTP id u14mr1831769wem.31.1295841040583; Sun, 23 Jan 2011 19:50:40 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Sun, 23 Jan 2011 19:50:40 -0800 (PST) In-Reply-To: References: <201101231108.p0NB8d3K053239@svn.freebsd.org> Date: Sun, 23 Jan 2011 19:50:40 -0800 X-Google-Sender-Auth: miTT2VBHUiRLCbxt_c3gd0NerSk Message-ID: From: Garrett Cooper To: Sergey Kandaurov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Giorgos Keramidas Subject: Re: svn commit: r217746 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 03:50:43 -0000 On Sun, Jan 23, 2011 at 6:44 PM, Sergey Kandaurov wro= te: > On 23 January 2011 14:08, Giorgos Keramidas wrote: >> Author: keramida (doc committer) >> Date: Sun Jan 23 11:08:39 2011 >> New Revision: 217746 >> URL: http://svn.freebsd.org/changeset/base/217746 >> >> Log: >> =A0Touch up the sample memory usage numbers a bit, to avoid wrapping >> =A0on terminal boundary. =A0While here add definition for 'G' and fix >> =A0the indentation of 'K' units. >> > > Thanks! (d'oh, I completely forgot about it) *sigh*.. K is not a unit modifier, it's a temperature unit, i.e. K -> Kelvin, not K -> kilo- :(... This needs to be fixed upstream too to be SI compliant. Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 04:33:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56BBC1065670; Mon, 24 Jan 2011 04:33:00 +0000 (UTC) (envelope-from gordon@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 45C398FC15; Mon, 24 Jan 2011 04:33:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O4X0Be078075; Mon, 24 Jan 2011 04:33:00 GMT (envelope-from gordon@svn.freebsd.org) Received: (from gordon@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O4X0mH078073; Mon, 24 Jan 2011 04:33:00 GMT (envelope-from gordon@svn.freebsd.org) Message-Id: <201101240433.p0O4X0mH078073@svn.freebsd.org> From: Gordon Tetlow Date: Mon, 24 Jan 2011 04:33:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217767 - head/usr.sbin/freebsd-update X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 04:33:00 -0000 Author: gordon Date: Mon Jan 24 04:32:59 2011 New Revision: 217767 URL: http://svn.freebsd.org/changeset/base/217767 Log: Honor $PAGER instead of always calling more. Approved by: colin@ MFC after: 1 week Modified: head/usr.sbin/freebsd-update/freebsd-update.sh Modified: head/usr.sbin/freebsd-update/freebsd-update.sh ============================================================================== --- head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 24 00:01:06 2011 (r217766) +++ head/usr.sbin/freebsd-update/freebsd-update.sh Mon Jan 24 04:32:59 2011 (r217767) @@ -1875,7 +1875,7 @@ fetch_create_manifest () { echo -n "been downloaded because the files have been " echo "modified locally:" cat modifiedfiles - fi | more + fi | $PAGER rm modifiedfiles # If no files will be updated, tell the user and exit @@ -1905,7 +1905,7 @@ fetch_create_manifest () { echo -n "The following files will be removed " echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" cat files.removed - fi | more + fi | $PAGER rm files.removed # Report added files, if any @@ -1914,7 +1914,7 @@ fetch_create_manifest () { echo -n "The following files will be added " echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" cat files.added - fi | more + fi | $PAGER rm files.added # Report updated files, if any @@ -1924,7 +1924,7 @@ fetch_create_manifest () { echo "as part of updating to ${RELNUM}-p${RELPATCHNUM}:" cat files.updated - fi | more + fi | $PAGER rm files.updated # Create a directory for the install manifest. @@ -3202,6 +3202,11 @@ cmd_IDS () { # Make sure we find utilities from the base system export PATH=/sbin:/bin:/usr/sbin:/usr/bin:${PATH} +# Set a pager if the user doesn't +if [ -z "$PAGER" ]; then + PAGER=/usr/bin/more +fi + # Set LC_ALL in order to avoid problems with character ranges like [A-Z]. export LC_ALL=C From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:17:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 42650106566C; Mon, 24 Jan 2011 06:17:06 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2EE438FC14; Mon, 24 Jan 2011 06:17:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O6H6e5080390; Mon, 24 Jan 2011 06:17:06 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O6H5tt080376; Mon, 24 Jan 2011 06:17:05 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201101240617.p0O6H5tt080376@svn.freebsd.org> From: Kirk McKusick Date: Mon, 24 Jan 2011 06:17:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217769 - in head: sbin/dump sbin/fsck_ffs sbin/fsdb sbin/fsirand sbin/newfs usr.sbin/makefs usr.sbin/quot X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:17:06 -0000 Author: mckusick Date: Mon Jan 24 06:17:05 2011 New Revision: 217769 URL: http://svn.freebsd.org/changeset/base/217769 Log: The dump, fsck_ffs, fsdb, fsirand, newfs, makefs, and quot utilities include sys/time.h instead of time.h. This include is incorrect as per the manpages for the APIs and the POSIX definitions. This commit replaces sys/time.h where necessary with time.h. The commit also includes some minor style(9) header fixup in newfs. This commit is part of a larger effort by Garrett Cooper started in //depot/user/gcooper/posix-conformance-work/ -- to make FreeBSD more POSIX compliant. Submitted by: Garrett Cooper yanegomi at gmail dot com Modified: head/sbin/dump/itime.c head/sbin/dump/main.c head/sbin/dump/optr.c head/sbin/dump/tape.c head/sbin/fsck_ffs/inode.c head/sbin/fsck_ffs/main.c head/sbin/fsck_ffs/suj.c head/sbin/fsdb/fsdb.c head/sbin/fsirand/fsirand.c head/sbin/newfs/mkfs.c head/usr.sbin/makefs/ffs.c head/usr.sbin/makefs/makefs.c head/usr.sbin/quot/quot.c Modified: head/sbin/dump/itime.c ============================================================================== --- head/sbin/dump/itime.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/dump/itime.c Mon Jan 24 06:17:05 2011 (r217769) @@ -37,7 +37,6 @@ static const char rcsid[] = #include #include -#include #include @@ -49,6 +48,7 @@ static const char rcsid[] = #include #include #include +#include #include #include "dump.h" Modified: head/sbin/dump/main.c ============================================================================== --- head/sbin/dump/main.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/dump/main.c Mon Jan 24 06:17:05 2011 (r217769) @@ -43,7 +43,6 @@ static const char rcsid[] = #include #include -#include #include #include @@ -64,6 +63,7 @@ static const char rcsid[] = #include #include #include +#include #include #include Modified: head/sbin/dump/optr.c ============================================================================== --- head/sbin/dump/optr.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/dump/optr.c Mon Jan 24 06:17:05 2011 (r217769) @@ -38,7 +38,6 @@ static const char rcsid[] = #include #include #include -#include #include @@ -51,6 +50,7 @@ static const char rcsid[] = #include #include #include +#include #include #include "dump.h" Modified: head/sbin/dump/tape.c ============================================================================== --- head/sbin/dump/tape.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/dump/tape.c Mon Jan 24 06:17:05 2011 (r217769) @@ -37,7 +37,6 @@ static const char rcsid[] = #include #include -#include #include #include @@ -54,6 +53,7 @@ static const char rcsid[] = #include #include #include +#include #include #include "dump.h" Modified: head/sbin/fsck_ffs/inode.c ============================================================================== --- head/sbin/fsck_ffs/inode.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/fsck_ffs/inode.c Mon Jan 24 06:17:05 2011 (r217769) @@ -37,7 +37,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -47,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "fsck.h" Modified: head/sbin/fsck_ffs/main.c ============================================================================== --- head/sbin/fsck_ffs/main.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/fsck_ffs/main.c Mon Jan 24 06:17:05 2011 (r217769) @@ -42,11 +42,10 @@ static char sccsid[] = "@(#)main.c 8.6 ( __FBSDID("$FreeBSD$"); #include -#include #include -#include #include #include +#include #include #include #include @@ -62,6 +61,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "fsck.h" Modified: head/sbin/fsck_ffs/suj.c ============================================================================== --- head/sbin/fsck_ffs/suj.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/fsck_ffs/suj.c Mon Jan 24 06:17:05 2011 (r217769) @@ -37,6 +37,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #include #include #include @@ -46,8 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include -#include +#include #include "fsck.h" Modified: head/sbin/fsdb/fsdb.c ============================================================================== --- head/sbin/fsdb/fsdb.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/fsdb/fsdb.c Mon Jan 24 06:17:05 2011 (r217769) @@ -34,13 +34,13 @@ static const char rcsid[] = #endif /* not lint */ #include -#include #include #include #include #include #include #include +#include #include #include Modified: head/sbin/fsirand/fsirand.c ============================================================================== --- head/sbin/fsirand/fsirand.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/fsirand/fsirand.c Mon Jan 24 06:17:05 2011 (r217769) @@ -35,9 +35,8 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ -#include #include -#include +#include #include #include @@ -50,6 +49,7 @@ static const char rcsid[] = #include #include #include +#include #include static void usage(void) __dead2; Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/sbin/newfs/mkfs.c Mon Jan 24 06:17:05 2011 (r217769) @@ -44,6 +44,14 @@ static char sccsid[] = "@(#)mkfs.c 8.11 #include __FBSDID("$FreeBSD$"); +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -52,20 +60,11 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include -#include -#include -#include -#include -#include -#include #include #include #include -#include -#include -#include -#include #include "newfs.h" /* Modified: head/usr.sbin/makefs/ffs.c ============================================================================== --- head/usr.sbin/makefs/ffs.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/usr.sbin/makefs/ffs.c Mon Jan 24 06:17:05 2011 (r217769) @@ -80,6 +80,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "makefs.h" Modified: head/usr.sbin/makefs/makefs.c ============================================================================== --- head/usr.sbin/makefs/makefs.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/usr.sbin/makefs/makefs.c Mon Jan 24 06:17:05 2011 (r217769) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include "makefs.h" Modified: head/usr.sbin/quot/quot.c ============================================================================== --- head/usr.sbin/quot/quot.c Mon Jan 24 06:03:58 2011 (r217768) +++ head/usr.sbin/quot/quot.c Mon Jan 24 06:17:05 2011 (r217769) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -49,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include /* some flags of what to do: */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:30:16 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3DDE91065670; Mon, 24 Jan 2011 06:30:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id F399C8FC1C; Mon, 24 Jan 2011 06:30:15 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0O6KId2012334; Sun, 23 Jan 2011 23:20:18 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D3D1A22.5070906@bsdimp.com> Date: Sun, 23 Jan 2011 23:20:18 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201101222310.p0MNAwIY007637@svn.freebsd.org> In-Reply-To: <201101222310.p0MNAwIY007637@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217734 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:30:16 -0000 On 01/22/2011 16:10, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Jan 22 23:10:58 2011 > New Revision: 217734 > URL: http://svn.freebsd.org/changeset/base/217734 > > Log: > In `make targets` print the make variable TARGETS as we expect it rather > than the grammatically better sounding variant without the 'S'. This > allows copy and paste and is less confusing. > > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Sat Jan 22 22:57:28 2011 (r217733) > +++ head/Makefile Sat Jan 22 23:10:58 2011 (r217734) > @@ -297,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} > .endfor > > targets: > - @echo "Supported TARGET/TARGET_ARCH pairs" > + @echo "Supported TARGETS/TARGET_ARCH pairs" > .for target in ${TARGETS} > .for target_arch in ${TARGET_ARCHES_${target}} > @echo " ${target}/${target_arch}" this change is wrong. You set TARGET, not TARGETS. Please revert it. Warner From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:30:16 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BCD161065674; Mon, 24 Jan 2011 06:30:16 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 799578FC1D; Mon, 24 Jan 2011 06:30:16 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0O6N2mK012376; Sun, 23 Jan 2011 23:23:02 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D3D1AC6.7030003@bsdimp.com> Date: Sun, 23 Jan 2011 23:23:02 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201101222257.p0MMvSZY007310@svn.freebsd.org> <20110123104812.A3489@maildrop.int.zabbadoz.net> In-Reply-To: <20110123104812.A3489@maildrop.int.zabbadoz.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Garrett Cooper Subject: Re: svn commit: r217733 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:30:16 -0000 On 01/23/2011 03:51, Bjoern A. Zeeb wrote: > On Sat, 22 Jan 2011, Garrett Cooper wrote: > >> On Sat, Jan 22, 2011 at 2:57 PM, Bjoern A. Zeeb wrote: >>> Author: bz >>> Date: Sat Jan 22 22:57:28 2011 >>> New Revision: 217733 >>> URL: http://svn.freebsd.org/changeset/base/217733 >>> >>> Log: >>> Properly document what the top-level `make tinderbox` does. >>> >>> Reviewed by: jmallett >>> MFC After: 3 days >>> X-MFC: build.7 only >> >> As much as I like make universe and tinderbox, for the purpose of >> development testing would it make sense if there was a tinderbox >> target that actually died on its first failure? tinderbox and universe > > I think not really; if you want to catch errors, you want all of them > and not just the first broken kernel if there are 12. > >> seems to be useful when dealing with known breakage or when executing >> periodic builds, but I don't know think it's as effective with >> development testing, as for some of the stuff I just want to build on >> something other than my host arch and another arch that isn't x86 (say >> arm, mips, powerpc) just to make sure that I didn't break anything >> endian wise (if the code is that nasty). > > make universe TARGETS=arm > or > make universe TARGETS="i386 amd64 sparc64 ia64" > > works perfectly well (again). Even > > make universe TARGETS=mips TARGET_ARCH=mips64eb KERNCONFS=XLR64 > > should be perfectly fine. Except, it isn't fine. That's a horrible interface. It doesn't work if TARGETS="i386 mips". Warner From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:40:50 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 028D0106566C; Mon, 24 Jan 2011 06:40:50 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id B845B8FC21; Mon, 24 Jan 2011 06:40:49 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0O6RPVg012494; Sun, 23 Jan 2011 23:27:25 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D3D1BCC.8040502@bsdimp.com> Date: Sun, 23 Jan 2011 23:27:24 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201101222310.p0MNAwIY007637@svn.freebsd.org> In-Reply-To: <201101222310.p0MNAwIY007637@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217734 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:40:50 -0000 On 01/22/2011 16:10, Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Jan 22 23:10:58 2011 > New Revision: 217734 > URL: http://svn.freebsd.org/changeset/base/217734 > > Log: > In `make targets` print the make variable TARGETS as we expect it rather > than the grammatically better sounding variant without the 'S'. This > allows copy and paste and is less confusing. > Also, 'make targets' explains which targets are supported by make buildworld, not make universe. Again, please revert. Warner > Modified: > head/Makefile > > Modified: head/Makefile > ============================================================================== > --- head/Makefile Sat Jan 22 22:57:28 2011 (r217733) > +++ head/Makefile Sat Jan 22 23:10:58 2011 (r217734) > @@ -297,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} > .endfor > > targets: > - @echo "Supported TARGET/TARGET_ARCH pairs" > + @echo "Supported TARGETS/TARGET_ARCH pairs" > .for target in ${TARGETS} > .for target_arch in ${TARGET_ARCHES_${target}} > @echo " ${target}/${target_arch}" > > > From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:40:51 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0904D106564A; Mon, 24 Jan 2011 06:40:51 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 954FA8FC22; Mon, 24 Jan 2011 06:40:50 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p0O6PqX9012443; Sun, 23 Jan 2011 23:25:55 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D3D1B70.8020405@bsdimp.com> Date: Sun, 23 Jan 2011 23:25:52 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: Bruce Evans References: <201101220521.p0M5LLc7081184@svn.freebsd.org> <20110122172226.R13556@besplex.bde.org> In-Reply-To: <20110122172226.R13556@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, Maxim Sobolev , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217714 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:40:51 -0000 Maxim, In case it wasn't clear from Bruce's long explaination, parts of this are technically wrong and need to be reverted or fixed. Warner On 01/22/2011 00:47, Bruce Evans wrote: > On Sat, 22 Jan 2011, Maxim Sobolev wrote: > >> Log: >> Warn user when value entered is greated than the amount supported >> by the MBR for the given parameter and set that parameter to the >> maximum value instead of just truncating the most significant part >> silently. >> >> Could happen for example if the capacity of the device is more >> than 2TB, so that the number of sectors is greater than 2Mib. >> >> MFC after: 1 month > > This improves some things, but has a high density of style bugs (many > lines expanded beyond 80 columns...), and 2 errors in the limits. > > What's this 2Mib limit? ibits are strange units for sector counts. > The limit should be 4G, but there is probably lots of brokenness starting > at 2G. fdisk is quite broken at 2G, since it uses ints too much. > >> Modified: head/sbin/fdisk/fdisk.c >> ============================================================================== >> >> --- head/sbin/fdisk/fdisk.c Sat Jan 22 01:48:12 2011 (r217713) >> +++ head/sbin/fdisk/fdisk.c Sat Jan 22 05:21:20 2011 (r217714) >> @@ -586,9 +586,9 @@ change_part(int i) >> tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); >> thd = partp->dp_shd; >> tsec = DPSECT(partp->dp_ssect); >> - Decimal("beginning cylinder", tcyl, tmp); >> - Decimal("beginning head", thd, tmp); >> - Decimal("beginning sector", tsec, tmp); >> + Decimal("beginning cylinder", tcyl, tmp, >> sizeof(partp->dp_scyl)); > > Cylinder numbers are 10 bits in the MBR. They don't fit in the > starting and > ending cylinder fields, so 2 bits of them are put in the corresponding > sector > fields. The sizeof here is always 1, giving only 8 bits and thus a wrong > limit of 256. > >> + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); >> + Decimal("beginning sector", tsec, tmp, >> sizeof(partp->dp_ssect)); > > Sector numbers are only 6 bits in the MBR. The sizeof here is always 1, > giving 8 bits and thus a wrong limit of 256. > >> partp->dp_scyl = DOSCYL(tcyl); >> partp->dp_ssect = DOSSECT(tsec,tcyl); >> partp->dp_shd = thd; > > The DOSSECT() macro handles the details of merging cylinder bits into > sector field.s > > Since these are the values to be written directly into the MBR, it is > correct to limit them and not blindly truncate them. Non-blindly > changing > them is little better. They should just be rejected. > > There is also a lower limit on sector numbers. Sector 0 is invalid. > > Similarly for ending C/H/S numbers, except the breakage is larger in > practice. Starting cylinder numbers are usually 0, but ending cylinder > numbers are usually 1023 and now you can't edit them to anything above > 255, including null changes from 1023 and changes from invalid values > to the least invalid value of 1023. Older disks/devices/software may > actually have between 256 and 1023 cylinders and need an MBR which > matches. > >> @@ -647,7 +647,7 @@ change_active(int which) >> setactive: >> do { >> new = active; >> - Decimal("active partition", new, tmp); >> + Decimal("active partition", new, tmp, 0); >> if (new < 1 || new > 4) { >> printf("Active partition number must be in range 1-4." >> " Try again.\n"); > > This has a lower limit too, and does the necessary and correct range > checking for itself. It now has to pass a bogus upper limit of 0 to > Decimal() to stop checking there. Decimal() should probably handle > both limits like this does. > >> @@ -677,9 +677,9 @@ get_params_to_use() >> { >> do >> { >> - Decimal("BIOS's idea of #cylinders", dos_cyls, tmp); >> - Decimal("BIOS's idea of #heads", dos_heads, tmp); >> - Decimal("BIOS's idea of #sectors", dos_sectors, tmp); >> + Decimal("BIOS's idea of #cylinders", dos_cyls, tmp, 0); >> + Decimal("BIOS's idea of #heads", dos_heads, tmp, 0); >> + Decimal("BIOS's idea of #sectors", dos_sectors, tmp, 0); >> dos_cylsecs = dos_heads * dos_sectors; >> print_params(); >> } > > I originally thought that the user values had to be accepted fairly > blindly since they are multiplied out in places like here. Now I see > that > nothing has changed for these, but it probably should be changed to at > least warn about them. > > There seems to be mo multiplication out involving dos_cyls. There are > warnings about it being out of range all over the place. The size of the > disk in sectors is mostly given not by these "dos" variables, but by > the "undosed" variables cyls, heads and sectors. get_params() > initializes > all the "dos" variables badly by setting them to the same as to "undosed" > variables in all cases. This is guranteed to give dos_cyls > 1023 on any > hard disk less than about 12 years old. > > Note that the limits for the above are 1 more than the limits for > starting > and ending C/H/S, except for dos_sectors, since these values are counts > while the the others are offsets from 0 (except starting/ending sectors > are offset froms 1). > >> @@ -915,11 +915,16 @@ ok(const char *str) >> } >> >> static int >> -decimal(const char *str, int *num, int deflt) >> +decimal(const char *str, int *num, int deflt, int size) >> { >> - int acc = 0, c; >> + long long acc = 0, maxval; > > Long long is an abomination, and there is no reason to use any type > larger > than uint32_t here. > >> + int c; >> char *cp; >> >> + if (size == 0) { >> + size = sizeof(*num); >> + } >> + maxval = (long long)1 << (size * 8); > > This is not the maximum value, but a limit value which is 1 greater > than the maximum. OK, you need a type larger than uint32_t to go 1 > greater than its maximum, and you get that when `size' is 4. A better > interface passing the maximum (_not_ 1 greater) wouldn't have that > problem. And decimal() still returns int, so overflow occurs long > before that UNIT32_MAX+1LL. Sector numbers are 32 bits unsigned, so > int is inadequate to describe them, but this program uses int for them > in many other places, e.g., 'disksecs = cyls * heads * sectors' first > has an overflowing multiplication and then assigns the overflowed value > to "int disksecs" where it won't fit :-(. > >> while (1) { >> printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); >> fflush(stdout); >> @@ -935,14 +940,20 @@ decimal(const char *str, int *num, int d >> if (!c) >> return 0; >> while ((c = *cp++)) { >> - if (c <= '9' && c >= '0') >> - acc = acc * 10 + c - '0'; >> - else >> + if (c <= '9' && c >= '0') { >> + if (acc < maxval) >> + acc = acc * 10 + c - '0'; >> + } else >> break; >> } > > Ugh, didn't people learn to use strtol() instead of home made parsing of > numbers with overflow errors in 1985? Now it has enough range checking > to prevent overflow of (acc * 10) provided maxval is limited to > LONG_LONG_MAX / 10. Might need a slightly lower limit for adding c. > > decimal() doesn't seem to support negative numbers, so nothing needs to > check for them. > > Bruce > > > From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 06:46:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B2511065783; Mon, 24 Jan 2011 06:46:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 184D18FC1E; Mon, 24 Jan 2011 06:46:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O6k445081121; Mon, 24 Jan 2011 06:46:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O6k4ns081113; Mon, 24 Jan 2011 06:46:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101240646.p0O6k4ns081113@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Jan 2011 06:46:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217770 - in head/tools/tools/ath: . ath_ee_v4k_print X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 06:46:04 -0000 Author: adrian Date: Mon Jan 24 06:46:03 2011 New Revision: 217770 URL: http://svn.freebsd.org/changeset/base/217770 Log: Add a simple tool to print the contents of a v4k EEPROM dump. Added: head/tools/tools/ath/ath_ee_v4k_print/ head/tools/tools/ath/ath_ee_v4k_print/Makefile (contents, props changed) head/tools/tools/ath/ath_ee_v4k_print/eeprom.c (contents, props changed) head/tools/tools/ath/ath_ee_v4k_print/eeprom.h (contents, props changed) head/tools/tools/ath/ath_ee_v4k_print/main.c (contents, props changed) head/tools/tools/ath/ath_ee_v4k_print/v4k.c (contents, props changed) head/tools/tools/ath/ath_ee_v4k_print/v4k.h (contents, props changed) Modified: head/tools/tools/ath/Makefile Modified: head/tools/tools/ath/Makefile ============================================================================== --- head/tools/tools/ath/Makefile Mon Jan 24 06:17:05 2011 (r217769) +++ head/tools/tools/ath/Makefile Mon Jan 24 06:46:03 2011 (r217770) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats ath_ee_v14_print ath_prom_read +SUBDIR= athdebug athdecode athkey athpoke athprom athrd athregs athstats ath_ee_v14_print ath_prom_read ath_ee_v4k_print .include Added: head/tools/tools/ath/ath_ee_v4k_print/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/Makefile Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +.PATH: ${.CURDIR}/../../../../sys/dev/ath/ath_hal + +PROG= ath_ee_v4k_print +SRCS= main.c eeprom.c v4k.c +NOMAN= yes +NO_MAN= yes + +.include <../Makefile.inc> + +.include Added: head/tools/tools/ath/ath_ee_v4k_print/eeprom.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/eeprom.c Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,72 @@ + +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include "eeprom.h" + +void +load_eeprom_dump(const char *file, uint16_t *buf) +{ + unsigned int r[8]; + FILE *fp; + char b[1024]; + int i; + + fp = fopen(file, "r"); + if (!fp) + err(1, "fopen"); + + while (!feof(fp)) { + if (fgets(b, 1024, fp) == NULL) + break; + if (feof(fp)) + break; + if (strlen(b) > 0) + b[strlen(b)-1] = '\0'; + if (strlen(b) == 0) + break; + sscanf(b, "%x: %x %x %x %x %x %x %x %x\n", + &i, &r[0], &r[1], &r[2], &r[3], &r[4], + &r[5], &r[6], &r[7]); + buf[i++] = r[0]; + buf[i++] = r[1]; + buf[i++] = r[2]; + buf[i++] = r[3]; + buf[i++] = r[4]; + buf[i++] = r[5]; + buf[i++] = r[6]; + buf[i++] = r[7]; + } + fclose(fp); +} Added: head/tools/tools/ath/ath_ee_v4k_print/eeprom.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/eeprom.h Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,8 @@ +/* $FreeBSD$ */ + +#ifndef __EEPROM_H__ +#define __EEPROM_H__ + +extern void load_eeprom_dump(const char *file, uint16_t *buf); + +#endif Added: head/tools/tools/ath/ath_ee_v4k_print/main.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/main.c Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,85 @@ + +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +#include "eeprom.h" +#include "v4k.h" + +void +usage(char *argv[]) +{ + printf("Usage: %s \n", argv[0]); + printf("\n"); + printf(" The eeprom dump file is a text hexdump of an EEPROM.\n"); + printf(" The lines must be formatted as follows:\n"); + printf(" 0xAAAA: 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD 0xDD\n"); + printf(" where each line must have exactly eight data bytes.\n"); + exit(127); +} + +int +main(int argc, char *argv[]) +{ + uint16_t *eep = NULL; + eep = calloc(4096, sizeof(int16_t)); + + if (argc < 2) + usage(argv); + + load_eeprom_dump(argv[1], eep); + + eeprom_v4k_base_print(eep); + eeprom_v4k_custdata_print(eep); + printf("\n2.4ghz:\n"); + eeprom_v4k_modal_print(eep); + printf("\n"); + + eeprom_v4k_calfreqpiers_print(eep); + printf("\n"); + + eeprom_v4k_print_targets(eep); + printf("\n"); + + eeprom_v4k_ctl_print(eep); + printf("\n"); + + eeprom_v4k_print_edges(eep); + printf("\n"); + + eeprom_v4k_print_other(eep); + printf("\n"); + + free(eep); + exit(0); +} Added: head/tools/tools/ath/ath_ee_v4k_print/v4k.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,287 @@ + +/* + * Copyright (c) 2010-2011 Adrian Chadd, Xenion Pty Ltd. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#include +#include +#include +#include +#include +#include + +typedef enum { + AH_FALSE = 0, /* NB: lots of code assumes false is zero */ + AH_TRUE = 1, +} HAL_BOOL; + +typedef enum { + HAL_OK = 0, /* No error */ +} HAL_STATUS; + +struct ath_hal; + +#include "ah_eeprom_v4k.h" + +void +eeprom_v4k_base_print(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + BASE_EEP4K_HEADER *eh = &eep->ee_base.baseEepHeader; + + printf("| Version: 0x%.4x | Length: 0x%.4x | Checksum: 0x%.4x ", + eh->version, eh->length, eh->checksum); + printf("| CapFlags: 0x%.2x | eepMisc: 0x%.2x | RegDomain: 0x%.2x 0x%.2x | \n", + eh->opCapFlags, eh->eepMisc, eh->regDmn[0], eh->regDmn[1]); + printf("| MAC: %.2x:%.2x:%.2x:%.2x:%.2x:%.2x ", + eh->macAddr[0], eh->macAddr[1], eh->macAddr[2], + eh->macAddr[3], eh->macAddr[4], eh->macAddr[5]); + printf("| RxMask: 0x%.2x | TxMask: 0x%.2x | RfSilent: 0x%.4x | btOptions: 0x%.4x |\n", + eh->rxMask, eh->txMask, eh->rfSilent, eh->blueToothOptions); + printf("| DeviceCap: 0x%.4x | binBuildNumber: %.8x | deviceType: 0x%.2x | txGainType 0x%.2x |\n", + eh->deviceCap, eh->binBuildNumber, eh->deviceType, eh->txGainType); +} + +void +eeprom_v4k_custdata_print(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + uint8_t *custdata = (uint8_t *) &eep->ee_base.custData; + int i; + + printf("\n| Custdata: |\n"); + for (i = 0; i < 20; i++) { + printf("%s0x%.2x %s", + i % 16 == 0 ? "| " : "", + custdata[i], + i % 16 == 15 ? "|\n" : ""); + } + printf("\n"); +} + +void +eeprom_v4k_modal_print(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + MODAL_EEP4K_HEADER *mh = &eep->ee_base.modalHeader; + int i; + + printf("| antCtrlCommon: 0x%.4x |\n", mh->antCtrlCommon); + printf("| switchSettling: 0x%.2x |\n", mh->switchSettling); + printf("| adcDesiredSize: %d |\n| pgaDesiredSize: %.2f dBm |\n", + mh->adcDesiredSize, (float) mh->pgaDesiredSize / 2.0); + + printf("| antCtrlChain: 0:0x%.4x |\n", mh->antCtrlChain[0]); + printf("| antennaGainCh: 0:0x%.2x |\n", mh->antennaGainCh[0]); + printf("| txRxAttenCh: 0:0x%.2x |\n", mh->txRxAttenCh[0]); + printf("| rxTxMarginCh: 0:0x%.2x |\n", mh->rxTxMarginCh[0]); + printf("| noiseFloorThresCh: 0:0x%.2x |\n", mh->noiseFloorThreshCh[0]); + printf("| xlnaGainCh: 0:0x%.2x |\n", mh->xlnaGainCh[0]); + printf("| iqCalICh: 0:0x%.2x |\n", mh->iqCalICh[0]); + printf("| iqCalQCh: 0:0x%.2x |\n", mh->iqCalQCh[0]); + printf("| bswAtten: 0:0x%.2x |\n", mh->bswAtten[0]); + printf("| bswMargin: 0:0x%.2x |\n", mh->bswMargin[0]); + printf("| xatten2Db: 0:0x%.2x |\n", mh->xatten2Db[0]); + printf("| xatten2Margin: 0:0x%.2x |\n", mh->xatten2Margin[0]); + + printf("| txEndToXpaOff: 0x%.2x | txEndToRxOn: 0x%.2x | txFrameToXpaOn: 0x%.2x |\n", + mh->txEndToXpaOff, mh->txEndToRxOn, mh->txFrameToXpaOn); + printf("| thres62: 0x%.2x\n", mh->thresh62); + printf("| xpdGain: 0x%.2x | xpd: 0x%.2x |\n", mh->xpdGain, mh->xpd); + printf("| xpaBiasLvlFreq: 0:0x%.4x 1:0x%.4x 2:0x%.4x |\n", + mh->xpaBiasLvlFreq[0], mh->xpaBiasLvlFreq[1], mh->xpaBiasLvlFreq[2]); + printf("| pdGainOverlap: 0x%.2x | ob: 0x%.2x | db: 0x%.2x | xpaBiasLvl: 0x%.2x |\n", + mh->pdGainOverlap, mh->ob, mh->db, mh->xpaBiasLvl); + printf("| txFrameToDataStart: 0x%.2x | txFrameToPaOn: 0x%.2x |\n", mh->txFrameToDataStart, mh->txFrameToPaOn); + printf("| ht40PowerIncForPdadc: 0x%.2x |\n", mh->ht40PowerIncForPdadc); + printf("| swSettleHt40: 0x%.2x |\n", mh->swSettleHt40); + printf("| ob_ch1: 0x%.2x | db_ch1: 0x%.2x |\n", mh->ob_ch1, mh->db_ch1); + printf("| flagBits: 0x%.2x | miscBits: 0x%.2x |\n", mh->flagBits, mh->miscBits); + printf("| futureModal: 0x%.2x 0x%.2x\n", mh->futureModal[0], mh->futureModal[1]); + + /* and now, spur channels */ + for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { + printf("| Spur %d: spurChan: 0x%.4x spurRangeLow: 0x%.2x spurRangeHigh: 0x%.2x |\n", + i, mh->spurChans[i].spurChan, + (int) mh->spurChans[i].spurRangeLow, + (int) mh->spurChans[i].spurRangeHigh); + } +} + +static void +eeprom_v4k_print_caldata_perfreq(CAL_DATA_PER_FREQ_4K *f) +{ + int i, j; + + for (i = 0; i < AR5416_4K_NUM_PD_GAINS; i++) { + printf(" Gain %d: pwr dBm/vpd: ", i); + for (j = 0; j < AR5416_PD_GAIN_ICEPTS; j++) { + /* These are stored in 0.25dBm increments */ + /* XXX is this assumption correct for ar9285? */ + /* XXX shouldn't we care about the power table offset, if there is one? */ + printf("%d:(%.2f/%d) ", j, (float) f->pwrPdg[i][j] / 4.00, + f->vpdPdg[i][j]); + } + printf("\n"); + } +} + +void +eeprom_v4k_calfreqpiers_print(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + int i, n; + + /* 2ghz cal piers */ + printf("calFreqPier2G: "); + for (i = 0; i < AR5416_4K_NUM_2G_CAL_PIERS; i++) { + printf(" 0x%.2x ", eep->ee_base.calFreqPier2G[i]); + } + printf("|\n"); + + for (i = 0; i < AR5416_4K_NUM_2G_CAL_PIERS; i++) { + if (eep->ee_base.calFreqPier2G[i] == 0xff) + continue; + printf("2Ghz Cal Pier %d\n", i); + for (n = 0; n < AR5416_4K_MAX_CHAINS; n++) { + printf(" Chain %d:\n", n); + eeprom_v4k_print_caldata_perfreq(&eep->ee_base.calPierData2G[n][i]); + } + } + + printf("\n"); +} + +/* XXX these should just reference the v14 print routines */ +static void +eeprom_v14_target_legacy_print(CAL_TARGET_POWER_LEG *l) +{ + int i; + if (l->bChannel == 0xff) + return; + printf(" bChannel: %d;", l->bChannel); + for (i = 0; i < 4; i++) { + printf(" %.2f", (float) l->tPow2x[i] / 2.0); + } + printf(" (dBm)\n"); +} + +static void +eeprom_v14_target_ht_print(CAL_TARGET_POWER_HT *l) +{ + int i; + if (l->bChannel == 0xff) + return; + printf(" bChannel: %d;", l->bChannel); + for (i = 0; i < 8; i++) { + printf(" %.2f", (float) l->tPow2x[i] / 2.0); + } + printf(" (dBm)\n"); +} + +void +eeprom_v4k_print_targets(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + int i; + + /* 2ghz rates */ + printf("2Ghz CCK:\n"); + for (i = 0; i < AR5416_4K_NUM_2G_CCK_TARGET_POWERS; i++) { + eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPowerCck[i]); + } + printf("2Ghz 11g:\n"); + for (i = 0; i < AR5416_4K_NUM_2G_20_TARGET_POWERS; i++) { + eeprom_v14_target_legacy_print(&eep->ee_base.calTargetPower2G[i]); + } + printf("2Ghz HT20:\n"); + for (i = 0; i < AR5416_4K_NUM_2G_20_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT20[i]); + } + printf("2Ghz HT40:\n"); + for (i = 0; i < AR5416_4K_NUM_2G_40_TARGET_POWERS; i++) { + eeprom_v14_target_ht_print(&eep->ee_base.calTargetPower2GHT40[i]); + } + +} + +static void +eeprom_v4k_ctl_edge_print(CAL_CTL_DATA_4K *ctl) +{ + int i, j; + uint8_t pow, flag; + + for (i = 0; i < AR5416_4K_MAX_CHAINS; i++) { + printf(" chain %d: ", i); + for (j = 0; j < AR5416_4K_NUM_BAND_EDGES; j++) { + pow = ctl->ctlEdges[i][j].tPowerFlag & 0x3f; + flag = (ctl->ctlEdges[i][j].tPowerFlag & 0xc0) >> 6; + printf(" %d:pow=%d,flag=%.2x", j, pow, flag); + } + printf("\n"); + } +} + +void +eeprom_v4k_ctl_print(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + int i; + + for (i = 0; i < AR5416_4K_NUM_CTLS; i++) { + if (eep->ee_base.ctlIndex[i] == 0) + continue; + printf("| ctlIndex: offset %d, value %d\n", i, eep->ee_base.ctlIndex[i]); + eeprom_v4k_ctl_edge_print(&eep->ee_base.ctlData[i]); + } +} + +void +eeprom_v4k_print_edges(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + int i; + + printf("| eeNumCtls: %d\n", eep->ee_numCtls); + for (i = 0; i < NUM_EDGES*eep->ee_numCtls; i++) { + /* XXX is flag 8 or 32 bits? */ + printf("| edge %2d/%2d: rdEdge: %5d EdgePower: %.2f dBm Flag: 0x%.8x\n", + i / NUM_EDGES, i % NUM_EDGES, + eep->ee_rdEdgesPower[i].rdEdge, + (float) eep->ee_rdEdgesPower[i].twice_rdEdgePower / 2.0, + eep->ee_rdEdgesPower[i].flag); + + if (i % NUM_EDGES == (NUM_EDGES -1)) + printf("|\n"); + } +} + +void +eeprom_v4k_print_other(uint16_t *buf) +{ + HAL_EEPROM_v4k *eep = (HAL_EEPROM_v4k *) buf; + printf("| ee_antennaGainMax: %.2x\n", eep->ee_antennaGainMax); +} Added: head/tools/tools/ath/ath_ee_v4k_print/v4k.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/ath/ath_ee_v4k_print/v4k.h Mon Jan 24 06:46:03 2011 (r217770) @@ -0,0 +1,15 @@ +/* $FreeBSD$ */ + +#ifndef __V4K_H__ +#define __V4K_H__ + +extern void eeprom_v4k_base_print(uint16_t *buf); +extern void eeprom_v4k_custdata_print(uint16_t *buf); +extern void eeprom_v4k_modal_print(uint16_t *buf); +extern void eeprom_v4k_calfreqpiers_print(uint16_t *buf); +extern void eeprom_v4k_ctl_print(uint16_t *buf); +extern void eeprom_v4k_print_targets(uint16_t *buf); +extern void eeprom_v4k_print_edges(uint16_t *buf); +extern void eeprom_v4k_print_other(uint16_t *buf); + +#endif From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 07:11:51 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C9951065672; Mon, 24 Jan 2011 07:11:51 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id C27998FC1F; Mon, 24 Jan 2011 07:11:50 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 8FDDD7E88D; Mon, 24 Jan 2011 18:11:48 +1100 (EST) Message-ID: <4D3D2634.4070005@freebsd.org> Date: Mon, 24 Jan 2011 18:11:48 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101215 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: mdf@FreeBSD.org References: <201101231300.p0ND0PZi055936@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217748 - head/sys/netinet/cc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 07:11:51 -0000 Hi Matthew, On 01/24/11 02:39, mdf@FreeBSD.org wrote: > For sbuf use for a sysctl you can use sbuf_init_for_sysctl() which I assume you mean sbuf_new_for_sysctl() that's in kern/kern_sysctl.c? It would be useful to document this function in sbuf(9) - I wasn't aware of it and didn't find it when I went looking how to do what my patch somewhat hackishly achieves. > will, instead of growing, push the current data out using SYSCTL_OUT > to a wired user buffer. There's a few examples in the vm/ code. This > can sometimes significantly simplify the code since there's no need to > worry about held mutex/rwlock anymore. I need to MFC the work my patch is against at some point... if/when you MFC the sbuf_set_drain() and sbuf_new_for_sysctl() patches, I'll be happy to switch to using sbuf_new_for_sysctl(). I'll wait until the MFC is done though before switching. Cheers, Lawrence From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 07:16:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76169106564A; Mon, 24 Jan 2011 07:16:20 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64EB08FC17; Mon, 24 Jan 2011 07:16:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O7GKDn081896; Mon, 24 Jan 2011 07:16:20 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O7GK0R081894; Mon, 24 Jan 2011 07:16:20 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201101240716.p0O7GK0R081894@svn.freebsd.org> From: Maxim Sobolev Date: Mon, 24 Jan 2011 07:16:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217771 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 07:16:20 -0000 Author: sobomax Date: Mon Jan 24 07:16:20 2011 New Revision: 217771 URL: http://svn.freebsd.org/changeset/base/217771 Log: o Cylinder numbers are 10 bits in the MBR; o Sector numbers are only 6 bits in the MBR; o bde'cize name of the local variable. Submitted by: bde Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Mon Jan 24 06:46:03 2011 (r217770) +++ head/sbin/fdisk/fdisk.c Mon Jan 24 07:16:20 2011 (r217771) @@ -62,7 +62,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp, size) if (decimal(str, &tmp, ans, size)) ans = tmp +#define Decimal(str, ans, tmp, nbits) if (decimal(str, &tmp, ans, nbits)) ans = tmp #define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +247,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt, int size); +static int decimal(const char *str, int *num, int deflt, int nbits); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +572,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ)); - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start)); - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size)); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); + Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); + Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +586,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp, sizeof(partp->dp_scyl)); - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd)); - Decimal("beginning sector", tsec, tmp, sizeof(partp->dp_ssect)); + Decimal("beginning cylinder", tcyl, tmp, 10); + Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); + Decimal("beginning sector", tsec, tmp, 6); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +596,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp, sizeof(partp->dp_ecyl)); - Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd)); - Decimal("ending sector", tsec, tmp, sizeof(partp->dp_esect)); + Decimal("ending cylinder", tcyl, tmp, 10); + Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd) * 8); + Decimal("ending sector", tsec, tmp, 6); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -915,16 +915,16 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt, int size) +decimal(const char *str, int *num, int deflt, int nbits) { - long long acc = 0, maxval; + long long acc = 0, limit; int c; char *cp; - if (size == 0) { - size = sizeof(*num); + if (nbits == 0) { + nbits = sizeof(*num) * 8; } - maxval = (long long)1 << (size * 8); + limit = (long long)1 << nbits; while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -941,7 +941,7 @@ decimal(const char *str, int *num, int d return 0; while ((c = *cp++)) { if (c <= '9' && c >= '0') { - if (acc < maxval) + if (acc < limit) acc = acc * 10 + c - '0'; } else break; @@ -949,8 +949,8 @@ decimal(const char *str, int *num, int d if (c == ' ' || c == '\t') while ((c = *cp) && (c == ' ' || c == '\t')) cp++; if (!c) { - if (acc >= maxval) { - acc = maxval - 1; + if (acc >= limit) { + acc = limit - 1; printf("%s is too big, it will be truncated to %lld\n", lbuf, acc); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 07:45:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 139401065693; Mon, 24 Jan 2011 07:45:15 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0338E8FC20; Mon, 24 Jan 2011 07:45:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O7jEkK082599; Mon, 24 Jan 2011 07:45:14 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O7jEXP082597; Mon, 24 Jan 2011 07:45:14 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101240745.p0O7jEXP082597@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Jan 2011 07:45:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217772 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 07:45:15 -0000 Author: adrian Date: Mon Jan 24 07:45:14 2011 New Revision: 217772 URL: http://svn.freebsd.org/changeset/base/217772 Log: Undo a local option which mistakenly crept into a commit. Modified: head/sys/conf/options Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Mon Jan 24 07:16:20 2011 (r217771) +++ head/sys/conf/options Mon Jan 24 07:45:14 2011 (r217772) @@ -650,7 +650,6 @@ UKBD_DFLT_KEYMAP opt_ukbd.h UPLCOM_INTR_INTERVAL opt_uplcom.h UVSCOM_DEFAULT_OPKTSIZE opt_uvscom.h UVSCOM_INTR_INTERVAL opt_uvscom.h -USB_HOST_ALIGN opt_usb.h # Embedded system options INIT_PATH From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 07:50:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5D11106564A; Mon, 24 Jan 2011 07:50:29 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B548D8FC29; Mon, 24 Jan 2011 07:50:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O7oTdW082734; Mon, 24 Jan 2011 07:50:29 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O7oTTp082731; Mon, 24 Jan 2011 07:50:29 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101240750.p0O7oTTp082731@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 24 Jan 2011 07:50:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217773 - in head/sys/modules: . khelp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 07:50:29 -0000 Author: lstewart Date: Mon Jan 24 07:50:29 2011 New Revision: 217773 URL: http://svn.freebsd.org/changeset/base/217773 Log: Add build infrastructure for Khelp modules. Sponsored by: FreeBSD Foundation Reviewed by: bz MFC after: 3 months Added: head/sys/modules/khelp/ head/sys/modules/khelp/Makefile (contents, props changed) Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Mon Jan 24 07:45:14 2011 (r217772) +++ head/sys/modules/Makefile Mon Jan 24 07:50:29 2011 (r217773) @@ -151,6 +151,7 @@ SUBDIR= ${_3dfx} \ jme \ joy \ kbdmux \ + khelp \ krpc \ ksyms \ le \ Added: head/sys/modules/khelp/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/khelp/Makefile Mon Jan 24 07:50:29 2011 (r217773) @@ -0,0 +1,5 @@ +# $FreeBSD$ + +SUBDIR= + +.include From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 08:10:59 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADC83106564A; Mon, 24 Jan 2011 08:10:59 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (mail.sippysoft.com [4.59.13.245]) by mx1.freebsd.org (Postfix) with ESMTP id 837A48FC08; Mon, 24 Jan 2011 08:10:59 +0000 (UTC) Received: from s0106005004e13421.vs.shawcable.net ([70.71.175.212] helo=[192.168.1.79]) by mail.sippysoft.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.72 (FreeBSD)) (envelope-from ) id 1PhHAW-0005Ox-U5; Sun, 23 Jan 2011 23:48:57 -0800 Message-ID: <4D3D2D9D.5090107@FreeBSD.org> Date: Sun, 23 Jan 2011 23:43:25 -0800 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: Warner Losh References: <201101220521.p0M5LLc7081184@svn.freebsd.org> <20110122172226.R13556@besplex.bde.org> <4D3D1B70.8020405@bsdimp.com> In-Reply-To: <4D3D1B70.8020405@bsdimp.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r217714 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 08:10:59 -0000 On 1/23/2011 10:25 PM, Warner Losh wrote: > In case it wasn't clear from Bruce's long explaination, parts of this > are technically wrong and need to be reverted or fixed. Yes, I know. Sorry for the delay, I've been away for a weekend. -Maxim From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 09:24:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCAE2106564A; Mon, 24 Jan 2011 09:24:20 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBA1F8FC08; Mon, 24 Jan 2011 09:24:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0O9OKAL085232; Mon, 24 Jan 2011 09:24:20 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0O9OKjN085230; Mon, 24 Jan 2011 09:24:20 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101240924.p0O9OKjN085230@svn.freebsd.org> From: Alexander Motin Date: Mon, 24 Jan 2011 09:24:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217774 - head/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 09:24:20 -0000 Author: mav Date: Mon Jan 24 09:24:20 2011 New Revision: 217774 URL: http://svn.freebsd.org/changeset/base/217774 Log: ICH7 SATA controller in legacy mode can provide access to SATA registers via AHCI-like memory resource at BAR(5). Use it if BIOS was so kind to allocate memory for that BAR. This allows hot-plug support and connection speed reporting. MFC after: 2 weeks Modified: head/sys/dev/ata/chipsets/ata-intel.c Modified: head/sys/dev/ata/chipsets/ata-intel.c ============================================================================== --- head/sys/dev/ata/chipsets/ata-intel.c Mon Jan 24 07:50:29 2011 (r217773) +++ head/sys/dev/ata/chipsets/ata-intel.c Mon Jan 24 09:24:20 2011 (r217774) @@ -60,10 +60,14 @@ static int ata_intel_new_setmode(device_ static int ata_intel_sch_setmode(device_t dev, int target, int mode); static int ata_intel_sata_getrev(device_t dev, int target); static int ata_intel_sata_status(device_t dev); +static int ata_intel_sata_ahci_read(device_t dev, int port, + int reg, u_int32_t *result); static int ata_intel_sata_cscr_read(device_t dev, int port, int reg, u_int32_t *result); static int ata_intel_sata_sidpr_read(device_t dev, int port, int reg, u_int32_t *result); +static int ata_intel_sata_ahci_write(device_t dev, int port, + int reg, u_int32_t result); static int ata_intel_sata_cscr_write(device_t dev, int port, int reg, u_int32_t result); static int ata_intel_sata_sidpr_write(device_t dev, int port, @@ -79,6 +83,7 @@ static void ata_intel_31244_reset(device #define INTEL_ICH5 2 #define INTEL_6CH 4 #define INTEL_6CH2 8 +#define INTEL_ICH7 16 /* * Intel chipset support functions @@ -113,11 +118,11 @@ ata_intel_probe(device_t dev) { ATA_I82801FB_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH6" }, { ATA_I82801FBM, 0, INTEL_AHCI, 0, ATA_SA150, "ICH6M" }, { ATA_I82801GB, 0, 0, 1, ATA_UDMA5, "ICH7" }, - { ATA_I82801GB_S1, 0, 0, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GB_R1, 0, 0, 0, ATA_SA300, "ICH7" }, + { ATA_I82801GB_S1, 0, INTEL_ICH7, 0, ATA_SA300, "ICH7" }, + { ATA_I82801GB_R1, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, { ATA_I82801GB_AH, 0, INTEL_AHCI, 0, ATA_SA300, "ICH7" }, - { ATA_I82801GBM_S1, 0, 0, 0, ATA_SA150, "ICH7M" }, - { ATA_I82801GBM_R1, 0, 0, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_S1, 0, INTEL_ICH7, 0, ATA_SA150, "ICH7M" }, + { ATA_I82801GBM_R1, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I82801GBM_AH, 0, INTEL_AHCI, 0, ATA_SA150, "ICH7M" }, { ATA_I63XXESB2, 0, 0, 1, ATA_UDMA5, "63XXESB2" }, { ATA_I63XXESB2_S1, 0, 0, 0, ATA_SA300, "63XXESB2" }, @@ -250,14 +255,30 @@ ata_intel_chipinit(device_t dev) (pci_read_config(dev, 0x90, 1) & 0xc0) && (ata_ahci_chipinit(dev) != ENXIO)) return 0; - - /* if BAR(5) is IO it should point to SATA interface registers */ - ctlr->r_type2 = SYS_RES_IOPORT; - ctlr->r_rid2 = PCIR_BAR(5); - if ((ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, - &ctlr->r_rid2, RF_ACTIVE)) - || (ctlr->chip->cfg1 & INTEL_ICH5)) - ctlr->getrev = ata_intel_sata_getrev; + + /* BAR(5) may point to SATA interface registers */ + if ((ctlr->chip->cfg1 & INTEL_ICH7)) { + ctlr->r_type2 = SYS_RES_MEMORY; + ctlr->r_rid2 = PCIR_BAR(5); + ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, + &ctlr->r_rid2, RF_ACTIVE); + if (ctlr->r_res2 != NULL) { + /* Set SCRAE bit to enable registers access. */ + pci_write_config(dev, 0x94, + pci_read_config(dev, 0x94, 4) | (1 << 9), 4); + /* Set Ports Implemented register bits. */ + ATA_OUTL(ctlr->r_res2, 0x0C, + ATA_INL(ctlr->r_res2, 0x0C) | 0xf); + } + } else { + ctlr->r_type2 = SYS_RES_IOPORT; + ctlr->r_rid2 = PCIR_BAR(5); + ctlr->r_res2 = bus_alloc_resource_any(dev, ctlr->r_type2, + &ctlr->r_rid2, RF_ACTIVE); + } + if (ctlr->r_res2 != NULL || + (ctlr->chip->cfg1 & INTEL_ICH5)) + ctlr->getrev = ata_intel_sata_getrev; ctlr->setmode = ata_sata_setmode; } return 0; @@ -336,8 +357,13 @@ ata_intel_ch_attach(device_t dev) } else if (ctlr->r_res2) { ch->flags |= ATA_PERIODIC_POLL; ch->hw.status = ata_intel_sata_status; - ch->hw.pm_read = ata_intel_sata_sidpr_read; - ch->hw.pm_write = ata_intel_sata_sidpr_write; + if ((ctlr->chip->cfg1 & INTEL_ICH7)) { + ch->hw.pm_read = ata_intel_sata_ahci_read; + ch->hw.pm_write = ata_intel_sata_ahci_write; + } else { + ch->hw.pm_read = ata_intel_sata_sidpr_read; + ch->hw.pm_write = ata_intel_sata_sidpr_write; + }; } if (ch->hw.pm_write != NULL) { ata_sata_scr_write(ch, 0, @@ -537,6 +563,38 @@ ata_intel_sata_status(device_t dev) } static int +ata_intel_sata_ahci_read(device_t dev, int port, int reg, u_int32_t *result) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + device_t parent; + u_char *smap; + int offset; + + parent = device_get_parent(dev); + ctlr = device_get_softc(parent); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + offset = 0x100 + smap[port] * 0x80; + switch (reg) { + case ATA_SSTATUS: + reg = 0x28; + break; + case ATA_SCONTROL: + reg = 0x2c; + break; + case ATA_SERROR: + reg = 0x30; + break; + default: + return (EINVAL); + } + *result = ATA_INL(ctlr->r_res2, offset + reg); + return (0); +} + +static int ata_intel_sata_cscr_read(device_t dev, int port, int reg, u_int32_t *result) { struct ata_pci_controller *ctlr; @@ -598,6 +656,38 @@ ata_intel_sata_sidpr_read(device_t dev, } static int +ata_intel_sata_ahci_write(device_t dev, int port, int reg, u_int32_t value) +{ + struct ata_pci_controller *ctlr; + struct ata_channel *ch; + device_t parent; + u_char *smap; + int offset; + + parent = device_get_parent(dev); + ctlr = device_get_softc(parent); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + smap = (u_char *)&ctlr->chipset_data + ch->unit * 2; + offset = 0x100 + smap[port] * 0x80; + switch (reg) { + case ATA_SSTATUS: + reg = 0x28; + break; + case ATA_SCONTROL: + reg = 0x2c; + break; + case ATA_SERROR: + reg = 0x30; + break; + default: + return (EINVAL); + } + ATA_OUTL(ctlr->r_res2, offset + reg, value); + return (0); +} + +static int ata_intel_sata_cscr_write(device_t dev, int port, int reg, u_int32_t value) { struct ata_pci_controller *ctlr; From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 09:43:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B1511065670; Mon, 24 Jan 2011 09:43:14 +0000 (UTC) (envelope-from keramida@ceid.upatras.gr) Received: from igloo.linux.gr (igloo.linux.gr [62.1.205.36]) by mx1.freebsd.org (Postfix) with ESMTP id 7F0B08FC0A; Mon, 24 Jan 2011 09:43:13 +0000 (UTC) X-Spam-Status: No X-Hellug-MailScanner-From: keramida@ceid.upatras.gr X-Hellug-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-2.9, required 5, autolearn=not spam, ALL_TRUSTED -1.00, BAYES_00 -1.90) X-Hellug-MailScanner: Found to be clean X-Hellug-MailScanner-ID: p0O9OcMZ031963 Received: from gkeramidas-glaptop.linux.gr ([74.125.57.36]) (authenticated bits=0) by igloo.linux.gr (8.14.3/8.14.3/Debian-9.4) with ESMTP id p0O9OcMZ031963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 24 Jan 2011 11:24:44 +0200 From: Giorgos Keramidas To: Garrett Cooper References: <201101231108.p0NB8d3K053239@svn.freebsd.org> Date: Mon, 24 Jan 2011 10:24:37 +0100 In-Reply-To: (Garrett Cooper's message of "Sun, 23 Jan 2011 19:50:40 -0800") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Sergey Kandaurov , src-committers@freebsd.org Subject: Re: svn commit: r217746 - head/usr.bin/top X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 09:43:14 -0000 On Sun, 23 Jan 2011 19:50:40 -0800, Garrett Cooper wr= ote: > On Sun, Jan 23, 2011 at 6:44 PM, Sergey Kandaurov w= rote: >> On 23 January 2011 14:08, Giorgos Keramidas wrote: >>> Author: keramida (doc committer) >>> Date: Sun Jan 23 11:08:39 2011 >>> New Revision: 217746 >>> URL: http://svn.freebsd.org/changeset/base/217746 >>> >>> Log: >>> =A0Touch up the sample memory usage numbers a bit, to avoid wrapping >>> =A0on terminal boundary. =A0While here add definition for 'G' and fix >>> =A0the indentation of 'K' units. >> >> Thanks! (d'oh, I completely forgot about it) > > *sigh*.. K is not a unit modifier, it's a temperature unit, i.e. K -> > Kelvin, not K -> kilo- :(... > > This needs to be fixed upstream too to be SI compliant. True, the 'K' modified is not Kilo- in SI. But it's used in top(1) output, so we have to document it like this until it's changed in upstream code. From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 10:25:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9FBB106566B; Mon, 24 Jan 2011 10:25:08 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 254A78FC17; Mon, 24 Jan 2011 10:25:08 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id F1ED541C6B4; Mon, 24 Jan 2011 11:25:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id knd8j2tLh2cY; Mon, 24 Jan 2011 11:25:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 4CF2E41C6A7; Mon, 24 Jan 2011 11:25:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 6BC324448F3; Mon, 24 Jan 2011 10:20:42 +0000 (UTC) Date: Mon, 24 Jan 2011 10:20:42 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Warner Losh In-Reply-To: <4D3D1BCC.8040502@bsdimp.com> Message-ID: <20110124101804.A3489@maildrop.int.zabbadoz.net> References: <201101222310.p0MNAwIY007637@svn.freebsd.org> <4D3D1BCC.8040502@bsdimp.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217734 - head X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 10:25:08 -0000 On Sun, 23 Jan 2011, Warner Losh wrote: > On 01/22/2011 16:10, Bjoern A. Zeeb wrote: >> Author: bz >> Date: Sat Jan 22 23:10:58 2011 >> New Revision: 217734 >> URL: http://svn.freebsd.org/changeset/base/217734 >> >> Log: >> In `make targets` print the make variable TARGETS as we expect it rather >> than the grammatically better sounding variant without the 'S'. This >> allows copy and paste and is less confusing. >> > > Also, 'make targets' explains which targets are supported by make buildworld, > not make universe. Again, please revert. I see. Unfortunately the sparse documentation didn't say that and the target is sitting in a section of the Makefile that starts with # # universe # (for obvious reasons). And being told I understand it. What about: http://people.freebsd.org/~bz/20110124-01-make-targets.diff ! ! Back out r217734. [1] ! ! Properly document what `make targets` is supposed to list to avoid ! further confusion given the place the target sits. Should have happened ! with r217125. ! ! Requested by: imp [1] ! Index: share/man/man7/build.7 =================================================================== --- share/man/man7/build.7 (revision 217774) +++ share/man/man7/build.7 (working copy) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2011 +.Dd January 24, 2011 .Dt BUILD 7 .Os .Sh NAME @@ -229,6 +229,12 @@ This command takes a long time. .It Cm update Get updated sources as configured in .Xr make.conf 5 . +.It Cm targets +Print a list of supported +.Va TARGET +/ +.Va TARGET_ARCH +pairs for world and kernel targets. .It Cm tinderbox Execute the same targets as .Cm universe . Index: Makefile =================================================================== --- Makefile (revision 217774) +++ Makefile (working copy) @@ -28,7 +28,8 @@ # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. -# targets - Print a list of supported TARGET/TARGET_ARCH pairs. +# targets - Print a list of supported TARGET/TARGET_ARCH pairs +# for world and kernel targets. # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the @@ -297,7 +298,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGETS/TARGET_ARCH pairs" + @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" > Warner >> Modified: >> head/Makefile >> >> Modified: head/Makefile >> ============================================================================== >> --- head/Makefile Sat Jan 22 22:57:28 2011 (r217733) >> +++ head/Makefile Sat Jan 22 23:10:58 2011 (r217734) >> @@ -297,7 +297,7 @@ TARGET_ARCHES_${target}?= ${target} >> .endfor >> >> targets: >> - @echo "Supported TARGET/TARGET_ARCH pairs" >> + @echo "Supported TARGETS/TARGET_ARCH pairs" >> .for target in ${TARGETS} >> .for target_arch in ${TARGET_ARCHES_${target}} >> @echo " ${target}/${target_arch}" >> >> >> > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 10:35:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B082106566B; Mon, 24 Jan 2011 10:35:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 260098FC0C; Mon, 24 Jan 2011 10:35:07 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id 7F2AA41C6A1; Mon, 24 Jan 2011 11:35:06 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id hu6Z3FFnm4GN; Mon, 24 Jan 2011 11:35:06 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 17B5541C6B4; Mon, 24 Jan 2011 11:35:06 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 20CF84448F3; Mon, 24 Jan 2011 10:33:22 +0000 (UTC) Date: Mon, 24 Jan 2011 10:33:21 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Warner Losh In-Reply-To: <4D3D1AC6.7030003@bsdimp.com> Message-ID: <20110124095030.Q3489@maildrop.int.zabbadoz.net> References: <201101222257.p0MMvSZY007310@svn.freebsd.org> <20110123104812.A3489@maildrop.int.zabbadoz.net> <4D3D1AC6.7030003@bsdimp.com> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Garrett Cooper Subject: Re: svn commit: r217733 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 10:35:07 -0000 On Sun, 23 Jan 2011, Warner Losh wrote: > On 01/23/2011 03:51, Bjoern A. Zeeb wrote: >> On Sat, 22 Jan 2011, Garrett Cooper wrote: >> >>> On Sat, Jan 22, 2011 at 2:57 PM, Bjoern A. Zeeb wrote: >>>> Author: bz >>>> Date: Sat Jan 22 22:57:28 2011 >>>> New Revision: 217733 >>>> URL: http://svn.freebsd.org/changeset/base/217733 >>>> >>>> Log: >>>> Properly document what the top-level `make tinderbox` does. >>>> >>>> Reviewed by: jmallett >>>> MFC After: 3 days >>>> X-MFC: build.7 only >>> >>> As much as I like make universe and tinderbox, for the purpose of >>> development testing would it make sense if there was a tinderbox >>> target that actually died on its first failure? tinderbox and universe >> >> I think not really; if you want to catch errors, you want all of them >> and not just the first broken kernel if there are 12. >> >>> seems to be useful when dealing with known breakage or when executing >>> periodic builds, but I don't know think it's as effective with >>> development testing, as for some of the stuff I just want to build on >>> something other than my host arch and another arch that isn't x86 (say >>> arm, mips, powerpc) just to make sure that I didn't break anything >>> endian wise (if the code is that nasty). >> >> make universe TARGETS=arm >> or >> make universe TARGETS="i386 amd64 sparc64 ia64" >> >> works perfectly well (again). Even >> >> make universe TARGETS=mips TARGET_ARCH=mips64eb KERNCONFS=XLR64 >> >> should be perfectly fine. > > Except, it isn't fine. That's a horrible interface. Right. But it works perfectly fine for most cases, can be scripted and is a tool for developers and automated (full) testing, which I think has been underutilized the last years. > It doesn't work if TARGETS="i386 mips". .. and you set TARGET_ARCH=mips64eb. Well yeah. That never worked and is kind of obvious given boolean algebra. But that's not what you are saying as the "doesn't work" not means it will instantly fail but more means that it ignores the TARGET_ARCH in that case, right? Not the result I would have expected btw. but probably better than what I expected:) make -s -j8 universe __MAKE_CONF=/dev/null TARGETS="i386 mips" TARGET_ARCH=mips64eb -------------------------------------------------------------- >>> make universe started on Mon Jan 24 10:23:00 UTC 2011 -------------------------------------------------------------- >> mips started on Mon Jan 24 10:23:00 UTC 2011 >> i386 started on Mon Jan 24 10:23:00 UTC 2011 >> mips.mipseb buildworld started on Mon Jan 24 10:23:00 UTC 2011 >> mips.mips64eb buildworld started on Mon Jan 24 10:23:00 UTC 2011 >> mips.mips64el buildworld started on Mon Jan 24 10:23:00 UTC 2011 >> i386.i386 buildworld started on Mon Jan 24 10:23:00 UTC 2011 >> mips.mipsel buildworld started on Mon Jan 24 10:23:00 UTC 2011 ^C -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 10:54:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4ACE61065674; Mon, 24 Jan 2011 10:54:10 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3A59B8FC15; Mon, 24 Jan 2011 10:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OAsAsK088351; Mon, 24 Jan 2011 10:54:10 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OAsAhs088349; Mon, 24 Jan 2011 10:54:10 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201101241054.p0OAsAhs088349@svn.freebsd.org> From: Robert Watson Date: Mon, 24 Jan 2011 10:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217775 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 10:54:10 -0000 Author: rwatson Date: Mon Jan 24 10:54:09 2011 New Revision: 217775 URL: http://svn.freebsd.org/changeset/base/217775 Log: Fix off-by-one whitespace error in netstat -Q workstream listing. Reported by: bz MFC after: 3 days Sponsored by: Juniper Networks Modified: head/usr.bin/netstat/netisr.c Modified: head/usr.bin/netstat/netisr.c ============================================================================== --- head/usr.bin/netstat/netisr.c Mon Jan 24 09:24:20 2011 (r217774) +++ head/usr.bin/netstat/netisr.c Mon Jan 24 10:54:09 2011 (r217775) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2010 Juniper Networks, Inc. + * Copyright (c) 2010-2011 Juniper Networks, Inc. * All rights reserved. * * This software was developed by Robert N. M. Watson under contract @@ -445,11 +445,11 @@ netisr_print_workstream(struct sysctl_ne if (snwp->snw_wsid != snwsp->snws_wsid) continue; if (first) { - printf("%4u", snwsp->snws_wsid); - printf(" %3u", snwsp->snws_cpu); + printf("%4u ", snwsp->snws_wsid); + printf("%3u ", snwsp->snws_cpu); first = 0; } else - printf("%4s %3s", "", ""); + printf("%4s %3s ", "", ""); printf("%2s", ""); printf("%-6s", netisr_proto2name(snwp->snw_proto)); printf(" %5u", snwp->snw_len); From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 10:58:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CB2A21065670; Mon, 24 Jan 2011 10:58:36 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA96D8FC0C; Mon, 24 Jan 2011 10:58:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OAwawY088496; Mon, 24 Jan 2011 10:58:36 GMT (envelope-from rwatson@svn.freebsd.org) Received: (from rwatson@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OAwa4A088494; Mon, 24 Jan 2011 10:58:36 GMT (envelope-from rwatson@svn.freebsd.org) Message-Id: <201101241058.p0OAwa4A088494@svn.freebsd.org> From: Robert Watson Date: Mon, 24 Jan 2011 10:58:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217776 - head/usr.bin/netstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 10:58:36 -0000 Author: rwatson Date: Mon Jan 24 10:58:36 2011 New Revision: 217776 URL: http://svn.freebsd.org/changeset/base/217776 Log: While printing out the WSID and CPU ID only the first time it appears for each workstream, rather than on every protocol, is prettier, it makes machine-parsing of netstat -Q output a lot harder. Repeat the information and hope that the user forgives us slightly dense formatting. MFC after: 3 days Reported by: bz Sponsored by: Juniper Networks Modified: head/usr.bin/netstat/netisr.c Modified: head/usr.bin/netstat/netisr.c ============================================================================== --- head/usr.bin/netstat/netisr.c Mon Jan 24 10:54:09 2011 (r217775) +++ head/usr.bin/netstat/netisr.c Mon Jan 24 10:58:36 2011 (r217776) @@ -436,20 +436,14 @@ static void netisr_print_workstream(struct sysctl_netisr_workstream *snwsp) { struct sysctl_netisr_work *snwp; - int first; u_int i; - first = 1; for (i = 0; i < work_array_len; i++) { snwp = &work_array[i]; if (snwp->snw_wsid != snwsp->snws_wsid) continue; - if (first) { - printf("%4u ", snwsp->snws_wsid); - printf("%3u ", snwsp->snws_cpu); - first = 0; - } else - printf("%4s %3s ", "", ""); + printf("%4u ", snwsp->snws_wsid); + printf("%3u ", snwsp->snws_cpu); printf("%2s", ""); printf("%-6s", netisr_proto2name(snwp->snw_proto)); printf(" %5u", snwp->snw_len); From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 11:06:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E49C410656A7; Mon, 24 Jan 2011 11:06:40 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D45CA8FC0A; Mon, 24 Jan 2011 11:06:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OB6edc088763; Mon, 24 Jan 2011 11:06:40 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OB6eZq088761; Mon, 24 Jan 2011 11:06:40 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101241106.p0OB6eZq088761@svn.freebsd.org> From: Ulrich Spoerlein Date: Mon, 24 Jan 2011 11:06:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217777 - head/lib/libkvm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 11:06:41 -0000 Author: uqs Date: Mon Jan 24 11:06:40 2011 New Revision: 217777 URL: http://svn.freebsd.org/changeset/base/217777 Log: libkvm: Unbreak build for powerpc64/powerpc This slipped through my testing due to the recent roto-tiling of the ARCH/TARGET parts that I need to catch up with. Mea culpa. Modified: head/lib/libkvm/kvm_powerpc64.c Modified: head/lib/libkvm/kvm_powerpc64.c ============================================================================== --- head/lib/libkvm/kvm_powerpc64.c Mon Jan 24 10:58:36 2011 (r217776) +++ head/lib/libkvm/kvm_powerpc64.c Mon Jan 24 11:06:40 2011 (r217777) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include "kvm_private.h" From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 14:24:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCA46106564A; Mon, 24 Jan 2011 14:24:10 +0000 (UTC) (envelope-from ivoras@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBB918FC1A; Mon, 24 Jan 2011 14:24:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OEOAde093232; Mon, 24 Jan 2011 14:24:10 GMT (envelope-from ivoras@svn.freebsd.org) Received: (from ivoras@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OEOAGN093230; Mon, 24 Jan 2011 14:24:10 GMT (envelope-from ivoras@svn.freebsd.org) Message-Id: <201101241424.p0OEOAGN093230@svn.freebsd.org> From: Ivan Voras Date: Mon, 24 Jan 2011 14:24:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217780 - head/sbin/geom/class/virstor X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 14:24:10 -0000 Author: ivoras Date: Mon Jan 24 14:24:10 2011 New Revision: 217780 URL: http://svn.freebsd.org/changeset/base/217780 Log: Added a blurb about thin provisioning, fixed some formatting. Modified: head/sbin/geom/class/virstor/gvirstor.8 Modified: head/sbin/geom/class/virstor/gvirstor.8 ============================================================================== --- head/sbin/geom/class/virstor/gvirstor.8 Mon Jan 24 14:01:30 2011 (r217779) +++ head/sbin/geom/class/virstor/gvirstor.8 Mon Jan 24 14:24:10 2011 (r217780) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2006-2008 Ivan Voras +.\" Copyright (c) 2006-2011 Ivan Voras .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 17, 2008 +.Dd January 24, 2011 .Dt GVIRSTOR 8 .Os .Sh NAME @@ -80,6 +80,10 @@ The idea behind is similar to the concept of Virtual Memory in operating systems, effectively allowing users to overcommit on storage .Pq free file system space . +The concept is also known as "thin provisioning" in virtualization +environments, only here it is implemented on the level of physical storage +devices. +.Pp The first argument to .Nm indicates an action to be performed: From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 15:04:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A99F1065670; Mon, 24 Jan 2011 15:04:16 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190E68FC13; Mon, 24 Jan 2011 15:04:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OF4Fq3094434; Mon, 24 Jan 2011 15:04:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OF4F56094428; Mon, 24 Jan 2011 15:04:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101241504.p0OF4F56094428@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Mon, 24 Jan 2011 15:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217784 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:04:16 -0000 Author: pjd Date: Mon Jan 24 15:04:15 2011 New Revision: 217784 URL: http://svn.freebsd.org/changeset/base/217784 Log: Don't open configuration file from worker process. Handle SIGHUP in the master process only and pass changes to the worker processes over control socket. This removes access to global namespace in preparation for capsicum sandboxing. MFC after: 2 weeks Modified: head/sbin/hastd/control.c head/sbin/hastd/control.h head/sbin/hastd/hastd.c head/sbin/hastd/hastd.h head/sbin/hastd/primary.c Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Mon Jan 24 14:53:53 2011 (r217783) +++ head/sbin/hastd/control.c Mon Jan 24 15:04:15 2011 (r217784) @@ -411,7 +411,6 @@ ctrl_thread(void *arg) nv_free(nvin); continue; } - nv_free(nvin); nvout = nv_alloc(); switch (cmd) { case HASTCTL_STATUS: @@ -433,11 +432,23 @@ ctrl_thread(void *arg) nv_add_uint32(nvout, (uint32_t)0, "keepdirty"); nv_add_uint64(nvout, (uint64_t)0, "dirty"); } + nv_add_int16(nvout, 0, "error"); + break; + case HASTCTL_RELOAD: + /* + * When parent receives SIGHUP and discovers that + * something related to us has changes, it sends reload + * message to us. + */ + assert(res->hr_role == HAST_ROLE_PRIMARY); + primary_config_reload(res, nvin); + nv_add_int16(nvout, 0, "error"); break; default: nv_add_int16(nvout, EINVAL, "error"); break; } + nv_free(nvin); if (nv_error(nvout) != 0) { pjdlog_error("Unable to create answer on control message."); nv_free(nvout); Modified: head/sbin/hastd/control.h ============================================================================== --- head/sbin/hastd/control.h Mon Jan 24 14:53:53 2011 (r217783) +++ head/sbin/hastd/control.h Mon Jan 24 15:04:15 2011 (r217784) @@ -34,6 +34,7 @@ #define HASTCTL_SET_ROLE 1 #define HASTCTL_STATUS 2 +#define HASTCTL_RELOAD 3 struct hastd_config; struct hast_resource; Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Mon Jan 24 14:53:53 2011 (r217783) +++ head/sbin/hastd/hastd.c Mon Jan 24 15:04:15 2011 (r217784) @@ -205,6 +205,45 @@ resource_needs_reload(const struct hast_ } static void +resource_reload(const struct hast_resource *res) +{ + struct nv *nvin, *nvout; + int error; + + assert(res->hr_role == HAST_ROLE_PRIMARY); + + nvout = nv_alloc(); + nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd"); + nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr"); + nv_add_int32(nvout, (int32_t)res->hr_replication, "replication"); + nv_add_int32(nvout, (int32_t)res->hr_timeout, "timeout"); + nv_add_string(nvout, res->hr_exec, "exec"); + if (nv_error(nvout) != 0) { + nv_free(nvout); + pjdlog_error("Unable to allocate header for reload message."); + return; + } + if (hast_proto_send(res, res->hr_ctrl, nvout, NULL, 0) < 0) { + pjdlog_errno(LOG_ERR, "Unable to send reload message"); + nv_free(nvout); + return; + } + nv_free(nvout); + + /* Receive response. */ + if (hast_proto_recv_hdr(res->hr_ctrl, &nvin) < 0) { + pjdlog_errno(LOG_ERR, "Unable to receive reload reply"); + return; + } + error = nv_get_int16(nvin, "error"); + nv_free(nvin); + if (error != 0) { + pjdlog_common(LOG_ERR, 0, error, "Reload failed"); + return; + } +} + +static void hastd_reload(void) { struct hastd_config *newcfg; @@ -338,13 +377,8 @@ hastd_reload(void) cres->hr_timeout = nres->hr_timeout; strlcpy(cres->hr_exec, nres->hr_exec, sizeof(cres->hr_exec)); - if (cres->hr_workerpid != 0) { - if (kill(cres->hr_workerpid, SIGHUP) < 0) { - pjdlog_errno(LOG_WARNING, - "Unable to send SIGHUP to worker process %u", - (unsigned int)cres->hr_workerpid); - } - } + if (cres->hr_workerpid != 0) + resource_reload(cres); } } Modified: head/sbin/hastd/hastd.h ============================================================================== --- head/sbin/hastd/hastd.h Mon Jan 24 14:53:53 2011 (r217783) +++ head/sbin/hastd/hastd.h Mon Jan 24 15:04:15 2011 (r217784) @@ -46,4 +46,6 @@ extern struct pidfh *pfh; void hastd_primary(struct hast_resource *res); void hastd_secondary(struct hast_resource *res, struct nv *nvin); +void primary_config_reload(struct hast_resource *res, struct nv *nv); + #endif /* !_HASTD_H_ */ Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Mon Jan 24 14:53:53 2011 (r217783) +++ head/sbin/hastd/primary.c Mon Jan 24 15:04:15 2011 (r217784) @@ -836,6 +836,7 @@ hastd_primary(struct hast_resource *res) init_local(res); init_ggate(res); init_environment(res); + /* * Create the guard thread first, so we can handle signals from the * very begining. @@ -1844,47 +1845,32 @@ free_queue: return (NULL); } -static void -config_reload(void) +void +primary_config_reload(struct hast_resource *res, struct nv *nv) { - struct hastd_config *newcfg; - struct hast_resource *res; unsigned int ii, ncomps; - int modified; + int modified, vint; + const char *vstr; pjdlog_info("Reloading configuration..."); - ncomps = HAST_NCOMPONENTS; - - newcfg = yy_config_parse(cfgpath, false); - if (newcfg == NULL) - goto failed; + assert(res->hr_role == HAST_ROLE_PRIMARY); + assert(gres == res); + nv_assert(nv, "remoteaddr"); + nv_assert(nv, "replication"); + nv_assert(nv, "timeout"); + nv_assert(nv, "exec"); - TAILQ_FOREACH(res, &newcfg->hc_resources, hr_next) { - if (strcmp(res->hr_name, gres->hr_name) == 0) - break; - } - /* - * If resource was removed from the configuration file, resource - * name, provider name or path to local component was modified we - * shouldn't be here. This means that someone modified configuration - * file and send SIGHUP to us instead of main hastd process. - * Log advice and ignore the signal. - */ - if (res == NULL || strcmp(gres->hr_name, res->hr_name) != 0 || - strcmp(gres->hr_provname, res->hr_provname) != 0 || - strcmp(gres->hr_localpath, res->hr_localpath) != 0) { - pjdlog_warning("To reload configuration send SIGHUP to the main hastd process (pid %u).", - (unsigned int)getppid()); - goto failed; - } + ncomps = HAST_NCOMPONENTS; #define MODIFIED_REMOTEADDR 0x1 #define MODIFIED_REPLICATION 0x2 #define MODIFIED_TIMEOUT 0x4 #define MODIFIED_EXEC 0x8 modified = 0; - if (strcmp(gres->hr_remoteaddr, res->hr_remoteaddr) != 0) { + + vstr = nv_get_string(nv, "remoteaddr"); + if (strcmp(gres->hr_remoteaddr, vstr) != 0) { /* * Don't copy res->hr_remoteaddr to gres just yet. * We want remote_close() to log disconnect from the old @@ -1892,18 +1878,22 @@ config_reload(void) */ modified |= MODIFIED_REMOTEADDR; } - if (gres->hr_replication != res->hr_replication) { - gres->hr_replication = res->hr_replication; + vint = nv_get_int32(nv, "replication"); + if (gres->hr_replication != vint) { + gres->hr_replication = vint; modified |= MODIFIED_REPLICATION; } - if (gres->hr_timeout != res->hr_timeout) { - gres->hr_timeout = res->hr_timeout; + vint = nv_get_int32(nv, "timeout"); + if (gres->hr_timeout != vint) { + gres->hr_timeout = vint; modified |= MODIFIED_TIMEOUT; } - if (strcmp(gres->hr_exec, res->hr_exec) != 0) { - strlcpy(gres->hr_exec, res->hr_exec, sizeof(gres->hr_exec)); + vstr = nv_get_string(nv, "exec"); + if (strcmp(gres->hr_exec, vstr) != 0) { + strlcpy(gres->hr_exec, vstr, sizeof(gres->hr_exec)); modified |= MODIFIED_EXEC; } + /* * If only timeout was modified we only need to change it without * reconnecting. @@ -1937,7 +1927,8 @@ config_reload(void) remote_close(gres, ii); } if (modified & MODIFIED_REMOTEADDR) { - strlcpy(gres->hr_remoteaddr, res->hr_remoteaddr, + vstr = nv_get_string(nv, "remoteaddr"); + strlcpy(gres->hr_remoteaddr, vstr, sizeof(gres->hr_remoteaddr)); } } @@ -1947,16 +1938,6 @@ config_reload(void) #undef MODIFIED_EXEC pjdlog_info("Configuration reloaded successfully."); - return; -failed: - if (newcfg != NULL) { - if (newcfg->hc_controlconn != NULL) - proto_close(newcfg->hc_controlconn); - if (newcfg->hc_listenconn != NULL) - proto_close(newcfg->hc_listenconn); - yy_config_free(newcfg); - } - pjdlog_warning("Configuration not reloaded."); } static void @@ -2032,7 +2013,6 @@ guard_thread(void *arg) lastcheck = time(NULL); PJDLOG_VERIFY(sigemptyset(&mask) == 0); - PJDLOG_VERIFY(sigaddset(&mask, SIGHUP) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGINT) == 0); PJDLOG_VERIFY(sigaddset(&mask, SIGTERM) == 0); @@ -2042,9 +2022,6 @@ guard_thread(void *arg) for (;;) { switch (signo) { - case SIGHUP: - config_reload(); - break; case SIGINT: case SIGTERM: sigexit_received = true; From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 15:05:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B556106564A; Mon, 24 Jan 2011 15:05:51 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 3F5A58FC16; Mon, 24 Jan 2011 15:05:51 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EFDC546B17; Mon, 24 Jan 2011 10:05:50 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id B33748A027; Mon, 24 Jan 2011 10:05:49 -0500 (EST) From: John Baldwin To: Adrian Chadd Date: Mon, 24 Jan 2011 08:26:55 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101240745.p0O7jEXP082597@svn.freebsd.org> In-Reply-To: <201101240745.p0O7jEXP082597@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101240826.55315.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Mon, 24 Jan 2011 10:05:50 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217772 - head/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:05:51 -0000 On Monday, January 24, 2011 2:45:14 am Adrian Chadd wrote: > Author: adrian > Date: Mon Jan 24 07:45:14 2011 > New Revision: 217772 > URL: http://svn.freebsd.org/changeset/base/217772 > > Log: > Undo a local option which mistakenly crept into a commit. > > Modified: > head/sys/conf/options Presumably it should be moved to where Hans added it rather than removed? -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 15:11:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 792791065673; Mon, 24 Jan 2011 15:11:08 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D658FC1A; Mon, 24 Jan 2011 15:11:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OFB81H095160; Mon, 24 Jan 2011 15:11:08 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OFB8o3095157; Mon, 24 Jan 2011 15:11:08 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201101241511.p0OFB8o3095157@svn.freebsd.org> From: Glen Barber Date: Mon, 24 Jan 2011 15:11:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217786 - head/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:11:08 -0000 Author: gjb (doc committer) Date: Mon Jan 24 15:11:08 2011 New Revision: 217786 URL: http://svn.freebsd.org/changeset/base/217786 Log: Add missing section number for .Xr rc. Pointed out by: keramida Approved by: keramida (mentor) Modified: head/share/man/man5/rc.conf.5 Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Mon Jan 24 15:05:57 2011 (r217785) +++ head/share/man/man5/rc.conf.5 Mon Jan 24 15:11:08 2011 (r217786) @@ -67,7 +67,7 @@ for historical reasons. In addition to .Pa /etc/rc.conf.local you can also place smaller configuration files for each -.Xr rc +.Xr rc 8 script in the .Pa /etc/rc.conf.d directory, which will be included by the From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 15:17:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 13478106566C; Mon, 24 Jan 2011 15:17:11 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0204A8FC40; Mon, 24 Jan 2011 15:17:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OFHAm9096038; Mon, 24 Jan 2011 15:17:10 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OFHAFp096035; Mon, 24 Jan 2011 15:17:10 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201101241517.p0OFHAFp096035@svn.freebsd.org> From: Glen Barber Date: Mon, 24 Jan 2011 15:17:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217787 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:17:11 -0000 Author: gjb (doc committer) Date: Mon Jan 24 15:17:10 2011 New Revision: 217787 URL: http://svn.freebsd.org/changeset/base/217787 Log: MFC 217148, 217786: Document rc.conf.d in rc.conf(5). PR: 140495 Approved by: keramida (mentor) Modified: stable/8/share/man/man5/rc.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/rc.conf.5 ============================================================================== --- stable/8/share/man/man5/rc.conf.5 Mon Jan 24 15:11:08 2011 (r217786) +++ stable/8/share/man/man5/rc.conf.5 Mon Jan 24 15:17:10 2011 (r217787) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2010 +.Dd January 7, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -64,7 +64,19 @@ The file is used to override settings in .Pa /etc/rc.conf for historical reasons. -See the +In addition to +.Pa /etc/rc.conf.local +you can also place smaller configuration files for each +.Xr rc 8 +script in the +.Pa /etc/rc.conf.d +directory, which will be included by the +.Va load_rc_config +function. +For jail configurations you could use the file +.Pa /etc/rc.conf.d/jail +to store jail specific configuration options. +Also see the .Va rc_conf_files variable below. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 15:18:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2F55106566B; Mon, 24 Jan 2011 15:18:18 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D047B8FC16; Mon, 24 Jan 2011 15:18:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OFIIB3096277; Mon, 24 Jan 2011 15:18:18 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OFIIJB096275; Mon, 24 Jan 2011 15:18:18 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201101241518.p0OFIIJB096275@svn.freebsd.org> From: Glen Barber Date: Mon, 24 Jan 2011 15:18:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217788 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 15:18:19 -0000 Author: gjb (doc committer) Date: Mon Jan 24 15:18:18 2011 New Revision: 217788 URL: http://svn.freebsd.org/changeset/base/217788 Log: MFC 217148, 217786: Document rc.conf.d in rc.conf(5). PR: 140495 Approved by: keramida (mentor) Modified: stable/7/share/man/man5/rc.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/rc.conf.5 ============================================================================== --- stable/7/share/man/man5/rc.conf.5 Mon Jan 24 15:17:10 2011 (r217787) +++ stable/7/share/man/man5/rc.conf.5 Mon Jan 24 15:18:18 2011 (r217788) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 13, 2010 +.Dd January 7, 2011 .Dt RC.CONF 5 .Os .Sh NAME @@ -64,7 +64,19 @@ The file is used to override settings in .Pa /etc/rc.conf for historical reasons. -See the +In addition to +.Pa /etc/rc.conf.local +you can also place smaller configuration files for each +.Xr rc 8 +script in the +.Pa /etc/rc.conf.d +directory, which will be included by the +.Va load_rc_config +function. +For jail configurations you could use the file +.Pa /etc/rc.conf.d/jail +to store jail specific configuration options. +Also see the .Va rc_conf_files variable below. .Pp From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 17:03:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C00751065679; Mon, 24 Jan 2011 17:03:22 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF2478FC23; Mon, 24 Jan 2011 17:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OH3M5m099427; Mon, 24 Jan 2011 17:03:22 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OH3Mqb099425; Mon, 24 Jan 2011 17:03:22 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101241703.p0OH3Mqb099425@svn.freebsd.org> From: Adrian Chadd Date: Mon, 24 Jan 2011 17:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217790 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:03:22 -0000 Author: adrian Date: Mon Jan 24 17:03:22 2011 New Revision: 217790 URL: http://svn.freebsd.org/changeset/base/217790 Log: Remove an invalid register setup; this is likely a holdover from the AR5212 code. It doesn't exist in ath9k and I've been told it doesn't exist in the Atheros internal driver. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Jan 24 16:39:20 2011 (r217789) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Mon Jan 24 17:03:22 2011 (r217790) @@ -209,9 +209,6 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO #endif } - /* Set ADC/DAC select values */ - OS_REG_WRITE(ah, AR_PHY_SLEEP_SCAL, 0x0e); - if (AH5416(ah)->ah_rx_chainmask == 0x5 || AH5416(ah)->ah_tx_chainmask == 0x5) OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 17:08:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74E9B1065673; Mon, 24 Jan 2011 17:08:26 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 649EA8FC1D; Mon, 24 Jan 2011 17:08:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OH8QDF099617; Mon, 24 Jan 2011 17:08:26 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OH8Qmu099615; Mon, 24 Jan 2011 17:08:26 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201101241708.p0OH8Qmu099615@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 24 Jan 2011 17:08:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217792 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:08:26 -0000 Author: jh Date: Mon Jan 24 17:08:26 2011 New Revision: 217792 URL: http://svn.freebsd.org/changeset/base/217792 Log: Replace spaces with tabs. Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Mon Jan 24 17:04:21 2011 (r217791) +++ head/sys/kern/vfs_mount.c Mon Jan 24 17:08:26 2011 (r217792) @@ -816,7 +816,7 @@ vfs_domount_first( * XXX The final recipients of VFS_MOUNT just overwrite the ndp they * get. No freeing of cn_pnbuf. */ - error = VFS_MOUNT(mp); + error = VFS_MOUNT(mp); if (error != 0) { vfs_unbusy(mp); vfs_mount_destroy(mp); @@ -940,7 +940,7 @@ vfs_domount_update( * XXX The final recipients of VFS_MOUNT just overwrite the ndp they * get. No freeing of cn_pnbuf. */ - error = VFS_MOUNT(mp); + error = VFS_MOUNT(mp); if (error == 0) { /* Process the export option. */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 17:38:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C87D106564A; Mon, 24 Jan 2011 17:38:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2BB068FC0A; Mon, 24 Jan 2011 17:38:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OHccM6000527; Mon, 24 Jan 2011 17:38:38 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OHccPE000525; Mon, 24 Jan 2011 17:38:38 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201101241738.p0OHccPE000525@svn.freebsd.org> From: Hans Petter Selasky Date: Mon, 24 Jan 2011 17:38:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217793 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:38:38 -0000 Author: hselasky Date: Mon Jan 24 17:38:37 2011 New Revision: 217793 URL: http://svn.freebsd.org/changeset/base/217793 Log: Add more sanity checks for USB_HOST_ALIGN input values. Re-factor existing checks for readability. Approved by: thompsa (mentor) Modified: head/sys/dev/usb/usb_freebsd.h Modified: head/sys/dev/usb/usb_freebsd.h ============================================================================== --- head/sys/dev/usb/usb_freebsd.h Mon Jan 24 17:08:26 2011 (r217792) +++ head/sys/dev/usb/usb_freebsd.h Mon Jan 24 17:38:37 2011 (r217793) @@ -46,12 +46,15 @@ #define USB_TD_GET_PROC(td) (td)->td_proc #define USB_PROC_GET_GID(td) (td)->p_pgid -#if defined(USB_HOST_ALIGN) && (USB_HOST_ALIGN != 0) -/* USB_HOST_ALIGN is already defined and valid */ -#else +#if (!defined(USB_HOST_ALIGN)) || (USB_HOST_ALIGN <= 0) +/* Use default value. */ #undef USB_HOST_ALIGN #define USB_HOST_ALIGN 8 /* bytes, must be power of two */ #endif +/* Sanity check for USB_HOST_ALIGN: Verify power of two. */ +#if ((-USB_HOST_ALIGN) & USB_HOST_ALIGN) != USB_HOST_ALIGN +#error "USB_HOST_ALIGN is not power of two." +#endif #define USB_FS_ISOC_UFRAME_MAX 4 /* exclusive unit */ #define USB_BUS_MAX 256 /* units */ #define USB_MAX_DEVICES 128 /* units */ From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 17:53:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9C74106564A; Mon, 24 Jan 2011 17:53:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B923A8FC12; Mon, 24 Jan 2011 17:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OHrwfX000901; Mon, 24 Jan 2011 17:53:58 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OHrwjJ000899; Mon, 24 Jan 2011 17:53:58 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101241753.p0OHrwjJ000899@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 24 Jan 2011 17:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217794 - head/sys/dev/nfe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:53:59 -0000 Author: yongari Date: Mon Jan 24 17:53:58 2011 New Revision: 217794 URL: http://svn.freebsd.org/changeset/base/217794 Log: Reinitialize driver when MTU is changed and driver is running. Reported by: Huang, Yusheng ( yusheng.huang <> bluecoat com ) Modified: head/sys/dev/nfe/if_nfe.c Modified: head/sys/dev/nfe/if_nfe.c ============================================================================== --- head/sys/dev/nfe/if_nfe.c Mon Jan 24 17:38:37 2011 (r217793) +++ head/sys/dev/nfe/if_nfe.c Mon Jan 24 17:53:58 2011 (r217794) @@ -1709,8 +1709,10 @@ nfe_ioctl(struct ifnet *ifp, u_long cmd, else { NFE_LOCK(sc); ifp->if_mtu = ifr->ifr_mtu; - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) + if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; nfe_init_locked(sc); + } NFE_UNLOCK(sc); } } From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 18:03:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DAAC106564A; Mon, 24 Jan 2011 18:03:46 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6C60B8FC08; Mon, 24 Jan 2011 18:03:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OI3kOb001225; Mon, 24 Jan 2011 18:03:46 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OI3kw4001223; Mon, 24 Jan 2011 18:03:46 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101241803.p0OI3kw4001223@svn.freebsd.org> From: Jack F Vogel Date: Mon, 24 Jan 2011 18:03:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217795 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 18:03:46 -0000 Author: jfv Date: Mon Jan 24 18:03:45 2011 New Revision: 217795 URL: http://svn.freebsd.org/changeset/base/217795 Log: MFC 217705 - remove bogus TX UNLOCK Modified: stable/8/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 17:53:58 2011 (r217794) +++ stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 18:03:45 2011 (r217795) @@ -1870,7 +1870,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - IXGBE_TX_UNLOCK(txr); ixgbe_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 18:05:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D305106566C; Mon, 24 Jan 2011 18:05:49 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C1628FC14; Mon, 24 Jan 2011 18:05:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OI5nOL001354; Mon, 24 Jan 2011 18:05:49 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OI5nSj001352; Mon, 24 Jan 2011 18:05:49 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101241805.p0OI5nSj001352@svn.freebsd.org> From: Jack F Vogel Date: Mon, 24 Jan 2011 18:05:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217796 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 18:05:49 -0000 Author: jfv Date: Mon Jan 24 18:05:49 2011 New Revision: 217796 URL: http://svn.freebsd.org/changeset/base/217796 Log: MFC 217706 Add missing case for 82598DA to phy detect Modified: stable/8/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 18:03:45 2011 (r217795) +++ stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 18:05:49 2011 (r217796) @@ -2012,6 +2012,9 @@ ixgbe_setup_optics(struct adapter *adapt case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: adapter->optics = IFM_10G_CX4; break; + case IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU: + adapter->optics = IFM_10G_TWINAX; + break; case IXGBE_PHYSICAL_LAYER_1000BASE_KX: case IXGBE_PHYSICAL_LAYER_10GBASE_KR: case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 18:07:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5FDD106564A; Mon, 24 Jan 2011 18:07:57 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4EC98FC0A; Mon, 24 Jan 2011 18:07:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OI7vrE001472; Mon, 24 Jan 2011 18:07:57 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OI7vj7001470; Mon, 24 Jan 2011 18:07:57 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101241807.p0OI7vj7001470@svn.freebsd.org> From: Jack F Vogel Date: Mon, 24 Jan 2011 18:07:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217797 - stable/8/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 18:07:57 -0000 Author: jfv Date: Mon Jan 24 18:07:57 2011 New Revision: 217797 URL: http://svn.freebsd.org/changeset/base/217797 Log: MFC 217707 Don't do flow control if parameter is unchanged Modified: stable/8/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 18:05:49 2011 (r217796) +++ stable/8/sys/dev/ixgbe/ixgbe.c Mon Jan 24 18:07:57 2011 (r217797) @@ -5267,13 +5267,17 @@ static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; + int last = ixgbe_flow_control; struct adapter *adapter; error = sysctl_handle_int(oidp, &ixgbe_flow_control, 0, req); - if (error) return (error); + /* Don't bother if it's not changed */ + if (ixgbe_flow_control == last) + return (0); + adapter = (struct adapter *) arg1; switch (ixgbe_flow_control) { case ixgbe_fc_rx_pause: From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 18:11:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16904106564A; Mon, 24 Jan 2011 18:11:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 055698FC0A; Mon, 24 Jan 2011 18:11:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OIBbQT001642; Mon, 24 Jan 2011 18:11:37 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OIBbGm001640; Mon, 24 Jan 2011 18:11:37 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101241811.p0OIBbGm001640@svn.freebsd.org> From: Jung-uk Kim Date: Mon, 24 Jan 2011 18:11:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217798 - stable/8/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 18:11:38 -0000 Author: jkim Date: Mon Jan 24 18:11:37 2011 New Revision: 217798 URL: http://svn.freebsd.org/changeset/base/217798 Log: MFC: r217587 Fix yet another fallout from r208833. VM86 BIOS call may cause page fault when FPU is in use. Modified: stable/8/sys/i386/i386/vm86bios.s Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/i386/i386/vm86bios.s ============================================================================== --- stable/8/sys/i386/i386/vm86bios.s Mon Jan 24 18:07:57 2011 (r217797) +++ stable/8/sys/i386/i386/vm86bios.s Mon Jan 24 18:11:37 2011 (r217798) @@ -73,10 +73,9 @@ ENTRY(vm86_bioscall) je 1f /* no curproc/npxproc */ pushl %edx movl TD_PCB(%ecx),%ecx - addl $PCB_SAVEFPU,%ecx - pushl %ecx + pushl PCB_SAVEFPU(%ecx) call npxsave - popl %ecx + addl $4,%esp popl %edx /* recover our pcb */ 1: popfl From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 18:34:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 868AA106566B; Mon, 24 Jan 2011 18:34:16 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75AFE8FC23; Mon, 24 Jan 2011 18:34:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OIYGvJ002265; Mon, 24 Jan 2011 18:34:16 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OIYGJR002263; Mon, 24 Jan 2011 18:34:16 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101241834.p0OIYGJR002263@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 24 Jan 2011 18:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217800 - head/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 18:34:16 -0000 Author: marcel Date: Mon Jan 24 18:34:16 2011 New Revision: 217800 URL: http://svn.freebsd.org/changeset/base/217800 Log: In uart_tty_outwakeup(), check CTS/RTS flow control settings and prevent sending data when CTS is de-asserted. In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal changed, knowing that uart_tty_outwakeup() will do the right thing for flow control. This avoids redundant conditionals. PR: kern/148644 Submitted by: John Wehle MFC after: 3 days Modified: head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Mon Jan 24 18:24:28 2011 (r217799) +++ head/sys/dev/uart/uart_tty.c Mon Jan 24 18:34:16 2011 (r217800) @@ -168,6 +168,14 @@ uart_tty_outwakeup(struct tty *tp) if (sc->sc_txbusy) return; + /* + * Respect RTS/CTS (output) flow control if enabled and not already + * handled by hardware. + */ + if ((tp->t_termios.c_cflag & CCTS_OFLOW) && !sc->sc_hwoflow && + !(sc->sc_hwsig & SER_CTS)) + return; + sc->sc_txdatasz = ttydisc_getc(tp, sc->sc_txbuf, sc->sc_txfifosz); if (sc->sc_txdatasz != 0) UART_TRANSMIT(sc); @@ -315,11 +323,8 @@ uart_tty_intr(void *arg) sig = pend & SER_INT_SIGMASK; if (sig & SER_DDCD) ttydisc_modem(tp, sig & SER_DCD); - if ((sig & SER_DCTS) && (tp->t_termios.c_cflag & CCTS_OFLOW) && - !sc->sc_hwoflow) { - if (sig & SER_CTS) - uart_tty_outwakeup(tp); - } + if (sig & SER_DCTS) + uart_tty_outwakeup(tp); } if (pend & SER_INT_TXIDLE) From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 21:03:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7CEB1106566C; Mon, 24 Jan 2011 21:03:22 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6AA8C8FC12; Mon, 24 Jan 2011 21:03:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OL3Map006411; Mon, 24 Jan 2011 21:03:22 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OL3MwK006409; Mon, 24 Jan 2011 21:03:22 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101242103.p0OL3MwK006409@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 24 Jan 2011 21:03:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217803 - releng/8.2/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 21:03:22 -0000 Author: yongari Date: Mon Jan 24 21:03:22 2011 New Revision: 217803 URL: http://svn.freebsd.org/changeset/base/217803 Log: MFC r217548: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > Approved by: re (bz) Modified: releng/8.2/sys/dev/sis/if_sis.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/sis/if_sis.c ============================================================================== --- releng/8.2/sys/dev/sis/if_sis.c Mon Jan 24 20:59:23 2011 (r217802) +++ releng/8.2/sys/dev/sis/if_sis.c Mon Jan 24 21:03:22 2011 (r217803) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static int sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -808,80 +811,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - if_maddr_rlock(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + if_maddr_rlock(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + if_maddr_runlock(ifp); } - if_maddr_runlock(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -899,7 +939,7 @@ sis_setmulti_sis(struct sis_softc *sc) } if_maddr_runlock(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -910,7 +950,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2106,41 +2147,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2254,27 +2261,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 21:04:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 11246106567A; Mon, 24 Jan 2011 21:04:33 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F30348FC24; Mon, 24 Jan 2011 21:04:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OL4WaV006523; Mon, 24 Jan 2011 21:04:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OL4W8M006521; Mon, 24 Jan 2011 21:04:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101242104.p0OL4W8M006521@svn.freebsd.org> From: Pyun YongHyeon Date: Mon, 24 Jan 2011 21:04:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217804 - releng/7.4/sys/dev/sis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 21:04:33 -0000 Author: yongari Date: Mon Jan 24 21:04:32 2011 New Revision: 217804 URL: http://svn.freebsd.org/changeset/base/217804 Log: MFC r217548: Rework RX filter programming by providing separate handler for DP8381[56] and SiS 900/7016 controllers. After r212119, sis(4) no longer reinitializes controller if ALLMULTI/PROMISC was changed. However, RX filter handling code assumed some bits of the RX filter is programmed by driver initialization. This caused ALLMULTI/PROMISC configuration is ignored under certain conditions. Fix that issue by reprogramming all bits of RX filter register. While I'm here follow recommended RX filter programming steps recommended by National DP8381[56] data sheet(RX filter should be is disabled before programming). Reported by: Paul Schenkeveld < freebsd () psconsult dot nl > Tested by: Paul Schenkeveld < freebsd () psconsult dot nl > Approved by: re (bz) Modified: releng/7.4/sys/dev/sis/if_sis.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/sis/if_sis.c ============================================================================== --- releng/7.4/sys/dev/sis/if_sis.c Mon Jan 24 21:03:22 2011 (r217803) +++ releng/7.4/sys/dev/sis/if_sis.c Mon Jan 24 21:04:32 2011 (r217804) @@ -149,6 +149,9 @@ static int sis_ioctl(struct ifnet *, u_l static int sis_newbuf(struct sis_softc *, struct sis_rxdesc *); static int sis_resume(device_t); static void sis_rxeof(struct sis_softc *); +static void sis_rxfilter(struct sis_softc *); +static void sis_rxfilter_ns(struct sis_softc *); +static void sis_rxfilter_sis(struct sis_softc *); static void sis_start(struct ifnet *); static void sis_startl(struct ifnet *); static void sis_stop(struct sis_softc *); @@ -808,80 +811,117 @@ sis_mchash(struct sis_softc *sc, const u } static void -sis_setmulti_ns(struct sis_softc *sc) +sis_rxfilter(struct sis_softc *sc) +{ + + SIS_LOCK_ASSERT(sc); + + if (sc->sis_type == SIS_TYPE_83815) + sis_rxfilter_ns(sc); + else + sis_rxfilter_sis(sc); +} + +static void +sis_rxfilter_ns(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h = 0, i, filtsave; + uint32_t h, i, filter; int bit, index; ifp = sc->sis_ifp; - - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); - return; + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + /* + * Filter should be disabled to program other bits. + */ + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILTCTL_ENABLE); + CSR_READ_4(sc, SIS_RXFILT_CTL); } + filter &= ~(NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT | + NS_RXFILTCTL_MCHASH | SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); + if (ifp->if_flags & IFF_BROADCAST) + filter |= SIS_RXFILTCTL_BROAD; /* - * We have to explicitly enable the multicast hash table - * on the NatSemi chip if we want to use it, which we do. + * For the NatSemi chip, we have to explicitly enable the + * reception of ARP frames, as well as turn on the 'perfect + * match' filter where we store the station address, otherwise + * we won't receive unicasts meant for this host. */ - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_MCHASH); - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLMULTI); + filter |= NS_RXFILTCTL_ARP | NS_RXFILTCTL_PERFECT; - filtsave = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & IFF_PROMISC) + filter |= SIS_RXFILTCTL_ALLPHYS; + } else { + /* + * We have to explicitly enable the multicast hash table + * on the NatSemi chip if we want to use it, which we do. + */ + filter |= NS_RXFILTCTL_MCHASH; - /* first, zot all the existing hash bits */ - for (i = 0; i < 32; i++) { - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + (i*2)); - CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); - } + /* first, zot all the existing hash bits */ + for (i = 0; i < 32; i++) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + (i * 2)); + CSR_WRITE_4(sc, SIS_RXFILT_DATA, 0); + } - IF_ADDR_LOCK(ifp); - TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) - continue; - h = sis_mchash(sc, - LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); - index = h >> 3; - bit = h & 0x1F; - CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + index); - if (bit > 0xF) - bit -= 0x10; - SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + IF_ADDR_LOCK(ifp); + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + h = sis_mchash(sc, + LLADDR((struct sockaddr_dl *)ifma->ifma_addr)); + index = h >> 3; + bit = h & 0x1F; + CSR_WRITE_4(sc, SIS_RXFILT_CTL, NS_FILTADDR_FMEM_LO + + index); + if (bit > 0xF) + bit -= 0x10; + SIS_SETBIT(sc, SIS_RXFILT_DATA, (1 << bit)); + } + IF_ADDR_UNLOCK(ifp); } - IF_ADDR_UNLOCK(ifp); - CSR_WRITE_4(sc, SIS_RXFILT_CTL, filtsave); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void -sis_setmulti_sis(struct sis_softc *sc) +sis_rxfilter_sis(struct sis_softc *sc) { struct ifnet *ifp; struct ifmultiaddr *ifma; - uint32_t h, i, n, ctl; + uint32_t filter, h, i, n; uint16_t hashes[16]; ifp = sc->sis_ifp; /* hash table size */ - if (sc->sis_rev >= SIS_REV_635 || - sc->sis_rev == SIS_REV_900B) + if (sc->sis_rev >= SIS_REV_635 || sc->sis_rev == SIS_REV_900B) n = 16; else n = 8; - ctl = CSR_READ_4(sc, SIS_RXFILT_CTL) & SIS_RXFILTCTL_ENABLE; - + filter = CSR_READ_4(sc, SIS_RXFILT_CTL); + if (filter & SIS_RXFILTCTL_ENABLE) { + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter & ~SIS_RXFILT_CTL); + CSR_READ_4(sc, SIS_RXFILT_CTL); + } + filter &= ~(SIS_RXFILTCTL_ALLPHYS | SIS_RXFILTCTL_BROAD | + SIS_RXFILTCTL_ALLMULTI); if (ifp->if_flags & IFF_BROADCAST) - ctl |= SIS_RXFILTCTL_BROAD; + filter |= SIS_RXFILTCTL_BROAD; - if (ifp->if_flags & IFF_ALLMULTI || ifp->if_flags & IFF_PROMISC) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + if (ifp->if_flags & (IFF_ALLMULTI | IFF_PROMISC)) { + filter |= SIS_RXFILTCTL_ALLMULTI; if (ifp->if_flags & IFF_PROMISC) - ctl |= SIS_RXFILTCTL_BROAD|SIS_RXFILTCTL_ALLPHYS; + filter |= SIS_RXFILTCTL_ALLPHYS; for (i = 0; i < n; i++) hashes[i] = ~0; } else { @@ -899,7 +939,7 @@ sis_setmulti_sis(struct sis_softc *sc) } IF_ADDR_UNLOCK(ifp); if (i > n) { - ctl |= SIS_RXFILTCTL_ALLMULTI; + filter |= SIS_RXFILTCTL_ALLMULTI; for (i = 0; i < n; i++) hashes[i] = ~0; } @@ -910,7 +950,8 @@ sis_setmulti_sis(struct sis_softc *sc) CSR_WRITE_4(sc, SIS_RXFILT_DATA, hashes[i]); } - CSR_WRITE_4(sc, SIS_RXFILT_CTL, ctl); + CSR_WRITE_4(sc, SIS_RXFILT_CTL, filter); + CSR_READ_4(sc, SIS_RXFILT_CTL); } static void @@ -2102,41 +2143,7 @@ sis_initl(struct sis_softc *sc) CSR_WRITE_4(sc, NS_PHY_PAGE, 0); } - /* - * For the NatSemi chip, we have to explicitly enable the - * reception of ARP frames, as well as turn on the 'perfect - * match' filter where we store the station address, otherwise - * we won't receive unicasts meant for this host. - */ - if (sc->sis_type == SIS_TYPE_83815) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_ARP); - SIS_SETBIT(sc, SIS_RXFILT_CTL, NS_RXFILTCTL_PERFECT); - } - - /* If we want promiscuous mode, set the allframes bit. */ - if (ifp->if_flags & IFF_PROMISC) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ALLPHYS); - } - - /* - * Set the capture broadcast bit to capture broadcast frames. - */ - if (ifp->if_flags & IFF_BROADCAST) { - SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } else { - SIS_CLRBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_BROAD); - } - - /* - * Load the multicast filter. - */ - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - + sis_rxfilter(sc); /* Turn the receive filter on */ SIS_SETBIT(sc, SIS_RXFILT_CTL, SIS_RXFILTCTL_ENABLE); @@ -2250,27 +2257,19 @@ sis_ioctl(struct ifnet *ifp, u_long comm if (ifp->if_flags & IFF_UP) { if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0 && ((ifp->if_flags ^ sc->sis_if_flags) & - (IFF_PROMISC | IFF_ALLMULTI)) != 0) { - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); - } else + (IFF_PROMISC | IFF_ALLMULTI)) != 0) + sis_rxfilter(sc); + else sis_initl(sc); - } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) { + } else if (ifp->if_drv_flags & IFF_DRV_RUNNING) sis_stop(sc); - } sc->sis_if_flags = ifp->if_flags; SIS_UNLOCK(sc); - error = 0; break; case SIOCADDMULTI: case SIOCDELMULTI: SIS_LOCK(sc); - if (sc->sis_type == SIS_TYPE_83815) - sis_setmulti_ns(sc); - else - sis_setmulti_sis(sc); + sis_rxfilter(sc); SIS_UNLOCK(sc); break; case SIOCGIFMEDIA: From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 22:21:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E7EE106564A; Mon, 24 Jan 2011 22:21:59 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7C088FC0A; Mon, 24 Jan 2011 22:21:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0OMLwSf008655; Mon, 24 Jan 2011 22:21:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0OMLw34008653; Mon, 24 Jan 2011 22:21:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101242221.p0OMLw34008653@svn.freebsd.org> From: John Baldwin Date: Mon, 24 Jan 2011 22:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217805 - head/sys/net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 22:21:59 -0000 Author: jhb Date: Mon Jan 24 22:21:58 2011 New Revision: 217805 URL: http://svn.freebsd.org/changeset/base/217805 Log: Fix a LOR by dropping the global ifnet locks while allocating a new ifnet table in if_grow(). The order of the SYSINIT's for ifnet state were swapped so that the various locks were initialized before being used. Reviewed by: pluknet, bz MFC after: 2 weeks Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Mon Jan 24 21:04:32 2011 (r217804) +++ head/sys/net/if.c Mon Jan 24 22:21:58 2011 (r217805) @@ -266,6 +266,7 @@ ifindex_alloc_locked(u_short *idxp) IFNET_WLOCK_ASSERT(); +retry: /* * Try to find an empty slot below V_if_index. If we fail, take the * next slot. @@ -278,10 +279,12 @@ ifindex_alloc_locked(u_short *idxp) /* Catch if_index overflow. */ if (idx < 1) return (ENOSPC); + if (idx >= V_if_indexlim) { + if_grow(); + goto retry; + } if (idx > V_if_index) V_if_index = idx; - if (V_if_index >= V_if_indexlim) - if_grow(); *idxp = idx; return (0); } @@ -351,10 +354,12 @@ vnet_if_init(const void *unused __unused TAILQ_INIT(&V_ifnet); TAILQ_INIT(&V_ifg_head); + IFNET_WLOCK(); if_grow(); /* create initial table */ + IFNET_WUNLOCK(); vnet_if_clone_init(); } -VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_FIRST, vnet_if_init, +VNET_SYSINIT(vnet_if_init, SI_SUB_INIT_IF, SI_ORDER_SECOND, vnet_if_init, NULL); /* ARGSUSED*/ @@ -365,7 +370,7 @@ if_init(void *dummy __unused) IFNET_LOCK_INIT(); if_clone_init(); } -SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_SECOND, if_init, NULL); +SYSINIT(interfaces, SI_SUB_INIT_IF, SI_ORDER_FIRST, if_init, NULL); #ifdef VIMAGE @@ -385,16 +390,25 @@ VNET_SYSUNINIT(vnet_if_uninit, SI_SUB_IN static void if_grow(void) { + int oldlim; u_int n; struct ifindex_entry *e; - V_if_indexlim <<= 1; - n = V_if_indexlim * sizeof(*e); + IFNET_WLOCK_ASSERT(); + oldlim = V_if_indexlim; + IFNET_WUNLOCK(); + n = (oldlim << 1) * sizeof(*e); e = malloc(n, M_IFNET, M_WAITOK | M_ZERO); + IFNET_WLOCK(); + if (V_if_indexlim != oldlim) { + free(e, M_IFNET); + return; + } if (V_ifindex_table != NULL) { memcpy((caddr_t)e, (caddr_t)V_ifindex_table, n/2); free((caddr_t)V_ifindex_table, M_IFNET); } + V_if_indexlim <<= 1; V_ifindex_table = e; } From owner-svn-src-all@FreeBSD.ORG Mon Jan 24 23:08:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 581DC106564A; Mon, 24 Jan 2011 23:08:38 +0000 (UTC) (envelope-from lstewart@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 453D58FC08; Mon, 24 Jan 2011 23:08:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0ON8cH3009778; Mon, 24 Jan 2011 23:08:38 GMT (envelope-from lstewart@svn.freebsd.org) Received: (from lstewart@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0ON8cUY009773; Mon, 24 Jan 2011 23:08:38 GMT (envelope-from lstewart@svn.freebsd.org) Message-Id: <201101242308.p0ON8cUY009773@svn.freebsd.org> From: Lawrence Stewart Date: Mon, 24 Jan 2011 23:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217806 - in head/sys: modules/khelp modules/khelp/h_ertt netinet/khelp X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 23:08:38 -0000 Author: lstewart Date: Mon Jan 24 23:08:38 2011 New Revision: 217806 URL: http://svn.freebsd.org/changeset/base/217806 Log: Import the ERTT (Enhanced Round Trip Time) Khelp module. ERTT uses the Khelp/Hhook KPIs to hook into the TCP stack and maintain a per-connection, low noise estimate of the instantaneous RTT. ERTT's implementation is robust even in the face of delayed acknowledgements and/or TSO being in use for a connection. A high quality, low noise RTT estimate is a requirement for applications such as delay-based congestion control, for which we will be importing some algorithm implementations shortly. In collaboration with: David Hayes and Grenville Armitage Sponsored by: FreeBSD Foundation Reviewed by: bz and others along the way MFC after: 3 months Added: head/sys/modules/khelp/h_ertt/ head/sys/modules/khelp/h_ertt/Makefile (contents, props changed) head/sys/netinet/khelp/ head/sys/netinet/khelp/h_ertt.c (contents, props changed) head/sys/netinet/khelp/h_ertt.h (contents, props changed) Modified: head/sys/modules/khelp/Makefile Modified: head/sys/modules/khelp/Makefile ============================================================================== --- head/sys/modules/khelp/Makefile Mon Jan 24 22:21:58 2011 (r217805) +++ head/sys/modules/khelp/Makefile Mon Jan 24 23:08:38 2011 (r217806) @@ -1,5 +1,5 @@ # $FreeBSD$ -SUBDIR= +SUBDIR= h_ertt .include Added: head/sys/modules/khelp/h_ertt/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/modules/khelp/h_ertt/Makefile Mon Jan 24 23:08:38 2011 (r217806) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +.include + +.PATH: ${.CURDIR}/../../../netinet/khelp +KMOD= h_ertt +SRCS= h_ertt.c + +.include Added: head/sys/netinet/khelp/h_ertt.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/khelp/h_ertt.c Mon Jan 24 23:08:38 2011 (r217806) @@ -0,0 +1,545 @@ +/*- + * Copyright (c) 2009-2010 + * Swinburne University of Technology, Melbourne, Australia + * Copyright (c) 2010 Lawrence Stewart + * Copyright (c) 2010-2011 The FreeBSD Foundation + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by David Hayes, made possible in part by + * a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * Portions of this software were developed at the Centre for Advanced + * Internet Architectures, Swinburne University of Technology, Melbourne, + * Australia by David Hayes under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +#include + +#include + +uma_zone_t txseginfo_zone; + +/* Smoothing factor for delayed ack guess. */ +#define DLYACK_SMOOTH 5 + +/* Max number of time stamp errors allowed in a session. */ +#define MAX_TS_ERR 10 + +static int ertt_packet_measurement_hook(int hhook_type, int hhook_id, + void *udata, void *ctx_data, void *hdata, struct osd *hosd); +static int ertt_add_tx_segment_info_hook(int hhook_type, int hhook_id, + void *udata, void *ctx_data, void *hdata, struct osd *hosd); +static int ertt_mod_init(void); +static int ertt_mod_destroy(void); +static int ertt_uma_ctor(void *mem, int size, void *arg, int flags); +static void ertt_uma_dtor(void *mem, int size, void *arg); + +/* + * Contains information about the sent segment for comparison with the + * corresponding ack. + */ +struct txseginfo { + /* Segment length. */ + long len; + /* Segment sequence number. */ + tcp_seq seq; + /* Time stamp indicating when the packet was sent. */ + uint32_t tx_ts; + /* Last received receiver ts (if the TCP option is used). */ + uint32_t rx_ts; + uint32_t flags; + TAILQ_ENTRY (txseginfo) txsegi_lnk; +}; + +/* Flags for struct txseginfo. */ +#define TXSI_TSO 0x01 /* TSO was used for this entry. */ +#define TXSI_RTT_MEASURE_START 0x02 /* Start a per RTT measurement. */ +#define TXSI_RX_MEASURE_END 0x04 /* Measure the rx rate until this txsi. */ + +struct helper ertt_helper = { + .mod_init = ertt_mod_init, + .mod_destroy = ertt_mod_destroy, + .h_flags = HELPER_NEEDS_OSD, + .h_classes = HELPER_CLASS_TCP +}; + +/* Define the helper hook info required by ERTT. */ +struct hookinfo ertt_hooks[] = { + { + .hook_type = HHOOK_TYPE_TCP, + .hook_id = HHOOK_TCP_EST_IN, + .hook_udata = NULL, + .hook_func = &ertt_packet_measurement_hook + }, + { + .hook_type = HHOOK_TYPE_TCP, + .hook_id = HHOOK_TCP_EST_OUT, + .hook_udata = NULL, + .hook_func = &ertt_add_tx_segment_info_hook + } +}; + +/* Flags to indicate how marked_packet_rtt should handle this txsi. */ +#define MULTI_ACK 0x01 /* More than this txsi is acked. */ +#define OLD_TXSI 0x02 /* TXSI is old according to timestamps. */ +#define CORRECT_ACK 0X04 /* Acks this TXSI. */ +#define FORCED_MEASUREMENT 0X08 /* Force an RTT measurement. */ + +/* + * This fuction measures the RTT of a particular segment/ack pair, or the next + * closest if this will yield an inaccurate result due to delayed acking or + * other issues. + */ +static void inline +marked_packet_rtt(struct txseginfo *txsi, struct ertt *e_t, struct tcpcb *tp, + uint32_t *pmeasurenext, int *pmeasurenext_len, int *prtt_bytes_adjust, + int mflag) +{ + + /* + * If we can't measure this one properly due to delayed acking adjust + * byte counters and flag to measure next txsi. Note that since the + * marked packet's transmitted bytes are measured we need to subtract the + * transmitted bytes. Then pretend the next txsi was marked. + */ + if (mflag & (MULTI_ACK|OLD_TXSI)) { + *pmeasurenext = txsi->tx_ts; + *pmeasurenext_len = txsi->len; + *prtt_bytes_adjust += *pmeasurenext_len; + } else { + if (mflag & FORCED_MEASUREMENT) { + e_t->markedpkt_rtt = ticks - *pmeasurenext + 1; + e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + + *pmeasurenext_len - *prtt_bytes_adjust; + } else { + e_t->markedpkt_rtt = ticks - txsi->tx_ts + 1; + e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - + *prtt_bytes_adjust; + } + e_t->marked_snd_cwnd = tp->snd_cwnd; + + /* + * Reset the ERTT_MEASUREMENT_IN_PROGRESS flag to indicate to + * add_tx_segment_info that a new measurement should be started. + */ + e_t->flags &= ~ERTT_MEASUREMENT_IN_PROGRESS; + /* + * Set ERTT_NEW_MEASUREMENT to tell the congestion control + * algorithm that a new marked RTT measurement has has been made + * and is available for use. + */ + e_t->flags |= ERTT_NEW_MEASUREMENT; + + if (tp->t_flags & TF_TSO) { + /* Temporarily disable TSO to aid a new measurment. */ + tp->t_flags &= ~TF_TSO; + /* Keep track that we've disabled it. */ + e_t->flags |= ERTT_TSO_DISABLED; + } + } +} + +/* + * Ertt_packet_measurements uses a small amount of state kept on each packet + * sent to match incoming acknowledgements. This enables more accurate and + * secure round trip time measurements. The resulting measurement is used for + * congestion control algorithms which require a more accurate time. + * Ertt_packet_measurements is called via the helper hook in tcp_input.c + */ +static int +ertt_packet_measurement_hook(int hhook_type, int hhook_id, void *udata, + void *ctx_data, void *hdata, struct osd *hosd) +{ + struct ertt *e_t; + struct tcpcb *tp; + struct tcphdr *th; + struct tcpopt *to; + struct tcp_hhook_data *thdp; + struct txseginfo *txsi; + int acked, measurenext_len, multiack, new_sacked_bytes, rtt_bytes_adjust; + uint32_t measurenext, rts; + tcp_seq ack; + + KASSERT(ctx_data != NULL, ("%s: ctx_data is NULL!", __func__)); + KASSERT(hdata != NULL, ("%s: hdata is NULL!", __func__)); + + e_t = (struct ertt *)hdata; + thdp = ctx_data; + tp = thdp->tp; + th = thdp->th; + to = thdp->to; + new_sacked_bytes = (tp->sackhint.last_sack_ack != 0); + measurenext = measurenext_len = multiack = rts = rtt_bytes_adjust = 0; + acked = th->th_ack - tp->snd_una; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + /* Packet has provided new acknowledgements. */ + if (acked > 0 || new_sacked_bytes) { + if (acked == 0 && new_sacked_bytes) { + /* Use last sacked data. */ + ack = tp->sackhint.last_sack_ack; + } else + ack = th->th_ack; + + txsi = TAILQ_FIRST(&e_t->txsegi_q); + while (txsi != NULL) { + rts = 0; + + /* Acknowledgement is acking more than this txsi. */ + if (SEQ_GT(ack, txsi->seq + txsi->len)) { + if (txsi->flags & TXSI_RTT_MEASURE_START || + measurenext) { + marked_packet_rtt(txsi, e_t, tp, + &measurenext, &measurenext_len, + &rtt_bytes_adjust, MULTI_ACK); + } + TAILQ_REMOVE(&e_t->txsegi_q, txsi, txsegi_lnk); + uma_zfree(txseginfo_zone, txsi); + txsi = TAILQ_FIRST(&e_t->txsegi_q); + continue; + } + + /* + * Guess if delayed acks are being used by the receiver. + * + * XXXDH: A simple heuristic that could be improved + */ + if (!new_sacked_bytes) { + if (acked > tp->t_maxseg) { + e_t->dlyack_rx += + (e_t->dlyack_rx < DLYACK_SMOOTH) ? + 1 : 0; + multiack = 1; + } else if (acked > txsi->len) { + multiack = 1; + e_t->dlyack_rx += + (e_t->dlyack_rx < DLYACK_SMOOTH) ? + 1 : 0; + } else if (acked == tp->t_maxseg || + acked == txsi->len) { + e_t->dlyack_rx -= + (e_t->dlyack_rx > 0) ? 1 : 0; + } + /* Otherwise leave dlyack_rx the way it was. */ + } + + /* + * Time stamps are only to help match the txsi with the + * received acknowledgements. + */ + if (e_t->timestamp_errors < MAX_TS_ERR && + (to->to_flags & TOF_TS) != 0 && to->to_tsecr) { + /* + * Note: All packets sent with the offload will + * have the same time stamp. If we are sending + * on a fast interface and the t_maxseg is much + * smaller than one tick, this will be fine. The + * time stamp would be the same whether we were + * using tso or not. However, if the interface + * is slow, this will cause problems with the + * calculations. If the interface is slow, there + * is not reason to be using tso, and it should + * be turned off. + */ + /* + * If there are too many time stamp errors, time + * stamps won't be trusted + */ + rts = to->to_tsecr; + /* Before this packet. */ + if (!e_t->dlyack_rx && TSTMP_LT(rts, txsi->tx_ts)) + /* When delayed acking is used, the + * reflected time stamp is of the first + * packet and thus may be before + * txsi->tx_ts. + */ + break; + if (TSTMP_GT(rts, txsi->tx_ts)) { + /* + * If reflected time stamp is later than + * tx_tsi, then this txsi is old. + */ + if (txsi->flags & TXSI_RTT_MEASURE_START + || measurenext) { + marked_packet_rtt(txsi, e_t, tp, + &measurenext, &measurenext_len, + &rtt_bytes_adjust, OLD_TXSI); + } + TAILQ_REMOVE(&e_t->txsegi_q, txsi, + txsegi_lnk); + uma_zfree(txseginfo_zone, txsi); + txsi = TAILQ_FIRST(&e_t->txsegi_q); + continue; + } + if (rts == txsi->tx_ts && + TSTMP_LT(to->to_tsval, txsi->rx_ts)) { + /* + * Segment received before sent! + * Something is wrong with the received + * timestamps so increment errors. If + * this keeps up we will ignore + * timestamps. + */ + e_t->timestamp_errors++; + } + } + /* + * Acknowledging a sequence number before this txsi. + * If it is an old txsi that may have had the same seq + * numbers, it should have been removed if time stamps + * are being used. + */ + if (SEQ_LEQ(ack, txsi->seq)) + break; /* Before first packet in txsi. */ + + /* + * Only ack > txsi->seq and ack <= txsi->seq+txsi->len + * past this point. + * + * If delayed acks are being used, an acknowledgement + * for a single segment will have been delayed by the + * receiver and will yield an inaccurate measurement. In + * this case, we only make the measurement if more than + * one segment is being acknowledged or sack is + * currently being used. + */ + if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { + /* Make an accurate new measurement. */ + e_t->rtt = ticks - txsi->tx_ts + 1; + + if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) + e_t->minrtt = e_t->rtt; + + if (e_t->rtt > e_t->maxrtt || e_t->maxrtt == 0) + e_t->maxrtt = e_t->rtt; + } + + if (txsi->flags & TXSI_RTT_MEASURE_START || measurenext) + marked_packet_rtt(txsi, e_t, tp, + &measurenext, &measurenext_len, + &rtt_bytes_adjust, CORRECT_ACK); + + if (txsi->flags & TXSI_TSO) { + txsi->len -= acked; + if (txsi->len > 0) { + /* + * This presumes ack for first bytes in + * txsi, this may not be true but it + * shouldn't cause problems for the + * timing. + * + * We remeasure RTT even though we only + * have a single txsi. The rationale + * behind this is that it is better to + * have a slightly inaccurate + * measurement than no additional + * measurement for the rest of the bulk + * transfer. Since TSO is only used on + * high speed interface cards, so the + * packets should be transmitted at line + * rate back to back with little + * difference in transmission times (in + * ticks). + */ + txsi->seq += acked; + /* + * Reset txsi measure flag so we don't + * use it for another RTT measurement. + */ + txsi->flags &= ~TXSI_RTT_MEASURE_START; + /* + * There is still more data to be acked + * from tso bulk transmission, so we + * won't remove it from the TAILQ yet. + */ + break; + } + } + + TAILQ_REMOVE(&e_t->txsegi_q, txsi, txsegi_lnk); + uma_zfree(txseginfo_zone, txsi); + break; + } + + if (measurenext) { + /* + * We need to do a RTT measurement. It won't be the best + * if we do it here. + */ + marked_packet_rtt(txsi, e_t, tp, + &measurenext, &measurenext_len, + &rtt_bytes_adjust, FORCED_MEASUREMENT); + } + } + + return (0); +} + +/* + * Add information about a transmitted segment to a list. + * This is called via the helper hook in tcp_output.c + */ +static int +ertt_add_tx_segment_info_hook(int hhook_type, int hhook_id, void *udata, + void *ctx_data, void *hdata, struct osd *hosd) +{ + struct ertt *e_t; + struct tcpcb *tp; + struct tcphdr *th; + struct tcpopt *to; + struct tcp_hhook_data *thdp; + struct txseginfo *txsi; + long len; + int tso; + + KASSERT(ctx_data != NULL, ("%s: ctx_data is NULL!", __func__)); + KASSERT(hdata != NULL, ("%s: hdata is NULL!", __func__)); + + e_t = (struct ertt *)hdata; + thdp = ctx_data; + tp = thdp->tp; + th = thdp->th; + to = thdp->to; + len = thdp->len; + tso = thdp->tso; + + INP_WLOCK_ASSERT(tp->t_inpcb); + + if (len > 0) { + txsi = uma_zalloc(txseginfo_zone, M_NOWAIT); + if (txsi != NULL) { + /* Construct txsi setting the necessary flags. */ + txsi->flags = 0; /* Needs to be initialised. */ + txsi->seq = ntohl(th->th_seq); + txsi->len = len; + if (tso) + txsi->flags |= TXSI_TSO; + else if (e_t->flags & ERTT_TSO_DISABLED) { + tp->t_flags |= TF_TSO; + e_t->flags &= ~ERTT_TSO_DISABLED; + } + + if (e_t->flags & ERTT_MEASUREMENT_IN_PROGRESS) { + e_t->bytes_tx_in_rtt += len; + } else { + txsi->flags |= TXSI_RTT_MEASURE_START; + e_t->flags |= ERTT_MEASUREMENT_IN_PROGRESS; + e_t->bytes_tx_in_rtt = len; + } + + if (((tp->t_flags & TF_NOOPT) == 0) && + (to->to_flags & TOF_TS)) { + txsi->tx_ts = ntohl(to->to_tsval) - + tp->ts_offset; + txsi->rx_ts = ntohl(to->to_tsecr); + } else { + txsi->tx_ts = ticks; + txsi->rx_ts = 0; /* No received time stamp. */ + } + TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); + } + } + + return (0); +} + +static int +ertt_mod_init(void) +{ + + txseginfo_zone = uma_zcreate("ertt_txseginfo", sizeof(struct txseginfo), + NULL, NULL, NULL, NULL, 0, 0); + + return (0); +} + +static int +ertt_mod_destroy(void) +{ + + uma_zdestroy(txseginfo_zone); + + return (0); +} + +static int +ertt_uma_ctor(void *mem, int size, void *arg, int flags) +{ + struct ertt *e_t; + + e_t = mem; + + TAILQ_INIT(&e_t->txsegi_q); + e_t->timestamp_errors = 0; + e_t->minrtt = 0; + e_t->maxrtt = 0; + e_t->rtt = 0; + e_t->flags = 0; + e_t->dlyack_rx = 0; + e_t->bytes_tx_in_rtt = 0; + e_t->markedpkt_rtt = 0; + + return (0); +} + +static void +ertt_uma_dtor(void *mem, int size, void *arg) +{ + struct ertt *e_t; + struct txseginfo *n_txsi, *txsi; + + e_t = mem; + txsi = TAILQ_FIRST(&e_t->txsegi_q); + while (txsi != NULL) { + n_txsi = TAILQ_NEXT(txsi, txsegi_lnk); + uma_zfree(txseginfo_zone, txsi); + txsi = n_txsi; + } +} + +KHELP_DECLARE_MOD_UMA(ertt, &ertt_helper, ertt_hooks, 1, sizeof(struct ertt), + ertt_uma_ctor, ertt_uma_dtor); Added: head/sys/netinet/khelp/h_ertt.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/netinet/khelp/h_ertt.h Mon Jan 24 23:08:38 2011 (r217806) @@ -0,0 +1,89 @@ +/*- + * Copyright (c) 2009-2010 + * Swinburne University of Technology, Melbourne, Australia + * Copyright (c) 2010 Lawrence Stewart + * All rights reserved. + * + * This software was developed at the Centre for Advanced Internet + * Architectures, Swinburne University, by David Hayes, made possible in part by + * a grant from the Cisco University Research Program Fund at Community + * Foundation Silicon Valley. + * + * 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$ + */ + +/* + * The ERTT (Enhanced Round Trip Time) Khelp module calculates an estimate of + * the instantaneous TCP RTT which, for example, is used by delay-based + * congestion control schemes. When the module is loaded, ERTT data is + * calculated for each active TCP connection and encapsulated within a + * "struct ertt". + * + * This software was first released in 2010 by David Hayes and Lawrence Stewart + * whilst working on the NewTCP research project at Swinburne University's + * Centre for Advanced Internet Architectures, Melbourne, Australia, which was + * made possible in part by a grant from the Cisco University Research Program + * Fund at Community Foundation Silicon Valley. Testing and development was + * further assisted by a grant from the FreeBSD Foundation. More details are + * available at: + * http://caia.swin.edu.au/urp/newtcp/ + */ + +#ifndef _NETINET_KHELP_H_ERTT_ +#define _NETINET_KHELP_H_ERTT_ + +struct txseginfo; + +/* Structure used as the ertt data block. */ +struct ertt { + /* Information about transmitted segments to aid in RTT calculation. */ + TAILQ_HEAD(txseginfo_head, txseginfo) txsegi_q; + /* Bytes TX so far in marked RTT. */ + long bytes_tx_in_rtt; + /* Final version of above. */ + long bytes_tx_in_marked_rtt; + /* cwnd for marked RTT. */ + unsigned long marked_snd_cwnd; + /* Per-packet measured RTT. */ + int rtt; + /* Maximum RTT measured. */ + int maxrtt; + /* Minimum RTT measured. */ + int minrtt; + /* Guess if the receiver is using delayed ack. */ + int dlyack_rx; + /* Keep track of inconsistencies in packet timestamps. */ + int timestamp_errors; + /* RTT for a marked packet. */ + int markedpkt_rtt; + /* Flags to signal conditions between hook function calls. */ + uint32_t flags; +}; + +/* Flags for struct ertt. */ +#define ERTT_NEW_MEASUREMENT 0x01 +#define ERTT_MEASUREMENT_IN_PROGRESS 0x02 +#define ERTT_TSO_DISABLED 0x04 + +#endif /* _NETINET_KHELP_H_ERTT_ */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 04:35:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FD7E106564A; Tue, 25 Jan 2011 04:35:07 +0000 (UTC) (envelope-from sobomax@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB648FC0A; Tue, 25 Jan 2011 04:35:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P4Z7EK017382; Tue, 25 Jan 2011 04:35:07 GMT (envelope-from sobomax@svn.freebsd.org) Received: (from sobomax@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P4Z7iW017380; Tue, 25 Jan 2011 04:35:07 GMT (envelope-from sobomax@svn.freebsd.org) Message-Id: <201101250435.p0P4Z7iW017380@svn.freebsd.org> From: Maxim Sobolev Date: Tue, 25 Jan 2011 04:35:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217808 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 04:35:07 -0000 Author: sobomax Date: Tue Jan 25 04:35:07 2011 New Revision: 217808 URL: http://svn.freebsd.org/changeset/base/217808 Log: Supply maximum value as an argument to the decimal() function instead of supplying number of bits. Submitted by: bde Modified: head/sbin/fdisk/fdisk.c Modified: head/sbin/fdisk/fdisk.c ============================================================================== --- head/sbin/fdisk/fdisk.c Tue Jan 25 01:26:25 2011 (r217807) +++ head/sbin/fdisk/fdisk.c Tue Jan 25 04:35:07 2011 (r217808) @@ -49,7 +49,10 @@ __FBSDID("$FreeBSD$"); int iotest; -#define NOSECTORS ((u_int32_t)-1) +#define NO_DISK_SECTORS ((u_int32_t)-1) +#define NO_TRACK_CYLINDERS 1023 +#define NO_TRACK_HEADS 255 +#define NO_TRACK_SECTORS 63 #define LBUF 100 static char lbuf[LBUF]; @@ -62,7 +65,7 @@ static char lbuf[LBUF]; * Created. */ -#define Decimal(str, ans, tmp, nbits) if (decimal(str, &tmp, ans, nbits)) ans = tmp +#define Decimal(str, ans, tmp, maxval) if (decimal(str, &tmp, ans, maxval)) ans = tmp #define RoundCyl(x) ((((x) + cylsecs - 1) / cylsecs) * cylsecs) @@ -247,7 +250,7 @@ static int get_params(void); static int read_s0(void); static int write_s0(void); static int ok(const char *str); -static int decimal(const char *str, int *num, int deflt, int nbits); +static int decimal(const char *str, int *num, int deflt, uint32_t maxval); static int read_config(char *config_file); static void reset_boot(void); static int sanitize_partition(struct dos_partition *); @@ -572,9 +575,9 @@ change_part(int i) } do { - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, 255); + Decimal("start", partp->dp_start, tmp, NO_DISK_SECTORS); + Decimal("size", partp->dp_size, tmp, NO_DISK_SECTORS); if (!sanitize_partition(partp)) { warnx("ERROR: failed to adjust; setting sysid to 0"); partp->dp_typ = 0; @@ -586,9 +589,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); thd = partp->dp_shd; tsec = DPSECT(partp->dp_ssect); - Decimal("beginning cylinder", tcyl, tmp, 10); - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); - Decimal("beginning sector", tsec, tmp, 6); + Decimal("beginning cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("beginning head", thd, tmp, NO_TRACK_HEADS); + Decimal("beginning sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_scyl = DOSCYL(tcyl); partp->dp_ssect = DOSSECT(tsec,tcyl); partp->dp_shd = thd; @@ -596,9 +599,9 @@ change_part(int i) tcyl = DPCYL(partp->dp_ecyl,partp->dp_esect); thd = partp->dp_ehd; tsec = DPSECT(partp->dp_esect); - Decimal("ending cylinder", tcyl, tmp, 10); - Decimal("ending head", thd, tmp, sizeof(partp->dp_ehd) * 8); - Decimal("ending sector", tsec, tmp, 6); + Decimal("ending cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); + Decimal("ending head", thd, tmp, NO_TRACK_HEADS); + Decimal("ending sector", tsec, tmp, NO_TRACK_SECTORS); partp->dp_ecyl = DOSCYL(tcyl); partp->dp_esect = DOSSECT(tsec,tcyl); partp->dp_ehd = thd; @@ -915,16 +918,12 @@ ok(const char *str) } static int -decimal(const char *str, int *num, int deflt, int nbits) +decimal(const char *str, int *num, int deflt, uint32_t maxval) { - long long acc = 0, limit; + long long acc = 0; int c; char *cp; - if (nbits == 0) { - nbits = sizeof(*num) * 8; - } - limit = (long long)1 << nbits; while (1) { printf("Supply a decimal value for \"%s\" [%d] ", str, deflt); fflush(stdout); @@ -941,7 +940,7 @@ decimal(const char *str, int *num, int d return 0; while ((c = *cp++)) { if (c <= '9' && c >= '0') { - if (acc < limit) + if (maxval > 0 && acc <= maxval) acc = acc * 10 + c - '0'; } else break; @@ -949,10 +948,11 @@ decimal(const char *str, int *num, int d if (c == ' ' || c == '\t') while ((c = *cp) && (c == ' ' || c == '\t')) cp++; if (!c) { - if (acc >= limit) { - acc = limit - 1; - printf("%s is too big, it will be truncated to %lld\n", - lbuf, acc); + if (maxval > 0 && acc > maxval) { + acc = maxval; + printf("%s exceeds maximum value allowed for " + "this field. The value has been reduced " + "to %lld\n", lbuf, acc); } *num = acc; return 1; @@ -1108,7 +1108,7 @@ str2sectors(const char *str) if (str == end || *end == '\0') { warnx("ERROR line %d: unexpected size: \'%s\'", current_line_number, str); - return NOSECTORS; + return NO_DISK_SECTORS; } if (*end == 'K') @@ -1120,7 +1120,7 @@ str2sectors(const char *str) else { warnx("ERROR line %d: unexpected modifier: %c " "(not K/M/G)", current_line_number, *end); - return NOSECTORS; + return NO_DISK_SECTORS; } return val; @@ -1170,7 +1170,7 @@ process_partition(CMD *command) } } else { partp->dp_start = str2sectors(command->args[2].arg_str); - if (partp->dp_start == NOSECTORS) + if (partp->dp_start == NO_DISK_SECTORS) break; } } else @@ -1182,7 +1182,7 @@ process_partition(CMD *command) dos_cylsecs) - partp->dp_start; else { partp->dp_size = str2sectors(command->args[3].arg_str); - if (partp->dp_size == NOSECTORS) + if (partp->dp_size == NO_DISK_SECTORS) break; } prev_cyl_boundary = ((partp->dp_start + partp->dp_size) / From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 05:35:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC07A106564A; Tue, 25 Jan 2011 05:35:09 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB1898FC0A; Tue, 25 Jan 2011 05:35:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P5Z9Xq018598; Tue, 25 Jan 2011 05:35:09 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P5Z9nI018595; Tue, 25 Jan 2011 05:35:09 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250535.p0P5Z9nI018595@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 05:35:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217809 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 05:35:10 -0000 Author: adrian Date: Tue Jan 25 05:35:09 2011 New Revision: 217809 URL: http://svn.freebsd.org/changeset/base/217809 Log: Fix the Atheros V4K EEPROM definitions to match those in ath9k. It turns out that the V4K eeprom definitions (used by the AR9285 and its derivatives) is wrong. These values are at least causing issues on my AR2427. With this fix (and initvals in a subsequent commit), the AR2427 behaves a lot better. Note - there's still significant drift between the ath9k v4k eeprom init code (again, used by AR9285 and derivatives) and what's in this tree. That needs to be investigated and resolved. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Tue Jan 25 04:35:07 2011 (r217808) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.c Tue Jan 25 05:35:09 2011 (r217809) @@ -65,9 +65,9 @@ v4kEepromGet(struct ath_hal *ah, int par case AR_EEP_RFSILENT: return pBase->rfSilent; case AR_EEP_OB_2: - return pModal->ob; + return pModal->ob_0; case AR_EEP_DB_2: - return pModal->db; + return pModal->db1_1; case AR_EEP_TXMASK: return pBase->txMask; case AR_EEP_RXMASK: Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 04:35:07 2011 (r217808) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 05:35:09 2011 (r217809) @@ -88,14 +88,18 @@ typedef struct ModalEepHeader4k { uint8_t xpd; // 1 int8_t iqCalICh[AR5416_4K_MAX_CHAINS]; // 1 int8_t iqCalQCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t pdGainOverlap; // 1 - uint8_t ob; // 1 - uint8_t db; // 1 - uint8_t xpaBiasLvl; // 1 -#if 0 - uint8_t pwrDecreaseFor2Chain; // 1 - uint8_t pwrDecreaseFor3Chain; // 1 -> 48 B + +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t ob_1:4, ob_0:4; + uint8_t db1_1:4, db1_0:4; +#else + uint8_t ob_0:4, ob_1:4; + uint8_t db1_0:4, db1_1:4; #endif + + uint8_t xpaBiasLvl; // 1 uint8_t txFrameToDataStart; // 1 uint8_t txFrameToPaOn; // 1 uint8_t ht40PowerIncForPdadc; // 1 @@ -104,23 +108,34 @@ typedef struct ModalEepHeader4k { uint8_t swSettleHt40; // 1 uint8_t xatten2Db[AR5416_4K_MAX_CHAINS]; // 1 uint8_t xatten2Margin[AR5416_4K_MAX_CHAINS]; // 1 - uint8_t ob_ch1; // 1 -> ob and db become chain specific from AR9280 - uint8_t db_ch1; // 1 - uint8_t flagBits; // 1 -#define AR5416_EEP_FLAG_USEANT1 0x01 /* +1 configured antenna */ -#define AR5416_EEP_FLAG_FORCEXPAON 0x02 /* force XPA bit for 5G */ -#define AR5416_EEP_FLAG_LOCALBIAS 0x04 /* enable local bias */ -#define AR5416_EEP_FLAG_FEMBANDSELECT 0x08 /* FEM band select used */ -#define AR5416_EEP_FLAG_XLNABUFIN 0x10 -#define AR5416_EEP_FLAG_XLNAISEL 0x60 -#define AR5416_EEP_FLAG_XLNAISEL_S 5 -#define AR5416_EEP_FLAG_XLNABUFMODE 0x80 - uint8_t miscBits; // [0..1]: bb_tx_dac_scale_cck - uint16_t xpaBiasLvlFreq[3]; // 6 - uint8_t futureModal[2]; // 2 + +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t db2_1:4, db2_0:4; // 1 +#else + uint8_t db2_0:4, db2_1:4; // 1 +#endif + + uint8_t version; // 1 + +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t ob_3:4, ob_2:4; + uint8_t antdiv_ctl1:4, ob_4:4; + uint8_t db1_3:4, db1_2:4; + uint8_t antdiv_ctl2:4, db1_4:4; + uint8_t db2_2:4, db2_3:4; + uint8_t reserved:4, db2_4:4; +#else + uint8_t ob_2:4, ob_3:4; + uint8_t ob_4:4, antdiv_ctl1:4; + uint8_t db1_2:4, db1_3:4; + uint8_t db1_4:4, antdiv_ctl2:4; + uint8_t db2_2:4, db2_3:4; + uint8_t db2_4:4, reserved:4; +#endif + uint8_t futureModal[4]; SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS]; // 20 B -} __packed MODAL_EEP4K_HEADER; // == 68 B +} __packed MODAL_EEP4K_HEADER; // == ? B typedef struct CalCtlData4k { CAL_CTL_EDGES ctlEdges[AR5416_4K_MAX_CHAINS][AR5416_4K_NUM_BAND_EDGES]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 05:35:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 359D81065675; Tue, 25 Jan 2011 05:35:44 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A1A08FC13; Tue, 25 Jan 2011 05:35:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P5ZhRO018646; Tue, 25 Jan 2011 05:35:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P5ZhGn018644; Tue, 25 Jan 2011 05:35:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250535.p0P5ZhGn018644@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 05:35:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217810 - head/tools/tools/ath/ath_ee_v4k_print X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 05:35:44 -0000 Author: adrian Date: Tue Jan 25 05:35:43 2011 New Revision: 217810 URL: http://svn.freebsd.org/changeset/base/217810 Log: Fix this tool to use the updated (corrected) v4k eeprom definition introduced in a previous commit. Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c Modified: head/tools/tools/ath/ath_ee_v4k_print/v4k.c ============================================================================== --- head/tools/tools/ath/ath_ee_v4k_print/v4k.c Tue Jan 25 05:35:09 2011 (r217809) +++ head/tools/tools/ath/ath_ee_v4k_print/v4k.c Tue Jan 25 05:35:43 2011 (r217810) @@ -111,16 +111,29 @@ eeprom_v4k_modal_print(uint16_t *buf) mh->txEndToXpaOff, mh->txEndToRxOn, mh->txFrameToXpaOn); printf("| thres62: 0x%.2x\n", mh->thresh62); printf("| xpdGain: 0x%.2x | xpd: 0x%.2x |\n", mh->xpdGain, mh->xpd); - printf("| xpaBiasLvlFreq: 0:0x%.4x 1:0x%.4x 2:0x%.4x |\n", - mh->xpaBiasLvlFreq[0], mh->xpaBiasLvlFreq[1], mh->xpaBiasLvlFreq[2]); - printf("| pdGainOverlap: 0x%.2x | ob: 0x%.2x | db: 0x%.2x | xpaBiasLvl: 0x%.2x |\n", - mh->pdGainOverlap, mh->ob, mh->db, mh->xpaBiasLvl); + + printf("| pdGainOverlap: 0x%.2x xpaBiasLvl: 0x%.2x |\n", mh->pdGainOverlap, mh->xpaBiasLvl); printf("| txFrameToDataStart: 0x%.2x | txFrameToPaOn: 0x%.2x |\n", mh->txFrameToDataStart, mh->txFrameToPaOn); printf("| ht40PowerIncForPdadc: 0x%.2x |\n", mh->ht40PowerIncForPdadc); printf("| swSettleHt40: 0x%.2x |\n", mh->swSettleHt40); - printf("| ob_ch1: 0x%.2x | db_ch1: 0x%.2x |\n", mh->ob_ch1, mh->db_ch1); - printf("| flagBits: 0x%.2x | miscBits: 0x%.2x |\n", mh->flagBits, mh->miscBits); - printf("| futureModal: 0x%.2x 0x%.2x\n", mh->futureModal[0], mh->futureModal[1]); + + printf("| ob_0: 0x%.2x | ob_1: 0x%.2x | ob_2: 0x%.2x | ob_3: 0x%.2x |\n", + mh->ob_0, mh->ob_1, mh->ob_2, mh->ob_3); + printf("| db_1_0: 0x%.2x | db_1_1: 0x%.2x | db_1_2: 0x%.2x | db_1_3: 0x%.2x db_1_4: 0x%.2x|\n", + mh->db1_0, mh->db1_1, mh->db1_2, mh->db1_3, mh->db1_4); + printf("| db_1_0: 0x%.2x | db_1_1: 0x%.2x | db_1_2: 0x%.2x | db_1_3: 0x%.2x db_1_4: 0x%.2x|\n", + mh->db2_0, mh->db2_1, mh->db2_2, mh->db2_3, mh->db2_4); + + printf("| antdiv_ctl1: 0x%.2x antdiv_ctl2: 0x%.2x |\n", mh->antdiv_ctl1, mh->antdiv_ctl2); + + printf("| Modal Version: %.2x |\n", mh->version); + + printf("| futureModal: 0x%.2x 0x%.2x 0x%.2x 0x%.2x |\n", + mh->futureModal[0], + mh->futureModal[1], + mh->futureModal[2], + mh->futureModal[3] + ); /* and now, spur channels */ for (i = 0; i < AR5416_EEPROM_MODAL_SPURS; i++) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 05:36:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C8231065672; Tue, 25 Jan 2011 05:36:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79E328FC15; Tue, 25 Jan 2011 05:36:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P5aTE7018704; Tue, 25 Jan 2011 05:36:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P5aTsM018702; Tue, 25 Jan 2011 05:36:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250536.p0P5aTsM018702@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 05:36:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217811 - head/sys/dev/ath/ath_hal/ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 05:36:29 -0000 Author: adrian Date: Tue Jan 25 05:36:29 2011 New Revision: 217811 URL: http://svn.freebsd.org/changeset/base/217811 Log: Commit updated AR9285 (Kite) v2 initvals from ath9k. Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini Tue Jan 25 05:35:43 2011 (r217810) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285v2.ini Tue Jan 25 05:36:29 2011 (r217811) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008-2009 Atheros Communications Inc. + * Copyright (c) 2010 Atheros Communications Inc. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -16,7 +16,6 @@ * $FreeBSD$ */ -/* AR9285 v1_2 PCI Register Writes. Created: 04/13/09 */ static const u_int32_t ar9285Modes_v2[][6] = { /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ { 0x00001030, 0x00000230, 0x00000460, 0x000002c0, 0x00000160, 0x000001e0 }, @@ -78,7 +77,7 @@ static const u_int32_t ar9285Modes_v2[][ { 0x00009a44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, { 0x00009a48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, { 0x00009a4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, - { 0x00009a50, 0x00000000, 0x00000000, 0x00058220, 0x00058220, 0x00000000 }, + { 0x00009a50, 0x00000000, 0x00000000, 0x00058224, 0x00058224, 0x00000000 }, { 0x00009a54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, { 0x00009a58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, { 0x00009a5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, @@ -92,8 +91,8 @@ static const u_int32_t ar9285Modes_v2[][ { 0x00009a7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, { 0x00009a80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, { 0x00009a84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, - { 0x00009a88, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, - { 0x00009a8c, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, + { 0x00009a88, 0x00000000, 0x00000000, 0x00078b00, 0x00078b00, 0x00000000 }, + { 0x00009a8c, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, { 0x00009a90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, { 0x00009a94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, { 0x00009a98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, @@ -206,7 +205,7 @@ static const u_int32_t ar9285Modes_v2[][ { 0x0000aa44, 0x00000000, 0x00000000, 0x000581a8, 0x000581a8, 0x00000000 }, { 0x0000aa48, 0x00000000, 0x00000000, 0x00058284, 0x00058284, 0x00000000 }, { 0x0000aa4c, 0x00000000, 0x00000000, 0x00058288, 0x00058288, 0x00000000 }, - { 0x0000aa50, 0x00000000, 0x00000000, 0x00058220, 0x00058220, 0x00000000 }, + { 0x0000aa50, 0x00000000, 0x00000000, 0x00058224, 0x00058224, 0x00000000 }, { 0x0000aa54, 0x00000000, 0x00000000, 0x00058290, 0x00058290, 0x00000000 }, { 0x0000aa58, 0x00000000, 0x00000000, 0x00058300, 0x00058300, 0x00000000 }, { 0x0000aa5c, 0x00000000, 0x00000000, 0x00058304, 0x00058304, 0x00000000 }, @@ -220,8 +219,8 @@ static const u_int32_t ar9285Modes_v2[][ { 0x0000aa7c, 0x00000000, 0x00000000, 0x0006870c, 0x0006870c, 0x00000000 }, { 0x0000aa80, 0x00000000, 0x00000000, 0x00068780, 0x00068780, 0x00000000 }, { 0x0000aa84, 0x00000000, 0x00000000, 0x00068784, 0x00068784, 0x00000000 }, - { 0x0000aa88, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, - { 0x0000aa8c, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, + { 0x0000aa88, 0x00000000, 0x00000000, 0x00078b00, 0x00078b00, 0x00000000 }, + { 0x0000aa8c, 0x00000000, 0x00000000, 0x00078b04, 0x00078b04, 0x00000000 }, { 0x0000aa90, 0x00000000, 0x00000000, 0x00078b08, 0x00078b08, 0x00000000 }, { 0x0000aa94, 0x00000000, 0x00000000, 0x00078b0c, 0x00078b0c, 0x00000000 }, { 0x0000aa98, 0x00000000, 0x00000000, 0x00078b80, 0x00078b80, 0x00000000 }, @@ -324,6 +323,7 @@ static const u_int32_t ar9285Modes_v2[][ }; static const u_int32_t ar9285Common_v2[][2] = { + /* Addr allmodes */ { 0x0000000c, 0x00000000 }, { 0x00000030, 0x00020045 }, { 0x00000034, 0x00000005 }, @@ -625,17 +625,12 @@ static const u_int32_t ar9285Common_v2[] { 0x00007808, 0x54214514 }, { 0x0000780c, 0x02025830 }, { 0x00007810, 0x71c0d388 }, - { 0x00007814, 0x924934a8 }, { 0x0000781c, 0x00000000 }, { 0x00007824, 0x00d86fff }, - { 0x00007828, 0x26d2491b }, { 0x0000782c, 0x6e36d97b }, - { 0x00007830, 0xedb6d96e }, { 0x00007834, 0x71400087 }, - { 0x0000783c, 0x0001fffe }, - { 0x00007840, 0xffeb1a20 }, { 0x00007844, 0x000c0db6 }, - { 0x00007848, 0x6db61b6f }, + { 0x00007848, 0x6db6246f }, { 0x0000784c, 0x6d9b66db }, { 0x00007850, 0x6d8c6dba }, { 0x00007854, 0x00040000 }, @@ -671,7 +666,12 @@ static const u_int32_t ar9285Modes_high_ { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x00007814, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8 }, + { 0x00007828, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b }, + { 0x00007830, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e }, { 0x00007838, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803, 0xfac68803 }, + { 0x0000783c, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe }, + { 0x00007840, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20 }, { 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe }, { 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 }, { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 }, @@ -707,7 +707,12 @@ static const u_int32_t ar9285Modes_origi { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x00007814, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8, 0x924934a8 }, + { 0x00007828, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b, 0x26d2491b }, + { 0x00007830, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e, 0xedb6d96e }, { 0x00007838, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801, 0xfac68801 }, + { 0x0000783c, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe, 0x0001fffe }, + { 0x00007840, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20, 0xffeb1a20 }, { 0x0000786c, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4 }, { 0x00007820, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04 }, { 0x0000a274, 0x0a21c652, 0x0a21c652, 0x0a21a652, 0x0a21a652, 0x0a22a652 }, @@ -719,7 +724,90 @@ static const u_int32_t ar9285Modes_origi { 0x0000a3e0, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, }; +static const u_int32_t ar9285Modes_XE2_0_normal_power[][6] = { + /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ + { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a304, 0x00000000, 0x00000000, 0x00009200, 0x00009200, 0x00000000 }, + { 0x0000a308, 0x00000000, 0x00000000, 0x00010208, 0x00010208, 0x00000000 }, + { 0x0000a30c, 0x00000000, 0x00000000, 0x00019608, 0x00019608, 0x00000000 }, + { 0x0000a310, 0x00000000, 0x00000000, 0x00022618, 0x00022618, 0x00000000 }, + { 0x0000a314, 0x00000000, 0x00000000, 0x0002a6c9, 0x0002a6c9, 0x00000000 }, + { 0x0000a318, 0x00000000, 0x00000000, 0x00031710, 0x00031710, 0x00000000 }, + { 0x0000a31c, 0x00000000, 0x00000000, 0x00035718, 0x00035718, 0x00000000 }, + { 0x0000a320, 0x00000000, 0x00000000, 0x00038758, 0x00038758, 0x00000000 }, + { 0x0000a324, 0x00000000, 0x00000000, 0x0003c75a, 0x0003c75a, 0x00000000 }, + { 0x0000a328, 0x00000000, 0x00000000, 0x0004075c, 0x0004075c, 0x00000000 }, + { 0x0000a32c, 0x00000000, 0x00000000, 0x0004475e, 0x0004475e, 0x00000000 }, + { 0x0000a330, 0x00000000, 0x00000000, 0x0004679f, 0x0004679f, 0x00000000 }, + { 0x0000a334, 0x00000000, 0x00000000, 0x000487df, 0x000487df, 0x00000000 }, + { 0x0000a338, 0x0003891e, 0x0003891e, 0x0003891e, 0x0003891e, 0x00000000 }, + { 0x0000a33c, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x00000000 }, + { 0x0000a340, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a344, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a348, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x00007814, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8 }, + { 0x00007828, 0x4ad2491b, 0x4ad2491b, 0x2ad2491b, 0x4ad2491b, 0x4ad2491b }, + { 0x00007830, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6dbae }, + { 0x00007838, 0xdac71441, 0xdac71441, 0xdac71441, 0xdac71441, 0xdac71441 }, + { 0x0000783c, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe }, + { 0x00007840, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c }, + { 0x0000786c, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4, 0x48609eb4 }, + { 0x00007820, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04, 0x00000c04 }, + { 0x0000a274, 0x0a21c652, 0x0a21c652, 0x0a21a652, 0x0a21a652, 0x0a22a652 }, + { 0x0000a278, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, + { 0x0000a27c, 0x050e039c, 0x050e039c, 0x050e039c, 0x050e039c, 0x050e039c }, + { 0x0000a394, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, + { 0x0000a398, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, + { 0x0000a3dc, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c, 0x39ce739c }, + { 0x0000a3e0, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c, 0x0000039c }, +}; + +static const u_int32_t ar9285Modes_XE2_0_high_power[][6] = { + /* Address 5G-HT20 5G-HT40 2G-HT40 2G-HT20 Turbo */ + { 0x0000a300, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000 }, + { 0x0000a304, 0x00000000, 0x00000000, 0x00006200, 0x00006200, 0x00000000 }, + { 0x0000a308, 0x00000000, 0x00000000, 0x00008201, 0x00008201, 0x00000000 }, + { 0x0000a30c, 0x00000000, 0x00000000, 0x0000b240, 0x0000b240, 0x00000000 }, + { 0x0000a310, 0x00000000, 0x00000000, 0x0000d241, 0x0000d241, 0x00000000 }, + { 0x0000a314, 0x00000000, 0x00000000, 0x0000f600, 0x0000f600, 0x00000000 }, + { 0x0000a318, 0x00000000, 0x00000000, 0x00012800, 0x00012800, 0x00000000 }, + { 0x0000a31c, 0x00000000, 0x00000000, 0x00016802, 0x00016802, 0x00000000 }, + { 0x0000a320, 0x00000000, 0x00000000, 0x0001b805, 0x0001b805, 0x00000000 }, + { 0x0000a324, 0x00000000, 0x00000000, 0x00021a80, 0x00021a80, 0x00000000 }, + { 0x0000a328, 0x00000000, 0x00000000, 0x00028b00, 0x00028b00, 0x00000000 }, + { 0x0000a32c, 0x00000000, 0x00000000, 0x0002ab40, 0x0002ab40, 0x00000000 }, + { 0x0000a330, 0x00000000, 0x00000000, 0x0002cd80, 0x0002cd80, 0x00000000 }, + { 0x0000a334, 0x00000000, 0x00000000, 0x00033d82, 0x00033d82, 0x00000000 }, + { 0x0000a338, 0x0003891e, 0x0003891e, 0x0003891e, 0x0003891e, 0x00000000 }, + { 0x0000a33c, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x0003a95e, 0x00000000 }, + { 0x0000a340, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a344, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a348, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a34c, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a350, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x0000a354, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x0003e9df, 0x00000000 }, + { 0x00007814, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8, 0x92497ca8 }, + { 0x00007828, 0x4ad2491b, 0x4ad2491b, 0x2ad2491b, 0x4ad2491b, 0x4ad2491b }, + { 0x00007830, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e, 0xedb6da6e }, + { 0x00007838, 0xdac71443, 0xdac71443, 0xdac71443, 0xdac71443, 0xdac71443 }, + { 0x0000783c, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe, 0x2481f6fe }, + { 0x00007840, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c, 0xba5f638c }, + { 0x0000786c, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe, 0x08609ebe }, + { 0x00007820, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00, 0x00000c00 }, + { 0x0000a274, 0x0a22a652, 0x0a22a652, 0x0a216652, 0x0a216652, 0x0a22a652 }, + { 0x0000a278, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, + { 0x0000a27c, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7, 0x050380e7 }, + { 0x0000a394, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, + { 0x0000a398, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 }, + { 0x0000a3dc, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7, 0x0e739ce7 }, + { 0x0000a3e0, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7, 0x000000e7 }, +}; + static const u_int32_t ar9285PciePhy_clkreq_always_on_L1_v2[][2] = { + /* Addr allmodes */ {0x00004040, 0x9248fd00 }, {0x00004040, 0x24924924 }, {0x00004040, 0xa8000019 }, @@ -733,6 +821,7 @@ static const u_int32_t ar9285PciePhy_clk }; static const u_int32_t ar9285PciePhy_clkreq_off_L1_v2[][2] = { + /* Addr allmodes */ {0x00004040, 0x9248fd00 }, {0x00004040, 0x24924924 }, {0x00004040, 0xa8000019 }, From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 05:41:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC82B1065679; Tue, 25 Jan 2011 05:41:36 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC20F8FC12; Tue, 25 Jan 2011 05:41:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P5faUF018845; Tue, 25 Jan 2011 05:41:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P5faAX018843; Tue, 25 Jan 2011 05:41:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250541.p0P5faAX018843@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 05:41:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217812 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 05:41:37 -0000 Author: adrian Date: Tue Jan 25 05:41:36 2011 New Revision: 217812 URL: http://svn.freebsd.org/changeset/base/217812 Log: Rename this linux-ism __BIG_ENDIAN_BITFIELD macro to something suitable for FreeBSD. Warner has pointed out that FreeBSD's bit orders follow byte orders. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 05:36:29 2011 (r217811) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 05:41:36 2011 (r217812) @@ -91,7 +91,7 @@ typedef struct ModalEepHeader4k { uint8_t pdGainOverlap; // 1 -#ifdef __BIG_ENDIAN_BITFIELD +#ifdef _BYTE_ORDER == _BIG_ENDIAN uint8_t ob_1:4, ob_0:4; uint8_t db1_1:4, db1_0:4; #else @@ -109,7 +109,7 @@ typedef struct ModalEepHeader4k { uint8_t xatten2Db[AR5416_4K_MAX_CHAINS]; // 1 uint8_t xatten2Margin[AR5416_4K_MAX_CHAINS]; // 1 -#ifdef __BIG_ENDIAN_BITFIELD +#ifdef _BYTE_ORDER == _BIG_ENDIAN uint8_t db2_1:4, db2_0:4; // 1 #else uint8_t db2_0:4, db2_1:4; // 1 @@ -117,7 +117,7 @@ typedef struct ModalEepHeader4k { uint8_t version; // 1 -#ifdef __BIG_ENDIAN_BITFIELD +#ifdef _BYTE_ORDER == _BIG_ENDIAN uint8_t ob_3:4, ob_2:4; uint8_t antdiv_ctl1:4, ob_4:4; uint8_t db1_3:4, db1_2:4; From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 05:47:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5E0D106566B; Tue, 25 Jan 2011 05:47:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53688FC0A; Tue, 25 Jan 2011 05:47:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P5lo5K019015; Tue, 25 Jan 2011 05:47:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P5loAC019013; Tue, 25 Jan 2011 05:47:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250547.p0P5loAC019013@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 05:47:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217813 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 05:47:50 -0000 Author: adrian Date: Tue Jan 25 05:47:50 2011 New Revision: 217813 URL: http://svn.freebsd.org/changeset/base/217813 Log: Bring over a fix from ath9k - zero some of the TX descriptors for Kite/AR9285. Kite doesn't have per-chain control (it has one chain) or antenna control; so don't try to set those descriptor entries. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Jan 25 05:41:36 2011 (r217812) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Tue Jan 25 05:47:50 2011 (r217813) @@ -230,6 +230,13 @@ ar5416SetupTxDesc(struct ath_hal *ah, st ads->ds_ctl2 |= SM(rtsctsDuration, AR_BurstDur); ads->ds_ctl7 |= (rtsctsRate << AR_RTSCTSRate_S); } + + if (AR_SREV_KITE(ah)) { + ads->ds_ctl8 = 0; + ads->ds_ctl9 = 0; + ads->ds_ctl10 = 0; + ads->ds_ctl11 = 0; + } return AH_TRUE; #undef RTSCTS } @@ -417,6 +424,13 @@ ar5416SetupFirstTxDesc(struct ath_hal *a | (flags & HAL_TXDESC_RTSENA ? AR_RTSEnable : 0); ads->ds_ctl2 |= SM(rtsctsDuration, AR_BurstDur); } + + if (AR_SREV_KITE(ah)) { + ads->ds_ctl8 = 0; + ads->ds_ctl9 = 0; + ads->ds_ctl10 = 0; + ads->ds_ctl11 = 0; + } return AH_TRUE; #undef RTSCTS From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 07:10:55 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD83E106564A; Tue, 25 Jan 2011 07:10:55 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id 62F1F8FC0C; Tue, 25 Jan 2011 07:10:54 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0P7Apt3020572 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Jan 2011 18:10:52 +1100 Date: Tue, 25 Jan 2011 18:10:51 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Maxim Sobolev In-Reply-To: <201101250435.p0P4Z7iW017380@svn.freebsd.org> Message-ID: <20110125172518.G1400@besplex.bde.org> References: <201101250435.p0P4Z7iW017380@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217808 - head/sbin/fdisk X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 07:10:56 -0000 On Tue, 25 Jan 2011, Maxim Sobolev wrote: > Log: > Supply maximum value as an argument to the decimal() function > instead of supplying number of bits. > > Submitted by: bde Thaks. I would have spelled this quite differently, but this is functional and fairly easy to clean. > Modified: head/sbin/fdisk/fdisk.c > ============================================================================== > --- head/sbin/fdisk/fdisk.c Tue Jan 25 01:26:25 2011 (r217807) > +++ head/sbin/fdisk/fdisk.c Tue Jan 25 04:35:07 2011 (r217808) > @@ -49,7 +49,10 @@ __FBSDID("$FreeBSD$"); > > int iotest; > > -#define NOSECTORS ((u_int32_t)-1) > +#define NO_DISK_SECTORS ((u_int32_t)-1) > +#define NO_TRACK_CYLINDERS 1023 > +#define NO_TRACK_HEADS 255 > +#define NO_TRACK_SECTORS 63 "NO" looks like negation but means "number of", and these aren't even numbers of things -- they the maximum values of things, and thus one less than the numbers of things, except for sectors since those are numbered starting at 1. I would have expanded these values in all ~2 places each that they are used. "NOSECTORS" seems to have been abused as a magic in-band error value. Its use under a new name as a maximum non-error value conflicts at least logically with this. > @@ -572,9 +575,9 @@ change_part(int i) > } > > do { > - Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, sizeof(partp->dp_typ) * 8); > - Decimal("start", partp->dp_start, tmp, sizeof(partp->dp_start) * 8); > - Decimal("size", partp->dp_size, tmp, sizeof(partp->dp_size) * 8); > + Decimal("sysid (165=FreeBSD)", partp->dp_typ, tmp, 255); > + Decimal("start", partp->dp_start, tmp, NO_DISK_SECTORS); > + Decimal("size", partp->dp_size, tmp, NO_DISK_SECTORS); The start is an offset, and thus its maximum is 1 less than the maximum number of disk sectors, so the off-by-1 error in NO_DISK_SECTORS gives the correct result for it. The size is a count, and thus its maximum is the number of disk sectors, which should be settable to 1 larger than the largest offset. However 1 more is not representable in dp_size, so the maximum must be limited to 1 less than it should be; thus NO_DISK_SECTORS matches its name and doesn't have an off-by-1 error for this use. > @@ -586,9 +589,9 @@ change_part(int i) > tcyl = DPCYL(partp->dp_scyl,partp->dp_ssect); > thd = partp->dp_shd; > tsec = DPSECT(partp->dp_ssect); > - Decimal("beginning cylinder", tcyl, tmp, 10); > - Decimal("beginning head", thd, tmp, sizeof(partp->dp_shd) * 8); > - Decimal("beginning sector", tsec, tmp, 6); > + Decimal("beginning cylinder", tcyl, tmp, NO_TRACK_CYLINDERS); > + Decimal("beginning head", thd, tmp, NO_TRACK_HEADS); > + Decimal("beginning sector", tsec, tmp, NO_TRACK_SECTORS); Spelling NO_TRACK_CYLINDERS as 1023 and NO_TRACK_SECTORS as 63 would fix the style bugs (lines too long) and hopefully reduce confusion between the maximum offset and the total count. The distinction between these is subtlest for sectors since their values are the same. > @@ -915,16 +918,12 @@ ok(const char *str) > } > > static int > -decimal(const char *str, int *num, int deflt, int nbits) > +decimal(const char *str, int *num, int deflt, uint32_t maxval) > { > - long long acc = 0, limit; > + long long acc = 0; I would never use the long long abomination. Now maxval has a reasonably correct type, the same type for the accumulator would work once the limit checking is changed slightly. > @@ -941,7 +940,7 @@ decimal(const char *str, int *num, int d > return 0; > while ((c = *cp++)) { > if (c <= '9' && c >= '0') { > - if (acc < limit) > + if (maxval > 0 && acc <= maxval) > acc = acc * 10 + c - '0'; `acc' can grow to about 10 times larger than the limit, and overflow would occur and break the limit checking if `acc' were uint32_t. Using the long long abomination avoids this overflow. It is better to break when the new `acc' would exceed the limit. See strtol.c for this. But this should just use strtoul() and not be restricted to decimal input. fdisk also has a home-made non-decimal input routine for sectors (like dd(1) parameter parsing and parse^Wexpand_number(3)). This uses strtoul() internally). > @@ -949,10 +948,11 @@ decimal(const char *str, int *num, int d > if (c == ' ' || c == '\t') > while ((c = *cp) && (c == ' ' || c == '\t')) cp++; > if (!c) { > - if (acc >= limit) { > - acc = limit - 1; > - printf("%s is too big, it will be truncated to %lld\n", > - lbuf, acc); > + if (maxval > 0 && acc > maxval) { > + acc = maxval; > + printf("%s exceeds maximum value allowed for " > + "this field. The value has been reduced " > + "to %lld\n", lbuf, acc); I would never use C90 string concatenation to obfuscate a message like this. The output now has formatting errors instead of grammar errors. The obfuscation keeps source line lengths below the limit but is too easy to use to produce output line lengths exceeding the limit, as this now does. Here the output is fairly obiously too long since the statement is so ugly. It also uses an abnormal sentence break of 1 space. Another message in the same function uses the normal sentence break of 2 spaces. I would just print "%s exceeds the maximum of %u. Try again.\n" and restart, like the other error handling in this function does. Bruce From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 07:37:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB375106564A; Tue, 25 Jan 2011 07:37:12 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA3508FC19; Tue, 25 Jan 2011 07:37:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P7bCVo021588; Tue, 25 Jan 2011 07:37:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P7bCxj021586; Tue, 25 Jan 2011 07:37:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101250737.p0P7bCxj021586@svn.freebsd.org> From: Adrian Chadd Date: Tue, 25 Jan 2011 07:37:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217814 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 07:37:12 -0000 Author: adrian Date: Tue Jan 25 07:37:12 2011 New Revision: 217814 URL: http://svn.freebsd.org/changeset/base/217814 Log: * Re-format the v4k header to be consistent * Re-do the structure size/component math to make sure the struct matches the expected size * Just to be clear that we care about bitmask ordering, revert my previous change and instead define that macro if we're on big-endian. Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Modified: head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 05:47:50 2011 (r217813) +++ head/sys/dev/ath/ath_hal/ah_eeprom_v4k.h Tue Jan 25 07:37:12 2011 (r217814) @@ -23,6 +23,10 @@ #include "ah_eeprom.h" #include "ah_eeprom_v14.h" +#if _BYTE_ORDER == _BIG_ENDIAN +#define __BIG_ENDIAN_BITFIELD +#endif + #define AR9285_RDEXT_DEFAULT 0x1F #undef owl_eep_start_loc @@ -70,15 +74,15 @@ typedef struct BaseEepHeader4k { } __packed BASE_EEP4K_HEADER; // 32 B typedef struct ModalEepHeader4k { - uint32_t antCtrlChain[AR5416_4K_MAX_CHAINS]; // 12 + uint32_t antCtrlChain[AR5416_4K_MAX_CHAINS]; // 4 uint32_t antCtrlCommon; // 4 int8_t antennaGainCh[AR5416_4K_MAX_CHAINS]; // 1 uint8_t switchSettling; // 1 - uint8_t txRxAttenCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t txRxAttenCh[AR5416_4K_MAX_CHAINS]; // 1 uint8_t rxTxMarginCh[AR5416_4K_MAX_CHAINS]; // 1 uint8_t adcDesiredSize; // 1 int8_t pgaDesiredSize; // 1 - uint8_t xlnaGainCh[AR5416_4K_MAX_CHAINS]; // 1 + uint8_t xlnaGainCh[AR5416_4K_MAX_CHAINS]; // 1 uint8_t txEndToXpaOff; // 1 uint8_t txEndToRxOn; // 1 uint8_t txFrameToXpaOn; // 1 @@ -91,9 +95,9 @@ typedef struct ModalEepHeader4k { uint8_t pdGainOverlap; // 1 -#ifdef _BYTE_ORDER == _BIG_ENDIAN - uint8_t ob_1:4, ob_0:4; - uint8_t db1_1:4, db1_0:4; +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t ob_1:4, ob_0:4; // 1 + uint8_t db1_1:4, db1_0:4; // 1 #else uint8_t ob_0:4, ob_1:4; uint8_t db1_0:4, db1_1:4; @@ -109,33 +113,33 @@ typedef struct ModalEepHeader4k { uint8_t xatten2Db[AR5416_4K_MAX_CHAINS]; // 1 uint8_t xatten2Margin[AR5416_4K_MAX_CHAINS]; // 1 -#ifdef _BYTE_ORDER == _BIG_ENDIAN - uint8_t db2_1:4, db2_0:4; // 1 +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t db2_1:4, db2_0:4; // 1 #else - uint8_t db2_0:4, db2_1:4; // 1 + uint8_t db2_0:4, db2_1:4; // 1 #endif - uint8_t version; // 1 + uint8_t version; // 1 -#ifdef _BYTE_ORDER == _BIG_ENDIAN - uint8_t ob_3:4, ob_2:4; - uint8_t antdiv_ctl1:4, ob_4:4; - uint8_t db1_3:4, db1_2:4; - uint8_t antdiv_ctl2:4, db1_4:4; - uint8_t db2_2:4, db2_3:4; - uint8_t reserved:4, db2_4:4; +#ifdef __BIG_ENDIAN_BITFIELD + uint8_t ob_3:4, ob_2:4; // 1 + uint8_t antdiv_ctl1:4, ob_4:4; // 1 + uint8_t db1_3:4, db1_2:4; // 1 + uint8_t antdiv_ctl2:4, db1_4:4; // 1 + uint8_t db2_2:4, db2_3:4; // 1 + uint8_t reserved:4, db2_4:4; // 1 #else - uint8_t ob_2:4, ob_3:4; - uint8_t ob_4:4, antdiv_ctl1:4; - uint8_t db1_2:4, db1_3:4; - uint8_t db1_4:4, antdiv_ctl2:4; - uint8_t db2_2:4, db2_3:4; - uint8_t db2_4:4, reserved:4; + uint8_t ob_2:4, ob_3:4; + uint8_t ob_4:4, antdiv_ctl1:4; + uint8_t db1_2:4, db1_3:4; + uint8_t db1_4:4, antdiv_ctl2:4; + uint8_t db2_2:4, db2_3:4; + uint8_t db2_4:4, reserved:4; #endif - uint8_t futureModal[4]; + uint8_t futureModal[4]; // 4 SPUR_CHAN spurChans[AR5416_EEPROM_MODAL_SPURS]; // 20 B -} __packed MODAL_EEP4K_HEADER; // == ? B +} __packed MODAL_EEP4K_HEADER; // == 68 B typedef struct CalCtlData4k { CAL_CTL_EDGES ctlEdges[AR5416_4K_MAX_CHAINS][AR5416_4K_NUM_BAND_EDGES]; From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 08:13:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5576B106566B; Tue, 25 Jan 2011 08:13:32 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2A9FF8FC0A; Tue, 25 Jan 2011 08:13:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0P8DWHO022383; Tue, 25 Jan 2011 08:13:32 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0P8DWDu022380; Tue, 25 Jan 2011 08:13:32 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101250813.p0P8DWDu022380@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Tue, 25 Jan 2011 08:13:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217815 - in head: . share/man/man7 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 08:13:32 -0000 Author: bz Date: Tue Jan 25 08:13:31 2011 New Revision: 217815 URL: http://svn.freebsd.org/changeset/base/217815 Log: Back out r217734. [1] Properly document what `make targets` is supposed to list to avoid further confusion given the place the target sits. Should have happened with r217125. Requested by: imp [1] Reviewed by: rwatson Modified: head/Makefile head/share/man/man7/build.7 Modified: head/Makefile ============================================================================== --- head/Makefile Tue Jan 25 07:37:12 2011 (r217814) +++ head/Makefile Tue Jan 25 08:13:31 2011 (r217815) @@ -28,7 +28,8 @@ # delete-old-dirs - Delete obsolete directories. # delete-old-files - Delete obsolete files. # delete-old-libs - Delete obsolete libraries. -# targets - Print a list of supported TARGET/TARGET_ARCH pairs. +# targets - Print a list of supported TARGET/TARGET_ARCH pairs +# for world and kernel targets. # # This makefile is simple by design. The FreeBSD make automatically reads # the /usr/share/mk/sys.mk unless the -m argument is specified on the @@ -297,7 +298,7 @@ TARGET_ARCHES_${target}?= ${target} .endfor targets: - @echo "Supported TARGETS/TARGET_ARCH pairs" + @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" .for target in ${TARGETS} .for target_arch in ${TARGET_ARCHES_${target}} @echo " ${target}/${target_arch}" Modified: head/share/man/man7/build.7 ============================================================================== --- head/share/man/man7/build.7 Tue Jan 25 07:37:12 2011 (r217814) +++ head/share/man/man7/build.7 Tue Jan 25 08:13:31 2011 (r217815) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 22, 2011 +.Dd January 25, 2011 .Dt BUILD 7 .Os .Sh NAME @@ -229,6 +229,12 @@ This command takes a long time. .It Cm update Get updated sources as configured in .Xr make.conf 5 . +.It Cm targets +Print a list of supported +.Va TARGET +/ +.Va TARGET_ARCH +pairs for world and kernel targets. .It Cm tinderbox Execute the same targets as .Cm universe . From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 10:14:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19B13106564A; Tue, 25 Jan 2011 10:14:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 072228FC1D; Tue, 25 Jan 2011 10:14:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAECrT025516; Tue, 25 Jan 2011 10:14:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAECs3025509; Tue, 25 Jan 2011 10:14:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251014.p0PAECs3025509@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217816 - in stable/8/sys: arm/arm i386/i386 mips/mips powerpc/aim powerpc/booke sparc64/sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:14:13 -0000 Author: kib Date: Tue Jan 25 10:14:12 2011 New Revision: 217816 URL: http://svn.freebsd.org/changeset/base/217816 Log: MFC r217561: For architectures not using direct map , and requiring real KVA page for sf buf allocation, use wakeup() instead of wakeup_one() to notify sf buffer waiters about free buffer. sf_buf_alloc() calls msleep(PCATCH) when SFB_CATCH flag was given, and for simultaneous wakeup and signal delivery, msleep() returns EINTR/ERESTART despite the thread was selected for wakeup_one(). As result, we loose a wakeup, and some other waiter will not be woken up. Modified: stable/8/sys/arm/arm/vm_machdep.c stable/8/sys/i386/i386/vm_machdep.c stable/8/sys/mips/mips/vm_machdep.c stable/8/sys/powerpc/aim/vm_machdep.c stable/8/sys/powerpc/booke/vm_machdep.c stable/8/sys/sparc64/sparc64/vm_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/arm/arm/vm_machdep.c ============================================================================== --- stable/8/sys/arm/arm/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/arm/arm/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -175,7 +175,7 @@ sf_buf_free(struct sf_buf *sf) sf->m = NULL; LIST_REMOVE(sf, list_entry); if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); #endif Modified: stable/8/sys/i386/i386/vm_machdep.c ============================================================================== --- stable/8/sys/i386/i386/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/i386/i386/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -916,7 +916,7 @@ sf_buf_free(struct sf_buf *sf) LIST_REMOVE(sf, list_entry); #endif if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: stable/8/sys/mips/mips/vm_machdep.c ============================================================================== --- stable/8/sys/mips/mips/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/mips/mips/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -528,7 +528,7 @@ sf_buf_free(struct sf_buf *sf) SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_freelist); + wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); } Modified: stable/8/sys/powerpc/aim/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/powerpc/aim/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -338,7 +338,7 @@ sf_buf_free(struct sf_buf *sf) nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: stable/8/sys/powerpc/booke/vm_machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/powerpc/booke/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -346,7 +346,7 @@ sf_buf_free(struct sf_buf *sf) nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_buf_freelist); + wakeup(&sf_buf_freelist); } mtx_unlock(&sf_buf_lock); } Modified: stable/8/sys/sparc64/sparc64/vm_machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/vm_machdep.c Tue Jan 25 08:13:31 2011 (r217815) +++ stable/8/sys/sparc64/sparc64/vm_machdep.c Tue Jan 25 10:14:12 2011 (r217816) @@ -484,7 +484,7 @@ sf_buf_free(struct sf_buf *sf) SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); nsfbufsused--; if (sf_buf_alloc_want > 0) - wakeup_one(&sf_freelist); + wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 10:17:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22FD7106564A; Tue, 25 Jan 2011 10:17:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1213E8FC14; Tue, 25 Jan 2011 10:17:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAHbgr025640; Tue, 25 Jan 2011 10:17:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAHbh9025638; Tue, 25 Jan 2011 10:17:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251017.p0PAHbh9025638@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:17:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217817 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:17:38 -0000 Author: kib Date: Tue Jan 25 10:17:37 2011 New Revision: 217817 URL: http://svn.freebsd.org/changeset/base/217817 Log: MFC r217563: Use malloc(9) instead of kmem_alloc(9) for temporal copy of the user-supplied descriptor array. Modified: stable/8/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:14:12 2011 (r217816) +++ stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:17:37 2011 (r217817) @@ -105,19 +105,13 @@ sysarch_ldt(struct thread *td, struct sy case I386_SET_LDT: td->td_pcb->pcb_full_iret = 1; if (largs->descs != NULL) { - lp = (struct user_segment_descriptor *) - kmem_alloc(kernel_map, largs->num * - sizeof(struct user_segment_descriptor)); - if (lp == NULL) { - error = ENOMEM; - break; - } + lp = malloc(largs->num * sizeof(struct + user_segment_descriptor), M_TEMP, M_WAITOK); error = copyin(largs->descs, lp, largs->num * sizeof(struct user_segment_descriptor)); if (error == 0) error = amd64_set_ldt(td, largs, lp); - kmem_free(kernel_map, (vm_offset_t)lp, largs->num * - sizeof(struct user_segment_descriptor)); + free(lp, M_TEMP); } else { error = amd64_set_ldt(td, largs, NULL); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 10:20:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 343AE106564A; Tue, 25 Jan 2011 10:20:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 232B58FC19; Tue, 25 Jan 2011 10:20:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAKbvn025828; Tue, 25 Jan 2011 10:20:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAKbdQ025826; Tue, 25 Jan 2011 10:20:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251020.p0PAKbdQ025826@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:20:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217818 - stable/8/sys/amd64/amd64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:20:37 -0000 Author: kib Date: Tue Jan 25 10:20:36 2011 New Revision: 217818 URL: http://svn.freebsd.org/changeset/base/217818 Log: MFC r217564: Make the length of the LDT a loader tunable, machdep.max_ldt_segment, and export it with read-only sysctl. Remove unused defines. MFC r217604: Use CTLFLAG_RDTUN for read-only sysctl that exports tunable. Modified: stable/8/sys/amd64/amd64/sys_machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/sys_machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:17:37 2011 (r217817) +++ stable/8/sys/amd64/amd64/sys_machdep.c Tue Jan 25 10:20:36 2011 (r217818) @@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -58,9 +59,24 @@ __FBSDID("$FreeBSD$"); #include +#define MAX_LD 8192 + int max_ldt_segment = 1024; -#define LD_PER_PAGE 512 -#define NULL_LDT_BASE ((caddr_t)NULL) +SYSCTL_INT(_machdep, OID_AUTO, max_ldt_segment, CTLFLAG_RDTUN, + &max_ldt_segment, 0, + "Maximum number of allowed LDT segments in the single address space"); + +static void +max_ldt_segment_init(void *arg __unused) +{ + + TUNABLE_INT_FETCH("machdep.max_ldt_segment", &max_ldt_segment); + if (max_ldt_segment <= 0) + max_ldt_segment = 1; + if (max_ldt_segment > MAX_LD) + max_ldt_segment = MAX_LD; +} +SYSINIT(maxldt, SI_SUB_VM_CONF, SI_ORDER_ANY, max_ldt_segment_init, NULL); #ifdef notyet #ifdef SMP From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 10:59:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9FAD106567A; Tue, 25 Jan 2011 10:59:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A86188FC19; Tue, 25 Jan 2011 10:59:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PAxLGo029335; Tue, 25 Jan 2011 10:59:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PAxLTG029327; Tue, 25 Jan 2011 10:59:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251059.p0PAxLTG029327@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 10:59:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217819 - in head/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 10:59:21 -0000 Author: kib Date: Tue Jan 25 10:59:21 2011 New Revision: 217819 URL: http://svn.freebsd.org/changeset/base/217819 Log: Allow debugger to specify that children of the traced process should be automatically traced. Extend the ptrace(PL_LWPINFO) to report that child just forked. Reviewed by: davidxu, jhb MFC after: 2 weeks Modified: head/sys/kern/kern_fork.c head/sys/kern/kern_proc.c head/sys/kern/kern_sig.c head/sys/kern/subr_trap.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/kern/kern_fork.c Tue Jan 25 10:59:21 2011 (r217819) @@ -338,7 +338,7 @@ do_fork(struct thread *td, int flags, st struct vmspace *vm2) { struct proc *p1, *pptr; - int trypid; + int p2_held, trypid; struct filedesc *fd; struct filedesc_to_leader *fdtol; struct sigacts *newsigacts; @@ -346,6 +346,7 @@ do_fork(struct thread *td, int flags, st sx_assert(&proctree_lock, SX_SLOCKED); sx_assert(&allproc_lock, SX_XLOCKED); + p2_held = 0; p1 = td->td_proc; /* @@ -632,6 +633,8 @@ do_fork(struct thread *td, int flags, st PROC_SLOCK(p2); p2->p_state = PRS_NORMAL; PROC_SUNLOCK(p2); + + PROC_LOCK(p1); #ifdef KDTRACE_HOOKS /* * Tell the DTrace fasttrap provider about the new process @@ -640,19 +643,33 @@ do_fork(struct thread *td, int flags, st * later on. */ if (dtrace_fasttrap_fork) { - PROC_LOCK(p1); PROC_LOCK(p2); dtrace_fasttrap_fork(p1, p2); PROC_UNLOCK(p2); - PROC_UNLOCK(p1); } #endif - - /* - * If RFSTOPPED not requested, make child runnable and add to - * run queue. - */ + if ((p1->p_flag & (P_TRACED | P_FOLLOWFORK)) == (P_TRACED | + P_FOLLOWFORK)) { + /* + * Arrange for debugger to receive the fork event. + * + * We can report PL_FLAG_FORKED regardless of + * P_FOLLOWFORK settings, but it does not make a sense + * for runaway child. + */ + td->td_dbgflags |= TDB_FORK; + td->td_dbg_forked = p2->p_pid; + PROC_LOCK(p2); + td2->td_dbgflags |= TDB_STOPATFORK; + _PHOLD(p2); + p2_held = 1; + PROC_UNLOCK(p2); + } if ((flags & RFSTOPPED) == 0) { + /* + * If RFSTOPPED not requested, make child runnable and + * add to run queue. + */ thread_lock(td2); TD_SET_CAN_RUN(td2); sched_add(td2, SRQ_BORING); @@ -662,7 +679,6 @@ do_fork(struct thread *td, int flags, st /* * Now can be swapped. */ - PROC_LOCK(p1); _PRELE(p1); PROC_UNLOCK(p1); @@ -673,11 +689,19 @@ do_fork(struct thread *td, int flags, st SDT_PROBE(proc, kernel, , create, p2, p1, flags, 0, 0); /* + * Wait until debugger is attached to child. + */ + PROC_LOCK(p2); + while ((td2->td_dbgflags & TDB_STOPATFORK) != 0) + cv_wait(&p2->p_dbgwait, &p2->p_mtx); + if (p2_held) + _PRELE(p2); + + /* * Preserve synchronization semantics of vfork. If waiting for * child to exec or exit, set P_PPWAIT on child, and sleep on our * proc (in case of exit). */ - PROC_LOCK(p2); while (p2->p_flag & P_PPWAIT) cv_wait(&p2->p_pwait, &p2->p_mtx); PROC_UNLOCK(p2); @@ -883,8 +907,37 @@ fork_exit(void (*callout)(void *, struct void fork_return(struct thread *td, struct trapframe *frame) { + struct proc *p, *dbg; + + if (td->td_dbgflags & TDB_STOPATFORK) { + p = td->td_proc; + sx_xlock(&proctree_lock); + PROC_LOCK(p); + if ((p->p_pptr->p_flag & (P_TRACED | P_FOLLOWFORK)) == + (P_TRACED | P_FOLLOWFORK)) { + /* + * If debugger still wants auto-attach for the + * parent's children, do it now. + */ + dbg = p->p_pptr->p_pptr; + p->p_flag |= P_TRACED; + p->p_oppid = p->p_pptr->p_pid; + proc_reparent(p, dbg); + sx_xunlock(&proctree_lock); + ptracestop(td, SIGSTOP); + } else { + /* + * ... otherwise clear the request. + */ + sx_xunlock(&proctree_lock); + td->td_dbgflags &= ~TDB_STOPATFORK; + cv_broadcast(&p->p_dbgwait); + } + PROC_UNLOCK(p); + } userret(td, frame); + #ifdef KTRACE if (KTRPOINT(td, KTR_SYSRET)) ktrsysret(SYS_fork, 0, 0); Modified: head/sys/kern/kern_proc.c ============================================================================== --- head/sys/kern/kern_proc.c Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/kern/kern_proc.c Tue Jan 25 10:59:21 2011 (r217819) @@ -230,6 +230,7 @@ proc_init(void *mem, int size, int flags mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK); mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_RECURSE); cv_init(&p->p_pwait, "ppwait"); + cv_init(&p->p_dbgwait, "dbgwait"); TAILQ_INIT(&p->p_threads); /* all threads in proc */ EVENTHANDLER_INVOKE(process_init, p); p->p_stats = pstats_alloc(); Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/kern/kern_sig.c Tue Jan 25 10:59:21 2011 (r217819) @@ -2393,6 +2393,10 @@ ptracestop(struct thread *td, int sig) p->p_xthread = td; p->p_flag |= (P_STOPPED_SIG|P_STOPPED_TRACE); sig_suspend_threads(td, p, 0); + if ((td->td_dbgflags & TDB_STOPATFORK) != 0) { + td->td_dbgflags &= ~TDB_STOPATFORK; + cv_broadcast(&p->p_dbgwait); + } stopme: thread_suspend_switch(td); if (!(p->p_flag & P_TRACED)) { Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/kern/subr_trap.c Tue Jan 25 10:59:21 2011 (r217819) @@ -392,9 +392,9 @@ syscallret(struct thread *td, int error, */ STOPEVENT(p, S_SCX, sa->code); PTRACESTOP_SC(p, td, S_PT_SCX); - if (traced || (td->td_dbgflags & TDB_EXEC) != 0) { + if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { PROC_LOCK(p); - td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC); + td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); PROC_UNLOCK(p); } } Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/kern/sys_process.c Tue Jan 25 10:59:21 2011 (r217819) @@ -94,6 +94,7 @@ struct ptrace_lwpinfo32 { sigset_t pl_siglist; /* LWP pending signal */ struct siginfo32 pl_siginfo; /* siginfo for signal */ char pl_tdname[MAXCOMLEN + 1]; /* LWP name. */ + int pl_child_pid; /* New child pid */ }; #endif @@ -476,6 +477,7 @@ ptrace_lwpinfo_to32(const struct ptrace_ pl32->pl_siglist = pl->pl_siglist; siginfo_to_siginfo32(&pl->pl_siginfo, &pl32->pl_siginfo); strcpy(pl32->pl_tdname, pl->pl_tdname); + pl32->pl_child_pid = pl->pl_child_pid; } #endif /* COMPAT_FREEBSD32 */ @@ -657,6 +659,7 @@ kern_ptrace(struct thread *td, int req, case PT_TO_SCE: case PT_TO_SCX: case PT_SYSCALL: + case PT_FOLLOW_FORK: case PT_DETACH: sx_xlock(&proctree_lock); proctree_locked = 1; @@ -852,6 +855,13 @@ kern_ptrace(struct thread *td, int req, td2->td_dbgflags &= ~TDB_SUSPEND; break; + case PT_FOLLOW_FORK: + if (data) + p->p_flag |= P_FOLLOWFORK; + else + p->p_flag &= ~P_FOLLOWFORK; + break; + case PT_STEP: case PT_CONTINUE: case PT_TO_SCE: @@ -912,7 +922,7 @@ kern_ptrace(struct thread *td, int req, if (pp == initproc) p->p_sigparent = SIGCHLD; } - p->p_flag &= ~(P_TRACED | P_WAITED); + p->p_flag &= ~(P_TRACED | P_WAITED | P_FOLLOWFORK); p->p_oppid = 0; /* should we send SIGCHLD? */ @@ -1118,6 +1128,10 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_SCX; if (td2->td_dbgflags & TDB_EXEC) pl->pl_flags |= PL_FLAG_EXEC; + if (td2->td_dbgflags & TDB_FORK) { + pl->pl_flags |= PL_FLAG_FORKED; + pl->pl_child_pid = td2->td_dbg_forked; + } pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/sys/proc.h Tue Jan 25 10:59:21 2011 (r217819) @@ -265,6 +265,7 @@ struct thread { int td_ng_outbound; /* (k) Thread entered ng from above. */ struct osd td_osd; /* (k) Object specific data. */ struct vm_map_entry *td_map_def_user; /* (k) Deferred entries. */ + pid_t td_dbg_forked; /* (c) Child pid for debugger. */ #define td_endzero td_rqindex /* Copied during fork1() or thread_sched_upcall(). */ @@ -374,6 +375,10 @@ do { \ #define TDB_SCE 0x00000008 /* Thread performs syscall enter */ #define TDB_SCX 0x00000010 /* Thread performs syscall exit */ #define TDB_EXEC 0x00000020 /* TDB_SCX from exec(2) family */ +#define TDB_FORK 0x00000040 /* TDB_SCX from fork(2) that created new + process */ +#define TDB_STOPATFORK 0x00000080 /* Stop at the return from fork (child + only) */ /* * "Private" flags kept in td_pflags: @@ -557,7 +562,9 @@ struct proc { STAILQ_HEAD(, ktr_request) p_ktr; /* (o) KTR event queue. */ LIST_HEAD(, mqueue_notifier) p_mqnotifier; /* (c) mqueue notifiers.*/ struct kdtrace_proc *p_dtrace; /* (*) DTrace-specific data. */ - struct cv p_pwait; /* (*) wait cv for exit/exec */ + struct cv p_pwait; /* (*) wait cv for exit/exec. */ + struct cv p_dbgwait; /* (*) wait cv for debugger attach + after fork. */ }; #define p_session p_pgrp->pg_session @@ -573,7 +580,7 @@ struct proc { #define P_ADVLOCK 0x00001 /* Process may hold a POSIX advisory lock. */ #define P_CONTROLT 0x00002 /* Has a controlling terminal. */ #define P_KTHREAD 0x00004 /* Kernel thread (*). */ -#define P_UNUSED0 0x00008 /* available. */ +#define P_FOLLOWFORK 0x00008 /* Attach parent debugger to children. */ #define P_PPWAIT 0x00010 /* Parent is waiting for child to exec/exit. */ #define P_PROFIL 0x00020 /* Has started profiling. */ #define P_STOPPROF 0x00040 /* Has thread requesting to stop profiling. */ Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Tue Jan 25 10:20:36 2011 (r217818) +++ head/sys/sys/ptrace.h Tue Jan 25 10:59:21 2011 (r217819) @@ -63,6 +63,8 @@ #define PT_TO_SCX 21 #define PT_SYSCALL 22 +#define PT_FOLLOW_FORK 23 + #define PT_GETREGS 33 /* get general-purpose registers */ #define PT_SETREGS 34 /* set general-purpose registers */ #define PT_GETFPREGS 35 /* get floating-point registers */ @@ -104,10 +106,12 @@ struct ptrace_lwpinfo { #define PL_FLAG_SCX 0x08 /* syscall leave point */ #define PL_FLAG_EXEC 0x10 /* exec(2) succeeded */ #define PL_FLAG_SI 0x20 /* siginfo is valid */ +#define PL_FLAG_FORKED 0x40 /* new child */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ char pl_tdname[MAXCOMLEN + 1]; /* LWP name */ + int pl_child_pid; /* New child pid */ }; /* Argument structure for PT_VM_ENTRY. */ From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 11:02:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0DC5F1065672; Tue, 25 Jan 2011 11:02:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D70FA8FC19; Tue, 25 Jan 2011 11:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PB2Cuv029474; Tue, 25 Jan 2011 11:02:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PB2CgQ029472; Tue, 25 Jan 2011 11:02:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251102.p0PB2CgQ029472@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 11:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217820 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 11:02:13 -0000 Author: kib Date: Tue Jan 25 11:02:12 2011 New Revision: 217820 URL: http://svn.freebsd.org/changeset/base/217820 Log: Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid. MFC after: 2 weeks Modified: head/lib/libc/sys/ptrace.2 Modified: head/lib/libc/sys/ptrace.2 ============================================================================== --- head/lib/libc/sys/ptrace.2 Tue Jan 25 10:59:21 2011 (r217819) +++ head/lib/libc/sys/ptrace.2 Tue Jan 25 11:02:12 2011 (r217820) @@ -2,7 +2,7 @@ .\" $NetBSD: ptrace.2,v 1.2 1995/02/27 12:35:37 cgd Exp $ .\" .\" This file is in the public domain. -.Dd July 10, 2010 +.Dd January 23, 2011 .Dt PTRACE 2 .Os .Sh NAME @@ -295,6 +295,8 @@ struct ptrace_lwpinfo { sigset_t pl_sigmask; sigset_t pl_siglist; siginfo_t pl_siginfo; + char pl_tdname[MAXCOMLEN + 1]; + int pl_child_pid; }; .Ed .Pp @@ -345,6 +347,14 @@ Indicates that member of .Vt "struct ptrace_lwpinfo" contains valid information. +.It PL_FLAG_FORKED +Indicates that the process is returning from a call to +.Fn fork 2 +that created a new child process. +The process identifier of the new process is available in the +.Va pl_child_pid +member of +.Vt "struct ptrace_lwpinfo" . .El .It pl_sigmask The current signal mask of the LWP @@ -356,11 +366,20 @@ on an LWP siglist until the thread is se The siginfo that accompanies the signal pending. Only valid for .Dv PL_EVENT_SIGNAL -kind of stop, when -.Va pl_flags -has +stop when .Dv PL_FLAG_SI -set. +is set in +.Va pl_flags . +.It pl_tdname +The name of the thread. +.It pl_child_pid +The process identifier of the new child process. +Only valid for a +.Dv PL_EVENT_SIGNAL +stop when +.Dv PL_FLAG_FORKED +is set in +.Va pl_flags . .El .It PT_GETNUMLWPS This request returns the number of kernel threads associated with the @@ -391,6 +410,21 @@ This request will trace the specified pr .It PT_SYSCALL This request will trace the specified process on each system call entry and exit. +.It PT_FOLLOW_FORK +This request controls tracing for new child processes of a traced process. +If +.Fa data +is non-zero, +then new child processes will enable tracing and stop before executing their +first instruction. +If +.Fa data +is zero, then new child processes will execute without tracing enabled. +By default, tracing is not enabled for new child processes. +Child processes do not inherit this property. +The traced process will set the +.Dv PL_FLAG_FORKED +flag upon exit from a system call that creates a new process. .It PT_VM_TIMESTAMP This request returns the generation number or timestamp of the memory map of the traced process as the return value from @@ -567,6 +601,7 @@ function appeared in .At v7 . .Sh BUGS The +.Dv PL_FLAG_FORKED , .Dv PL_FLAG_SCE , .Dv PL_FLAG_SCX and From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 11:03:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A5B91065693; Tue, 25 Jan 2011 11:03:36 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id D91DA8FC0A; Tue, 25 Jan 2011 11:03:35 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id p0PB3WI6099351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Jan 2011 13:03:32 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id p0PB3VOT051143; Tue, 25 Jan 2011 13:03:31 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id p0PB3VBQ051142; Tue, 25 Jan 2011 13:03:31 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 25 Jan 2011 13:03:31 +0200 From: Kostik Belousov To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20110125110331.GK2518@deviant.kiev.zoral.com.ua> References: <201101251102.p0PB2CgQ029472@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YCIOI/gPzpKZYkSw" Content-Disposition: inline In-Reply-To: <201101251102.p0PB2CgQ029472@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.4 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Subject: Re: svn commit: r217820 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 11:03:36 -0000 --YCIOI/gPzpKZYkSw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jan 25, 2011 at 11:02:12AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 25 11:02:12 2011 > New Revision: 217820 > URL: http://svn.freebsd.org/changeset/base/217820 >=20 > Log: > Document PT_FLAG_FORKED, PT_FOLLOW_FORK, pl_tdname and pl_child_pid. > =20 > MFC after: 2 weeks Sorry, forgot to mention: Wording provided and reviewed by: jhb --YCIOI/gPzpKZYkSw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEARECAAYFAk0+rgMACgkQC3+MBN1Mb4hU/ACeMTqPO1cxq9zU8qW1WcmgqBGE c/sAoOQGYIl4JyVddxgGj/F4P1kxIDbw =1q1+ -----END PGP SIGNATURE----- --YCIOI/gPzpKZYkSw-- From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 11:04:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F0DB1065694; Tue, 25 Jan 2011 11:04:17 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E93A8FC16; Tue, 25 Jan 2011 11:04:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PB4H7F029547; Tue, 25 Jan 2011 11:04:17 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PB4HwO029545; Tue, 25 Jan 2011 11:04:17 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251104.p0PB4HwO029545@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 11:04:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217821 - head/bin/ps X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 11:04:17 -0000 Author: kib Date: Tue Jan 25 11:04:16 2011 New Revision: 217821 URL: http://svn.freebsd.org/changeset/base/217821 Log: Document P_FOLLOWFORK. MFC after: 2 weeks Modified: head/bin/ps/ps.1 Modified: head/bin/ps/ps.1 ============================================================================== --- head/bin/ps/ps.1 Tue Jan 25 11:02:12 2011 (r217820) +++ head/bin/ps/ps.1 Tue Jan 25 11:04:16 2011 (r217821) @@ -288,6 +288,7 @@ the include file .It Dv "P_ADVLOCK" Ta No "0x00001 Process may hold a POSIX advisory lock" .It Dv "P_CONTROLT" Ta No "0x00002 Has a controlling terminal" .It Dv "P_KTHREAD" Ta No "0x00004 Kernel thread" +.It Dv "P_FOLLOWFORK" Ta No "0x00008 Attach debugger to new children" .It Dv "P_PPWAIT" Ta No "0x00010 Parent is waiting for child to exec/exit" .It Dv "P_PROFIL" Ta No "0x00020 Has started profiling" .It Dv "P_STOPPROF" Ta No "0x00040 Has thread in requesting to stop prof" From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 13:41:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64724106564A; Tue, 25 Jan 2011 13:41:48 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 52C318FC0A; Tue, 25 Jan 2011 13:41:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PDfmwO034062; Tue, 25 Jan 2011 13:41:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PDfmP8034060; Tue, 25 Jan 2011 13:41:48 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101251341.p0PDfmP8034060@svn.freebsd.org> From: Josh Paetzel Date: Tue, 25 Jan 2011 13:41:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217822 - head/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 13:41:48 -0000 Author: jpaetzel Date: Tue Jan 25 13:41:48 2011 New Revision: 217822 URL: http://svn.freebsd.org/changeset/base/217822 Log: Fix logic error introduced in previous commit. Along the way make some efficiency improvements. Submitted by: jilles Approved by: kib (mentor) MFC after: 3 days Modified: head/etc/periodic/daily/800.scrub-zfs Modified: head/etc/periodic/daily/800.scrub-zfs ============================================================================== --- head/etc/periodic/daily/800.scrub-zfs Tue Jan 25 11:04:16 2011 (r217821) +++ head/etc/periodic/daily/800.scrub-zfs Tue Jan 25 13:41:48 2011 (r217822) @@ -5,6 +5,10 @@ # If there is a global system configuration file, suck it in. # + +newline=" +" # A single newline + if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf @@ -24,17 +28,19 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - _status=$(zpool list ${pool} | sed -n -e '$p') + _status=$(zpool list "${pool}" 2> /dev/null) if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi - if echo ${_status} | grep -q FAULTED; then + _status=${_status##*$newline} + case ${_status} in + *FAULTED*) echo "Skipping faulted pool: ${pool}" - continue - fi + continue ;; + esac # successful only if there is at least one pool to scrub rc=0 From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 14:00:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43A7B106566C; Tue, 25 Jan 2011 14:00:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 334E78FC16; Tue, 25 Jan 2011 14:00:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PE0VLY035354; Tue, 25 Jan 2011 14:00:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PE0VUL035352; Tue, 25 Jan 2011 14:00:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251400.p0PE0VUL035352@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 14:00:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217823 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 14:00:31 -0000 Author: kib Date: Tue Jan 25 14:00:30 2011 New Revision: 217823 URL: http://svn.freebsd.org/changeset/base/217823 Log: Bio shall not be accessed after g_io_deliver(9). Reported and tested by: pho Reviewed by: ae, phk MFC after: 1 week Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Tue Jan 25 13:41:48 2011 (r217822) +++ head/sys/dev/md/md.c Tue Jan 25 14:00:30 2011 (r217823) @@ -731,9 +731,9 @@ md_kthread(void *arg) if (error != -1) { bp->bio_completed = bp->bio_length; - g_io_deliver(bp, error); if ((bp->bio_cmd == BIO_READ) || (bp->bio_cmd == BIO_WRITE)) devstat_end_transaction_bio(sc->devstat, bp); + g_io_deliver(bp, error); } } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 14:04:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF284106566B; Tue, 25 Jan 2011 14:04:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BED7D8FC17; Tue, 25 Jan 2011 14:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PE42Va035633; Tue, 25 Jan 2011 14:04:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PE42Bs035631; Tue, 25 Jan 2011 14:04:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101251404.p0PE42Bs035631@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 14:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217824 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 14:04:02 -0000 Author: kib Date: Tue Jan 25 14:04:02 2011 New Revision: 217824 URL: http://svn.freebsd.org/changeset/base/217824 Log: When vtruncbuf() iterates over the vnode buffer list, lock buffer object before checking the validity of the next buffer pointer. Otherwise, the buffer might be reclaimed after the check, causing iteration to run into wrong buffer. Reported and tested by: pho MFC after: 1 week Modified: head/sys/kern/vfs_subr.c Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Tue Jan 25 14:00:30 2011 (r217823) +++ head/sys/kern/vfs_subr.c Tue Jan 25 14:04:02 2011 (r217824) @@ -1337,13 +1337,14 @@ restart: brelse(bp); anyfreed = 1; + BO_LOCK(bo); if (nbp != NULL && (((nbp->b_xflags & BX_VNCLEAN) == 0) || (nbp->b_vp != vp) || (nbp->b_flags & B_DELWRI))) { + BO_UNLOCK(bo); goto restart; } - BO_LOCK(bo); } TAILQ_FOREACH_SAFE(bp, &bo->bo_dirty.bv_hd, b_bobufs, nbp) { @@ -1360,13 +1361,15 @@ restart: bp->b_flags &= ~B_ASYNC; brelse(bp); anyfreed = 1; + + BO_LOCK(bo); if (nbp != NULL && (((nbp->b_xflags & BX_VNDIRTY) == 0) || (nbp->b_vp != vp) || (nbp->b_flags & B_DELWRI) == 0)) { + BO_UNLOCK(bo); goto restart; } - BO_LOCK(bo); } } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 15:06:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1820106566B; Tue, 25 Jan 2011 15:06:50 +0000 (UTC) (envelope-from sem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0ABA8FC12; Tue, 25 Jan 2011 15:06:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PF6oXt038351; Tue, 25 Jan 2011 15:06:50 GMT (envelope-from sem@svn.freebsd.org) Received: (from sem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PF6o1v038349; Tue, 25 Jan 2011 15:06:50 GMT (envelope-from sem@svn.freebsd.org) Message-Id: <201101251506.p0PF6o1v038349@svn.freebsd.org> From: Sergey Matveychuk Date: Tue, 25 Jan 2011 15:06:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217826 - head/share/examples/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 15:06:50 -0000 Author: sem (ports committer) Date: Tue Jan 25 15:06:50 2011 New Revision: 217826 URL: http://svn.freebsd.org/changeset/base/217826 Log: Remove DOS-style EOLs Approved by: kib Modified: head/share/examples/etc/make.conf Modified: head/share/examples/etc/make.conf ============================================================================== --- head/share/examples/etc/make.conf Tue Jan 25 14:45:56 2011 (r217825) +++ head/share/examples/etc/make.conf Tue Jan 25 15:06:50 2011 (r217826) @@ -271,14 +271,14 @@ # /etc/mail/Makefile. Defaults to 0640. # #SENDMAIL_MAP_PERMS= -# -# -# It is also possible to set variables in make.conf which will only be -# used when compiling a specific port. For more details see make(1). -# -#.if ${.CURDIR:M*/irc/irssi-devel*} -#WITH_DEBUG=YES -#.endif -# -# Another approach is to use /usr/ports/ports-mgmt/portconf which has -# its own config file for port specific options. +# +# +# It is also possible to set variables in make.conf which will only be +# used when compiling a specific port. For more details see make(1). +# +#.if ${.CURDIR:M*/irc/irssi-devel*} +#WITH_DEBUG=YES +#.endif +# +# Another approach is to use /usr/ports/ports-mgmt/portconf which has +# its own config file for port specific options. From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 17:15:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61923106564A; Tue, 25 Jan 2011 17:15:23 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50B438FC12; Tue, 25 Jan 2011 17:15:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PHFN06043992; Tue, 25 Jan 2011 17:15:23 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PHFNCg043990; Tue, 25 Jan 2011 17:15:23 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101251715.p0PHFNCg043990@svn.freebsd.org> From: Andrew Thompson Date: Tue, 25 Jan 2011 17:15:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217829 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 17:15:23 -0000 Author: thompsa Date: Tue Jan 25 17:15:23 2011 New Revision: 217829 URL: http://svn.freebsd.org/changeset/base/217829 Log: When matching an incoming ARP against a bridge, ensure both interfaces belong to the same bridge. Submitted by: Alexander Zagrebin Modified: head/sys/netinet/if_ether.c Modified: head/sys/netinet/if_ether.c ============================================================================== --- head/sys/netinet/if_ether.c Tue Jan 25 15:34:07 2011 (r217828) +++ head/sys/netinet/if_ether.c Tue Jan 25 17:15:23 2011 (r217829) @@ -564,7 +564,7 @@ in_arpinput(struct mbuf *m) */ IN_IFADDR_RLOCK(); LIST_FOREACH(ia, INADDR_HASH(itaddr.s_addr), ia_hash) { - if (((bridged && ia->ia_ifp->if_bridge != NULL) || + if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) || ia->ia_ifp == ifp) && itaddr.s_addr == ia->ia_addr.sin_addr.s_addr) { ifa_ref(&ia->ia_ifa); @@ -581,7 +581,7 @@ in_arpinput(struct mbuf *m) } } LIST_FOREACH(ia, INADDR_HASH(isaddr.s_addr), ia_hash) - if (((bridged && ia->ia_ifp->if_bridge != NULL) || + if (((bridged && ia->ia_ifp->if_bridge == ifp->if_bridge) || ia->ia_ifp == ifp) && isaddr.s_addr == ia->ia_addr.sin_addr.s_addr) { ifa_ref(&ia->ia_ifa); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 17:39:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A2D9106564A; Tue, 25 Jan 2011 17:39:53 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 190928FC12; Tue, 25 Jan 2011 17:39:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PHdqwY044845; Tue, 25 Jan 2011 17:39:52 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PHdqKX044842; Tue, 25 Jan 2011 17:39:52 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101251739.p0PHdqKX044842@svn.freebsd.org> From: Matthew D Fleming Date: Tue, 25 Jan 2011 17:39:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 17:39:53 -0000 Author: mdf Date: Tue Jan 25 17:39:52 2011 New Revision: 217830 URL: http://svn.freebsd.org/changeset/base/217830 Log: Document sbuf_new_for_sysctl(9). Pointed out by: lstewart Modified: head/share/man/man9/Makefile head/share/man/man9/sbuf.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Jan 25 17:15:23 2011 (r217829) +++ head/share/man/man9/Makefile Tue Jan 25 17:39:52 2011 (r217830) @@ -1031,6 +1031,7 @@ MLINKS+=sbuf.9 sbuf_bcat.9 \ sbuf.9 sbuf_finish.9 \ sbuf.9 sbuf_len.9 \ sbuf.9 sbuf_new.9 \ + sbuf.9 sbuf_new_for_sysctl.9 \ sbuf.9 sbuf_printf.9 \ sbuf.9 sbuf_putc.9 \ sbuf.9 sbuf_set_drain.9 \ Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Tue Jan 25 17:15:23 2011 (r217829) +++ head/share/man/man9/sbuf.9 Tue Jan 25 17:39:52 2011 (r217830) @@ -25,13 +25,14 @@ .\" .\" $FreeBSD$ .\" -.Dd May 17, 2009 +.Dd January 25, 2011 .Dt SBUF 9 .Os .Sh NAME .Nm sbuf , .Nm sbuf_new , .Nm sbuf_new_auto , +.Nm sbuf_new_for_sysctl , .Nm sbuf_clear , .Nm sbuf_setpos , .Nm sbuf_bcat , @@ -99,6 +100,9 @@ .Fn sbuf_done "struct sbuf *s" .Ft void .Fn sbuf_delete "struct sbuf *s" +.In sys/sysctl.h +.Ft struct sbuf * +.Fn sbuf_new_for_sysctl "struct sbuf *s" "char *buf" "int length" "struct sysctl_req *req" .Sh DESCRIPTION The .Nm @@ -169,6 +173,15 @@ and .Dv SBUF_AUTOEXTEND . .Pp The +.Fn sbuf_new_for_sysctl +function will set up an sbuf with a drain function to use +.Fn SYSCTL_OUT +when the internal buffer fills. +The sysctl old buffer will be wired, which allows for doing an +.Fn sbuf_printf +while holding a mutex. +.Pp +The .Fn sbuf_delete function clears the .Fa sbuf From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 18:32:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35004106564A; Tue, 25 Jan 2011 18:32:22 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 244328FC0A; Tue, 25 Jan 2011 18:32:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PIWMBe046063; Tue, 25 Jan 2011 18:32:22 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PIWMxr046061; Tue, 25 Jan 2011 18:32:22 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101251832.p0PIWMxr046061@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 25 Jan 2011 18:32:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217831 - head/usr.bin/man X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 18:32:22 -0000 Author: uqs Date: Tue Jan 25 18:32:21 2011 New Revision: 217831 URL: http://svn.freebsd.org/changeset/base/217831 Log: Use test(1) operators and test for the catpage not being older than the manpage. Identical mtimes (as generated by buildworld for these files) precluded catpages from working. Approved by: gordon Modified: head/usr.bin/man/man.sh Modified: head/usr.bin/man/man.sh ============================================================================== --- head/usr.bin/man/man.sh Tue Jan 25 17:39:52 2011 (r217830) +++ head/usr.bin/man/man.sh Tue Jan 25 18:32:21 2011 (r217831) @@ -200,8 +200,8 @@ find_file() { # Usage: is_newer file1 file2 # Returns true if file1 is newer than file2 as calculated by mtime. is_newer() { - if [ $(stat -f %m $1) -gt $(stat -f %m $2) ]; then - decho " mtime: $1 newer than $2" 3 + if ! [ "$1" -ot "$2" ]; then + decho " mtime: $1 not older than $2" 3 return 0 else decho " mtime: $1 older than $2" 3 From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:05:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 14719106566B; Tue, 25 Jan 2011 19:05:47 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03A588FC0C; Tue, 25 Jan 2011 19:05:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJ5kMT046860; Tue, 25 Jan 2011 19:05:46 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJ5kaX046858; Tue, 25 Jan 2011 19:05:46 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101251905.p0PJ5kaX046858@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 25 Jan 2011 19:05:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217832 - head/sys/dev/re X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:05:47 -0000 Author: yongari Date: Tue Jan 25 19:05:46 2011 New Revision: 217832 URL: http://svn.freebsd.org/changeset/base/217832 Log: Disable TSO for all Realtek controllers. Experimentation showed RTL8111C generated corrupted frames where TCP option header was broken. All other sample controllers I have did not show such problem so it could be RTL8111C specific issue. Because there are too many variants it's hard to tell how many controllers have such issue. Just disable TSO by default but have user override it. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 25 18:32:21 2011 (r217831) +++ head/sys/dev/re/if_re.c Tue Jan 25 19:05:46 2011 (r217832) @@ -1504,14 +1504,12 @@ re_attach(device_t dev) ifp->if_capabilities |= IFCAP_WOL; ifp->if_capenable = ifp->if_capabilities; /* - * Don't enable TSO by default for old controllers. Under - * certain circumtances the controller generated corrupted - * packets in TSO size. + * Don't enable TSO by default. It is known to generate + * corrupted TCP segments(bad TCP options) under certain + * circumtances. */ - if ((sc->rl_flags & RL_FLAG_DESCV2) == 0) { - ifp->if_hwassist &= ~CSUM_TSO; - ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); - } + ifp->if_hwassist &= ~CSUM_TSO; + ifp->if_capenable &= ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); #ifdef DEVICE_POLLING ifp->if_capabilities |= IFCAP_POLLING; #endif From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:17:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9873C106564A; Tue, 25 Jan 2011 19:17:50 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 882A18FC12; Tue, 25 Jan 2011 19:17:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJHoD7047197; Tue, 25 Jan 2011 19:17:50 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJHoZN047195; Tue, 25 Jan 2011 19:17:50 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201101251917.p0PJHoZN047195@svn.freebsd.org> From: Alexander Kabaev Date: Tue, 25 Jan 2011 19:17:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217833 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:17:50 -0000 Author: kan Date: Tue Jan 25 19:17:50 2011 New Revision: 217833 URL: http://svn.freebsd.org/changeset/base/217833 Log: Do not allocate buffer to hold data for zero-sized sections. Modified: head/lib/libelf/elf_data.c Modified: head/lib/libelf/elf_data.c ============================================================================== --- head/lib/libelf/elf_data.c Tue Jan 25 19:05:46 2011 (r217832) +++ head/lib/libelf/elf_data.c Tue Jan 25 19:17:50 2011 (r217833) @@ -115,8 +115,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) d->d_type = elftype; d->d_version = e->e_version; - if (sh_type == SHT_NOBITS) + if (sh_type == SHT_NOBITS || sh_size == 0) { + STAILQ_INSERT_TAIL(&s->s_data, d, d_next); return (d); + } if ((d->d_buf = malloc(msz*count)) == NULL) { (void) _libelf_release_data(d); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:27:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7BCD6106564A; Tue, 25 Jan 2011 19:27:05 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6918FC08; Tue, 25 Jan 2011 19:27:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJR5Si047512; Tue, 25 Jan 2011 19:27:05 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJR5ap047510; Tue, 25 Jan 2011 19:27:05 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101251927.p0PJR5ap047510@svn.freebsd.org> From: Andrew Thompson Date: Tue, 25 Jan 2011 19:27:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217834 - stable/8/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:27:05 -0000 Author: thompsa Date: Tue Jan 25 19:27:05 2011 New Revision: 217834 URL: http://svn.freebsd.org/changeset/base/217834 Log: MFC r217727 Revert the ndis part of r212122, windrv_stub.c already adds a MODULE_VERSION and this breaks loading miniport drivers from loader.conf Modified: stable/8/sys/dev/if_ndis/if_ndis_usb.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_usb.c Tue Jan 25 19:17:50 2011 (r217833) +++ stable/8/sys/dev/if_ndis/if_ndis_usb.c Tue Jan 25 19:27:05 2011 (r217834) @@ -107,7 +107,6 @@ static driver_t ndis_driver = { static devclass_t ndis_devclass; DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); -MODULE_VERSION(ndis, 1); static int ndisusb_devcompare(interface_type bustype, struct ndis_usb_type *t, device_t dev) From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:35:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6324F106566C; Tue, 25 Jan 2011 19:35:07 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id E74C28FC08; Tue, 25 Jan 2011 19:35:06 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id EA7E241C66F; Tue, 25 Jan 2011 20:35:05 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id ajxOLlBwVMzM; Tue, 25 Jan 2011 20:35:05 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 6D24441C64A; Tue, 25 Jan 2011 20:35:05 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id 7EABB4448F3; Tue, 25 Jan 2011 19:32:55 +0000 (UTC) Date: Tue, 25 Jan 2011 19:32:55 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Alexander Kabaev In-Reply-To: <201101251917.p0PJHoZN047195@svn.freebsd.org> Message-ID: <20110125192715.H3489@maildrop.int.zabbadoz.net> References: <201101251917.p0PJHoZN047195@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217833 - head/lib/libelf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:35:07 -0000 On Tue, 25 Jan 2011, Alexander Kabaev wrote: > Author: kan > Date: Tue Jan 25 19:17:50 2011 > New Revision: 217833 > URL: http://svn.freebsd.org/changeset/base/217833 > > Log: > Do not allocate buffer to hold data for zero-sized sections. Thanks. I understand that this will stop all the WITH_CTF barfing:) The error also had the side effect that objects ended up way biggre than they should be; about +50 to +125% depending on what you look at. .. ERROR: ctfmerge: snd_maestro.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_maestro3.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_neomagic.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_sb16.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_sb8.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_sbc.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor ERROR: ctfmerge: snd_solo.ko.debug: Cannot get sect .note.GNU-stack data: Invalid data buffer descriptor .. > Modified: > head/lib/libelf/elf_data.c > > Modified: head/lib/libelf/elf_data.c > ============================================================================== > --- head/lib/libelf/elf_data.c Tue Jan 25 19:05:46 2011 (r217832) > +++ head/lib/libelf/elf_data.c Tue Jan 25 19:17:50 2011 (r217833) > @@ -115,8 +115,10 @@ elf_getdata(Elf_Scn *s, Elf_Data *d) > d->d_type = elftype; > d->d_version = e->e_version; > > - if (sh_type == SHT_NOBITS) > + if (sh_type == SHT_NOBITS || sh_size == 0) { > + STAILQ_INSERT_TAIL(&s->s_data, d, d_next); > return (d); > + } > > if ((d->d_buf = malloc(msz*count)) == NULL) { > (void) _libelf_release_data(d); > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:44:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F559106564A; Tue, 25 Jan 2011 19:44:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63CEB8FC08; Tue, 25 Jan 2011 19:44:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJighR047978; Tue, 25 Jan 2011 19:44:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJig2i047975; Tue, 25 Jan 2011 19:44:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101251944.p0PJig2i047975@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 19:44:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217835 - stable/8/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:44:42 -0000 Author: jhb Date: Tue Jan 25 19:44:42 2011 New Revision: 217835 URL: http://svn.freebsd.org/changeset/base/217835 Log: MFC 214144: - Make 'vm_refcnt' volatile so that compilers won't be tempted to treat its value as a loop invariant. Currently this is a no-op because 'atomic_cmpset_int()' clobbers all memory on current architectures. - Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop a reference in vmspace_free(). Modified: stable/8/sys/vm/vm_map.c stable/8/sys/vm/vm_map.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/vm/vm_map.c ============================================================================== --- stable/8/sys/vm/vm_map.c Tue Jan 25 19:27:05 2011 (r217834) +++ stable/8/sys/vm/vm_map.c Tue Jan 25 19:44:42 2011 (r217835) @@ -344,15 +344,11 @@ vmspace_dofree(struct vmspace *vm) void vmspace_free(struct vmspace *vm) { - int refcnt; if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); - do - refcnt = vm->vm_refcnt; - while (!atomic_cmpset_int(&vm->vm_refcnt, refcnt, refcnt - 1)); - if (refcnt == 1) + if (atomic_fetchadd_int(&vm->vm_refcnt, -1) == 1) vmspace_dofree(vm); } Modified: stable/8/sys/vm/vm_map.h ============================================================================== --- stable/8/sys/vm/vm_map.h Tue Jan 25 19:27:05 2011 (r217834) +++ stable/8/sys/vm/vm_map.h Tue Jan 25 19:44:42 2011 (r217835) @@ -238,7 +238,7 @@ struct vmspace { caddr_t vm_taddr; /* (c) user virtual address of text */ caddr_t vm_daddr; /* (c) user virtual address of data */ caddr_t vm_maxsaddr; /* user VA at max stack growth */ - int vm_refcnt; /* number of references */ + volatile int vm_refcnt; /* number of references */ /* * Keep the PMAP last, so that CPU-specific variations of that * structure on a single architecture don't result in offset From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 19:44:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46D461065697; Tue, 25 Jan 2011 19:44:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 35E368FC19; Tue, 25 Jan 2011 19:44:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PJiu7I048018; Tue, 25 Jan 2011 19:44:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PJiuC5048015; Tue, 25 Jan 2011 19:44:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101251944.p0PJiuC5048015@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 19:44:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217836 - stable/7/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 19:44:56 -0000 Author: jhb Date: Tue Jan 25 19:44:55 2011 New Revision: 217836 URL: http://svn.freebsd.org/changeset/base/217836 Log: MFC 214144: - Make 'vm_refcnt' volatile so that compilers won't be tempted to treat its value as a loop invariant. Currently this is a no-op because 'atomic_cmpset_int()' clobbers all memory on current architectures. - Use atomic_fetchadd_int() instead of an atomic_cmpset_int() loop to drop a reference in vmspace_free(). Modified: stable/7/sys/vm/vm_map.c stable/7/sys/vm/vm_map.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/vm/vm_map.c ============================================================================== --- stable/7/sys/vm/vm_map.c Tue Jan 25 19:44:42 2011 (r217835) +++ stable/7/sys/vm/vm_map.c Tue Jan 25 19:44:55 2011 (r217836) @@ -336,15 +336,11 @@ vmspace_dofree(struct vmspace *vm) void vmspace_free(struct vmspace *vm) { - int refcnt; if (vm->vm_refcnt == 0) panic("vmspace_free: attempt to free already freed vmspace"); - do - refcnt = vm->vm_refcnt; - while (!atomic_cmpset_int(&vm->vm_refcnt, refcnt, refcnt - 1)); - if (refcnt == 1) + if (atomic_fetchadd_int(&vm->vm_refcnt, -1) == 1) vmspace_dofree(vm); } Modified: stable/7/sys/vm/vm_map.h ============================================================================== --- stable/7/sys/vm/vm_map.h Tue Jan 25 19:44:42 2011 (r217835) +++ stable/7/sys/vm/vm_map.h Tue Jan 25 19:44:55 2011 (r217836) @@ -246,7 +246,7 @@ struct vmspace { caddr_t vm_taddr; /* (c) user virtual address of text */ caddr_t vm_daddr; /* (c) user virtual address of data */ caddr_t vm_maxsaddr; /* user VA at max stack growth */ - int vm_refcnt; /* number of references */ + volatile int vm_refcnt; /* number of references */ }; #ifdef _KERNEL From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:29:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9395E106564A; Tue, 25 Jan 2011 20:29:57 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0A78FC15; Tue, 25 Jan 2011 20:29:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKTvfk049195; Tue, 25 Jan 2011 20:29:57 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKTvmX049193; Tue, 25 Jan 2011 20:29:57 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101252029.p0PKTvmX049193@svn.freebsd.org> From: Andrew Thompson Date: Tue, 25 Jan 2011 20:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217837 - releng/8.2/sys/dev/if_ndis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:29:57 -0000 Author: thompsa Date: Tue Jan 25 20:29:57 2011 New Revision: 217837 URL: http://svn.freebsd.org/changeset/base/217837 Log: MFC r217727 Revert the ndis part of r212122, windrv_stub.c already adds a MODULE_VERSION and this breaks loading miniport drivers from loader.conf Approved by: re (kib) Modified: releng/8.2/sys/dev/if_ndis/if_ndis_usb.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/if_ndis/if_ndis_usb.c ============================================================================== --- releng/8.2/sys/dev/if_ndis/if_ndis_usb.c Tue Jan 25 19:44:55 2011 (r217836) +++ releng/8.2/sys/dev/if_ndis/if_ndis_usb.c Tue Jan 25 20:29:57 2011 (r217837) @@ -107,7 +107,6 @@ static driver_t ndis_driver = { static devclass_t ndis_devclass; DRIVER_MODULE(ndis, uhub, ndis_driver, ndis_devclass, ndisdrv_modevent, 0); -MODULE_VERSION(ndis, 1); static int ndisusb_devcompare(interface_type bustype, struct ndis_usb_type *t, device_t dev) From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:33:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 70839106564A; Tue, 25 Jan 2011 20:33:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E7368FC13; Tue, 25 Jan 2011 20:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKXChe049337; Tue, 25 Jan 2011 20:33:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKXCDZ049330; Tue, 25 Jan 2011 20:33:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252033.p0PKXCDZ049330@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217838 - in stable/8/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:33:12 -0000 Author: jhb Date: Tue Jan 25 20:33:12 2011 New Revision: 217838 URL: http://svn.freebsd.org/changeset/base/217838 Log: MFC 211514,214158: - There isn't really a need to hold the ktrace mutex just to read the value of p_traceflag that is stored in the kinfo_proc structure. - When disabling ktracing on a process, free any pending requests that may be left. This fixes a memory leak that can occur when tracing is disabled on a process via disabling tracing of a specific file (or if an I/O error occurs with the tracefile) if the process's next system call is exit(). The trace disabling code clears p_traceflag, so exit1() doesn't do any KTRACE-related cleanup leading to the leak. I chose to make the free'ing of pending records synchronous rather than patching exit1(). - Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into kern_ktrace.c instead. Make ktrace_mtx private to kern_ktrace.c as a result. Modified: stable/8/sys/kern/kern_exec.c stable/8/sys/kern/kern_exit.c stable/8/sys/kern/kern_fork.c stable/8/sys/kern/kern_ktrace.c stable/8/sys/kern/kern_proc.c stable/8/sys/sys/ktrace.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_exec.c ============================================================================== --- stable/8/sys/kern/kern_exec.c Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/kern/kern_exec.c Tue Jan 25 20:33:12 2011 (r217838) @@ -651,16 +651,8 @@ interpret: setsugid(p); #ifdef KTRACE - if (p->p_tracevp != NULL && - priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) { - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - } + if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) + ktrprocexec(p, &tracecred, &tracevp); #endif /* * Close any file descriptors 0..2 that reference procfs, Modified: stable/8/sys/kern/kern_exit.c ============================================================================== --- stable/8/sys/kern/kern_exit.c Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/kern/kern_exit.c Tue Jan 25 20:33:12 2011 (r217838) @@ -121,10 +121,6 @@ exit1(struct thread *td, int rv) struct proc *p, *nq, *q; struct vnode *vtmp; struct vnode *ttyvp = NULL; -#ifdef KTRACE - struct vnode *tracevp; - struct ucred *tracecred; -#endif struct plimit *plim; int locked; @@ -355,33 +351,7 @@ exit1(struct thread *td, int rv) if (ttyvp != NULL) vrele(ttyvp); #ifdef KTRACE - /* - * Disable tracing, then drain any pending records and release - * the trace file. - */ - if (p->p_traceflag != 0) { - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - ktrprocexit(td); - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - if (tracevp != NULL) { - locked = VFS_LOCK_GIANT(tracevp->v_mount); - vrele(tracevp); - VFS_UNLOCK_GIANT(locked); - } - if (tracecred != NULL) - crfree(tracecred); - } + ktrprocexit(td); #endif /* * Release reference to text vnode Modified: stable/8/sys/kern/kern_fork.c ============================================================================== --- stable/8/sys/kern/kern_fork.c Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/kern/kern_fork.c Tue Jan 25 20:33:12 2011 (r217838) @@ -647,21 +647,7 @@ again: callout_init(&p2->p_itcallout, CALLOUT_MPSAFE); #ifdef KTRACE - /* - * Copy traceflag and tracefile if enabled. - */ - mtx_lock(&ktrace_mtx); - KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); - if (p1->p_traceflag & KTRFAC_INHERIT) { - p2->p_traceflag = p1->p_traceflag; - if ((p2->p_tracevp = p1->p_tracevp) != NULL) { - VREF(p2->p_tracevp); - KASSERT(p1->p_tracecred != NULL, - ("ktrace vnode with no cred")); - p2->p_tracecred = crhold(p1->p_tracecred); - } - } - mtx_unlock(&ktrace_mtx); + ktrprocfork(p1, p2); #endif /* Modified: stable/8/sys/kern/kern_ktrace.c ============================================================================== --- stable/8/sys/kern/kern_ktrace.c Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/kern/kern_ktrace.c Tue Jan 25 20:33:12 2011 (r217838) @@ -126,7 +126,7 @@ SYSCTL_UINT(_kern_ktrace, OID_AUTO, geni 0, "Maximum size of genio event payload"); static int print_message = 1; -struct mtx ktrace_mtx; +static struct mtx ktrace_mtx; static struct sx ktrace_sx; static void ktrace_init(void *dummy); @@ -134,7 +134,10 @@ static int sysctl_kern_ktrace_request_po static u_int ktrace_resize_pool(u_int newsize); static struct ktr_request *ktr_getrequest(int type); static void ktr_submitrequest(struct thread *td, struct ktr_request *req); +static void ktr_freeproc(struct proc *p, struct ucred **uc, + struct vnode **vp); static void ktr_freerequest(struct ktr_request *req); +static void ktr_freerequest_locked(struct ktr_request *req); static void ktr_writerequest(struct thread *td, struct ktr_request *req); static int ktrcanset(struct thread *,struct proc *); static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *); @@ -374,11 +377,43 @@ static void ktr_freerequest(struct ktr_request *req) { + mtx_lock(&ktrace_mtx); + ktr_freerequest_locked(req); + mtx_unlock(&ktrace_mtx); +} + +static void +ktr_freerequest_locked(struct ktr_request *req) +{ + + mtx_assert(&ktrace_mtx, MA_OWNED); if (req->ktr_buffer != NULL) free(req->ktr_buffer, M_KTRACE); - mtx_lock(&ktrace_mtx); STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); - mtx_unlock(&ktrace_mtx); +} + +/* + * Disable tracing for a process and release all associated resources. + * The caller is responsible for releasing a reference on the returned + * vnode and credentials. + */ +static void +ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + struct ktr_request *req; + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_assert(&ktrace_mtx, MA_OWNED); + *uc = p->p_tracecred; + p->p_tracecred = NULL; + if (vp != NULL) + *vp = p->p_tracevp; + p->p_tracevp = NULL; + p->p_traceflag = 0; + while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) { + STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list); + ktr_freerequest_locked(req); + } } void @@ -431,20 +466,79 @@ ktrsysret(code, error, retval) } /* - * When a process exits, drain per-process asynchronous trace records. + * When a setuid process execs, disable tracing. + * + * XXX: We toss any pending asynchronous records. + */ +void +ktrprocexec(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, uc, vp); + mtx_unlock(&ktrace_mtx); +} + +/* + * When a process exits, drain per-process asynchronous trace records + * and disable tracing. */ void ktrprocexit(struct thread *td) { + struct proc *p; + struct ucred *cred; + struct vnode *vp; + int vfslocked; + + p = td->td_proc; + if (p->p_traceflag == 0) + return; ktrace_enter(td); sx_xlock(&ktrace_sx); ktr_drain(td); sx_xunlock(&ktrace_sx); + PROC_LOCK(p); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, &cred, &vp); + mtx_unlock(&ktrace_mtx); + PROC_UNLOCK(p); + if (vp != NULL) { + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + } + if (cred != NULL) + crfree(cred); ktrace_exit(td); } /* + * When a process forks, enable tracing in the new process if needed. + */ +void +ktrprocfork(struct proc *p1, struct proc *p2) +{ + + PROC_LOCK_ASSERT(p1, MA_OWNED); + PROC_LOCK_ASSERT(p2, MA_OWNED); + mtx_lock(&ktrace_mtx); + KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); + if (p1->p_traceflag & KTRFAC_INHERIT) { + p2->p_traceflag = p1->p_traceflag; + if ((p2->p_tracevp = p1->p_tracevp) != NULL) { + VREF(p2->p_tracevp); + KASSERT(p1->p_tracecred != NULL, + ("ktrace vnode with no cred")); + p2->p_tracecred = crhold(p1->p_tracecred); + } + } + mtx_unlock(&ktrace_mtx); +} + +/* * When a thread returns, drain any asynchronous records generated by the * system call. */ @@ -695,10 +789,7 @@ ktrace(td, uap) if (p->p_tracevp == vp) { if (ktrcanset(td, p)) { mtx_lock(&ktrace_mtx); - cred = p->p_tracecred; - p->p_tracecred = NULL; - p->p_tracevp = NULL; - p->p_traceflag = 0; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; crfree(cred); @@ -866,14 +957,9 @@ ktrops(td, p, ops, facs, vp) p->p_traceflag |= KTRFAC_ROOT; } else { /* KTROP_CLEAR */ - if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) { + if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) /* no more tracing */ - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - } + ktr_freeproc(p, &tracecred, &tracevp); } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); @@ -1036,10 +1122,7 @@ ktr_writerequest(struct thread *td, stru PROC_LOCK(p); if (p->p_tracevp == vp) { mtx_lock(&ktrace_mtx); - p->p_tracevp = NULL; - p->p_traceflag = 0; - cred = p->p_tracecred; - p->p_tracecred = NULL; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; } @@ -1051,11 +1134,6 @@ ktr_writerequest(struct thread *td, stru } sx_sunlock(&allproc_lock); - /* - * We can't clear any pending requests in threads that have cached - * them but not yet committed them, as those are per-thread. The - * thread will have to clear it itself on system call return. - */ vfslocked = VFS_LOCK_GIANT(vp->v_mount); while (vrele_count-- > 0) vrele(vp); Modified: stable/8/sys/kern/kern_proc.c ============================================================================== --- stable/8/sys/kern/kern_proc.c Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/kern/kern_proc.c Tue Jan 25 20:33:12 2011 (r217838) @@ -64,10 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE -#include -#include -#endif #ifdef DDB #include @@ -717,9 +713,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_textvp = p->p_textvp; #ifdef KTRACE kp->ki_tracep = p->p_tracevp; - mtx_lock(&ktrace_mtx); kp->ki_traceflag = p->p_traceflag; - mtx_unlock(&ktrace_mtx); #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; Modified: stable/8/sys/sys/ktrace.h ============================================================================== --- stable/8/sys/sys/ktrace.h Tue Jan 25 20:29:57 2011 (r217837) +++ stable/8/sys/sys/ktrace.h Tue Jan 25 20:33:12 2011 (r217838) @@ -191,8 +191,6 @@ struct stat; #define KTRFAC_DROP 0x20000000 /* last event was dropped */ #ifdef _KERNEL -extern struct mtx ktrace_mtx; - void ktrnamei(char *); void ktrcsw(int, int); void ktrpsig(int, sig_t, sigset_t *, int); @@ -200,7 +198,9 @@ void ktrgenio(int, enum uio_rw, struct u void ktrsyscall(int, int narg, register_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); +void ktrprocexec(struct proc *, struct ucred **, struct vnode **); void ktrprocexit(struct thread *); +void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); void ktrstruct(const char *, size_t, void *, size_t); #define ktrsockaddr(s) \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:33:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A80E11065693; Tue, 25 Jan 2011 20:33:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 961238FC29; Tue, 25 Jan 2011 20:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKXlR2049390; Tue, 25 Jan 2011 20:33:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKXlj9049383; Tue, 25 Jan 2011 20:33:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252033.p0PKXlj9049383@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217839 - in stable/7/sys: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:33:47 -0000 Author: jhb Date: Tue Jan 25 20:33:47 2011 New Revision: 217839 URL: http://svn.freebsd.org/changeset/base/217839 Log: MFC 211514,214158: - There isn't really a need to hold the ktrace mutex just to read the value of p_traceflag that is stored in the kinfo_proc structure. - When disabling ktracing on a process, free any pending requests that may be left. This fixes a memory leak that can occur when tracing is disabled on a process via disabling tracing of a specific file (or if an I/O error occurs with the tracefile) if the process's next system call is exit(). The trace disabling code clears p_traceflag, so exit1() doesn't do any KTRACE-related cleanup leading to the leak. I chose to make the free'ing of pending records synchronous rather than patching exit1(). - Move KTRACE-specific logic out of kern_(exec|exit|fork).c and into kern_ktrace.c instead. Make ktrace_mtx private to kern_ktrace.c as a result. Modified: stable/7/sys/kern/kern_exec.c stable/7/sys/kern/kern_exit.c stable/7/sys/kern/kern_fork.c stable/7/sys/kern/kern_ktrace.c stable/7/sys/kern/kern_proc.c stable/7/sys/sys/ktrace.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/kern_exec.c ============================================================================== --- stable/7/sys/kern/kern_exec.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_exec.c Tue Jan 25 20:33:47 2011 (r217839) @@ -605,16 +605,8 @@ interpret: setsugid(p); #ifdef KTRACE - if (p->p_tracevp != NULL && - priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) { - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - } + if (priv_check_cred(oldcred, PRIV_DEBUG_DIFFCRED, 0)) + ktrprocexec(p, &tracecred, &tracevp); #endif /* * Close any file descriptors 0..2 that reference procfs, Modified: stable/7/sys/kern/kern_exit.c ============================================================================== --- stable/7/sys/kern/kern_exit.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_exit.c Tue Jan 25 20:33:47 2011 (r217839) @@ -123,10 +123,6 @@ exit1(struct thread *td, int rv) struct tty *tp; struct vnode *ttyvp; struct vnode *vtmp; -#ifdef KTRACE - struct vnode *tracevp; - struct ucred *tracecred; -#endif struct plimit *plim; int locked; @@ -367,33 +363,7 @@ retry: (void)acct_process(td); mtx_unlock(&Giant); #ifdef KTRACE - /* - * Disable tracing, then drain any pending records and release - * the trace file. - */ - if (p->p_traceflag != 0) { - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - p->p_traceflag = 0; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - ktrprocexit(td); - PROC_LOCK(p); - mtx_lock(&ktrace_mtx); - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - mtx_unlock(&ktrace_mtx); - PROC_UNLOCK(p); - if (tracevp != NULL) { - locked = VFS_LOCK_GIANT(tracevp->v_mount); - vrele(tracevp); - VFS_UNLOCK_GIANT(locked); - } - if (tracecred != NULL) - crfree(tracecred); - } + ktrprocexit(td); #endif /* * Release reference to text vnode Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_fork.c Tue Jan 25 20:33:47 2011 (r217839) @@ -613,21 +613,7 @@ again: callout_init(&p2->p_itcallout, CALLOUT_MPSAFE); #ifdef KTRACE - /* - * Copy traceflag and tracefile if enabled. - */ - mtx_lock(&ktrace_mtx); - KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); - if (p1->p_traceflag & KTRFAC_INHERIT) { - p2->p_traceflag = p1->p_traceflag; - if ((p2->p_tracevp = p1->p_tracevp) != NULL) { - VREF(p2->p_tracevp); - KASSERT(p1->p_tracecred != NULL, - ("ktrace vnode with no cred")); - p2->p_tracecred = crhold(p1->p_tracecred); - } - } - mtx_unlock(&ktrace_mtx); + ktrprocfork(p1, p2); #endif /* Modified: stable/7/sys/kern/kern_ktrace.c ============================================================================== --- stable/7/sys/kern/kern_ktrace.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_ktrace.c Tue Jan 25 20:33:47 2011 (r217839) @@ -127,7 +127,7 @@ SYSCTL_UINT(_kern_ktrace, OID_AUTO, geni 0, "Maximum size of genio event payload"); static int print_message = 1; -struct mtx ktrace_mtx; +static struct mtx ktrace_mtx; static struct sx ktrace_sx; static void ktrace_init(void *dummy); @@ -135,7 +135,10 @@ static int sysctl_kern_ktrace_request_po static u_int ktrace_resize_pool(u_int newsize); static struct ktr_request *ktr_getrequest(int type); static void ktr_submitrequest(struct thread *td, struct ktr_request *req); +static void ktr_freeproc(struct proc *p, struct ucred **uc, + struct vnode **vp); static void ktr_freerequest(struct ktr_request *req); +static void ktr_freerequest_locked(struct ktr_request *req); static void ktr_writerequest(struct thread *td, struct ktr_request *req); static int ktrcanset(struct thread *,struct proc *); static int ktrsetchildren(struct thread *,struct proc *,int,int,struct vnode *); @@ -375,11 +378,43 @@ static void ktr_freerequest(struct ktr_request *req) { + mtx_lock(&ktrace_mtx); + ktr_freerequest_locked(req); + mtx_unlock(&ktrace_mtx); +} + +static void +ktr_freerequest_locked(struct ktr_request *req) +{ + + mtx_assert(&ktrace_mtx, MA_OWNED); if (req->ktr_buffer != NULL) free(req->ktr_buffer, M_KTRACE); - mtx_lock(&ktrace_mtx); STAILQ_INSERT_HEAD(&ktr_free, req, ktr_list); - mtx_unlock(&ktrace_mtx); +} + +/* + * Disable tracing for a process and release all associated resources. + * The caller is responsible for releasing a reference on the returned + * vnode and credentials. + */ +static void +ktr_freeproc(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + struct ktr_request *req; + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_assert(&ktrace_mtx, MA_OWNED); + *uc = p->p_tracecred; + p->p_tracecred = NULL; + if (vp != NULL) + *vp = p->p_tracevp; + p->p_tracevp = NULL; + p->p_traceflag = 0; + while ((req = STAILQ_FIRST(&p->p_ktr)) != NULL) { + STAILQ_REMOVE_HEAD(&p->p_ktr, ktr_list); + ktr_freerequest_locked(req); + } } void @@ -432,20 +467,79 @@ ktrsysret(code, error, retval) } /* - * When a process exits, drain per-process asynchronous trace records. + * When a setuid process execs, disable tracing. + * + * XXX: We toss any pending asynchronous records. + */ +void +ktrprocexec(struct proc *p, struct ucred **uc, struct vnode **vp) +{ + + PROC_LOCK_ASSERT(p, MA_OWNED); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, uc, vp); + mtx_unlock(&ktrace_mtx); +} + +/* + * When a process exits, drain per-process asynchronous trace records + * and disable tracing. */ void ktrprocexit(struct thread *td) { + struct proc *p; + struct ucred *cred; + struct vnode *vp; + int vfslocked; + + p = td->td_proc; + if (p->p_traceflag == 0) + return; ktrace_enter(td); sx_xlock(&ktrace_sx); ktr_drain(td); sx_xunlock(&ktrace_sx); + PROC_LOCK(p); + mtx_lock(&ktrace_mtx); + ktr_freeproc(p, &cred, &vp); + mtx_unlock(&ktrace_mtx); + PROC_UNLOCK(p); + if (vp != NULL) { + vfslocked = VFS_LOCK_GIANT(vp->v_mount); + vrele(vp); + VFS_UNLOCK_GIANT(vfslocked); + } + if (cred != NULL) + crfree(cred); ktrace_exit(td); } /* + * When a process forks, enable tracing in the new process if needed. + */ +void +ktrprocfork(struct proc *p1, struct proc *p2) +{ + + PROC_LOCK_ASSERT(p1, MA_OWNED); + PROC_LOCK_ASSERT(p2, MA_OWNED); + mtx_lock(&ktrace_mtx); + KASSERT(p2->p_tracevp == NULL, ("new process has a ktrace vnode")); + if (p1->p_traceflag & KTRFAC_INHERIT) { + p2->p_traceflag = p1->p_traceflag; + if ((p2->p_tracevp = p1->p_tracevp) != NULL) { + VREF(p2->p_tracevp); + KASSERT(p1->p_tracecred != NULL, + ("ktrace vnode with no cred")); + p2->p_tracecred = crhold(p1->p_tracecred); + } + } + mtx_unlock(&ktrace_mtx); +} + +/* * When a thread returns, drain any asynchronous records generated by the * system call. */ @@ -696,10 +790,7 @@ ktrace(td, uap) if (p->p_tracevp == vp) { if (ktrcanset(td, p)) { mtx_lock(&ktrace_mtx); - cred = p->p_tracecred; - p->p_tracecred = NULL; - p->p_tracevp = NULL; - p->p_traceflag = 0; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; crfree(cred); @@ -867,14 +958,9 @@ ktrops(td, p, ops, facs, vp) p->p_traceflag |= KTRFAC_ROOT; } else { /* KTROP_CLEAR */ - if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) { + if (((p->p_traceflag &= ~facs) & KTRFAC_MASK) == 0) /* no more tracing */ - p->p_traceflag = 0; - tracevp = p->p_tracevp; - p->p_tracevp = NULL; - tracecred = p->p_tracecred; - p->p_tracecred = NULL; - } + ktr_freeproc(p, &tracecred, &tracevp); } mtx_unlock(&ktrace_mtx); PROC_UNLOCK(p); @@ -1038,10 +1124,7 @@ ktr_writerequest(struct thread *td, stru PROC_LOCK(p); if (p->p_tracevp == vp) { mtx_lock(&ktrace_mtx); - p->p_tracevp = NULL; - p->p_traceflag = 0; - cred = p->p_tracecred; - p->p_tracecred = NULL; + ktr_freeproc(p, &cred, NULL); mtx_unlock(&ktrace_mtx); vrele_count++; } @@ -1053,11 +1136,6 @@ ktr_writerequest(struct thread *td, stru } sx_sunlock(&allproc_lock); - /* - * We can't clear any pending requests in threads that have cached - * them but not yet committed them, as those are per-thread. The - * thread will have to clear it itself on system call return. - */ vfslocked = VFS_LOCK_GIANT(vp->v_mount); while (vrele_count-- > 0) vrele(vp); Modified: stable/7/sys/kern/kern_proc.c ============================================================================== --- stable/7/sys/kern/kern_proc.c Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/kern/kern_proc.c Tue Jan 25 20:33:47 2011 (r217839) @@ -63,10 +63,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef KTRACE -#include -#include -#endif #ifdef DDB #include @@ -717,9 +713,7 @@ fill_kinfo_proc_only(struct proc *p, str kp->ki_textvp = p->p_textvp; #ifdef KTRACE kp->ki_tracep = p->p_tracevp; - mtx_lock(&ktrace_mtx); kp->ki_traceflag = p->p_traceflag; - mtx_unlock(&ktrace_mtx); #endif kp->ki_fd = p->p_fd; kp->ki_vmspace = p->p_vmspace; Modified: stable/7/sys/sys/ktrace.h ============================================================================== --- stable/7/sys/sys/ktrace.h Tue Jan 25 20:33:12 2011 (r217838) +++ stable/7/sys/sys/ktrace.h Tue Jan 25 20:33:47 2011 (r217839) @@ -191,8 +191,6 @@ struct stat; #define KTRFAC_DROP 0x20000000 /* last event was dropped */ #ifdef _KERNEL -extern struct mtx ktrace_mtx; - void ktrnamei(char *); void ktrcsw(int, int); void ktrpsig(int, sig_t, sigset_t *, int); @@ -200,7 +198,9 @@ void ktrgenio(int, enum uio_rw, struct u void ktrsyscall(int, int narg, register_t args[]); void ktrsysctl(int *name, u_int namelen); void ktrsysret(int, int, register_t); +void ktrprocexec(struct proc *, struct ucred **, struct vnode **); void ktrprocexit(struct thread *); +void ktrprocfork(struct proc *, struct proc *); void ktruserret(struct thread *); void ktrstruct(const char *, size_t, void *, size_t); #define ktrsockaddr(s) \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:44:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBC6D106566B; Tue, 25 Jan 2011 20:44:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA4768FC14; Tue, 25 Jan 2011 20:44:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKiBt2049735; Tue, 25 Jan 2011 20:44:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKiBEi049728; Tue, 25 Jan 2011 20:44:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252044.p0PKiBEi049728@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:44:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217840 - stable/8/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:44:12 -0000 Author: jhb Date: Tue Jan 25 20:44:11 2011 New Revision: 217840 URL: http://svn.freebsd.org/changeset/base/217840 Log: MFC 204329,210723,210933,214778,215526: Sync mfiutil(8) with HEAD: - Handle malloc() failures more gracefully by error'ing out rather than segfaulting. - Fixed dependencies (make checkdpadd). - Fix typos and spelling mistakes. Modified: stable/8/usr.sbin/mfiutil/Makefile stable/8/usr.sbin/mfiutil/mfi_cmd.c stable/8/usr.sbin/mfiutil/mfi_config.c stable/8/usr.sbin/mfiutil/mfi_evt.c stable/8/usr.sbin/mfiutil/mfi_flash.c stable/8/usr.sbin/mfiutil/mfiutil.8 Directory Properties: stable/8/usr.sbin/mfiutil/ (props changed) Modified: stable/8/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/8/usr.sbin/mfiutil/Makefile Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/Makefile Tue Jan 25 20:44:11 2011 (r217840) @@ -8,6 +8,7 @@ MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime WARNS?=3 +DPADD= ${LIBUTIL} LDADD= -lutil # Here be dragons Modified: stable/8/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:44:11 2011 (r217840) @@ -46,7 +46,7 @@ #include static const char *mfi_status_codes[] = { - "Command completed succesfully", + "Command completed successfully", "Invalid command", "Invalid DMCD opcode", "Invalid parameter", Modified: stable/8/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:44:11 2011 (r217840) @@ -328,6 +328,10 @@ parse_array(int fd, int raid_type, char /* Validate each drive. */ info->drives = calloc(count, sizeof(struct mfi_pd_info)); + if (info->drives == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } info->drive_count = count; for (pinfo = info->drives; (cp = strsep(&array_str, ",")) != NULL; pinfo++) { @@ -638,6 +642,10 @@ create_volume(int ac, char **av) break; } arrays = calloc(narrays, sizeof(*arrays)); + if (arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < narrays; i++) { error = parse_array(fd, raid_type, av[i], &arrays[i]); if (error) @@ -673,6 +681,10 @@ create_volume(int ac, char **av) state.array_count = config->array_count; if (config->array_count > 0) { state.arrays = calloc(config->array_count, sizeof(int)); + if (state.arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->array_count; i++) { ar = (struct mfi_array *)p; state.arrays[i] = ar->array_ref; @@ -685,6 +697,10 @@ create_volume(int ac, char **av) state.log_drv_count = config->log_drv_count; if (config->log_drv_count) { state.volumes = calloc(config->log_drv_count, sizeof(int)); + if (state.volumes == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->log_drv_count; i++) { ld = (struct mfi_ld_config *)p; state.volumes[i] = ld->properties.ld.v.target_id; @@ -721,6 +737,10 @@ create_volume(int ac, char **av) config_size = sizeof(struct mfi_config_data) + sizeof(struct mfi_ld_config) * nvolumes + MFI_ARRAY_SIZE * narrays; config = calloc(1, config_size); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } config->size = config_size; config->array_count = narrays; config->array_size = MFI_ARRAY_SIZE; /* XXX: Firmware hardcode */ @@ -902,6 +922,10 @@ add_spare(int ac, char **av) spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) * config->array_count); + if (spare == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } bzero(spare, sizeof(struct mfi_spare)); spare->ref = info.ref; @@ -1170,6 +1194,10 @@ dump(int ac, char **av) } config = malloc(len); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } if (sysctlbyname(buf, config, &len, NULL, 0) < 0) { error = errno; warn("Failed to read debug command"); Modified: stable/8/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:44:11 2011 (r217840) @@ -624,6 +624,10 @@ show_events(int ac, char **av) } list = malloc(size); + if (list == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (seq = start;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { Modified: stable/8/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/8/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:44:11 2011 (r217840) @@ -163,6 +163,10 @@ flash_adapter(int ac, char **av) /* Upload the file 64k at a time. */ buf = malloc(FLASH_BUF_SIZE); + if (buf == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } offset = 0; while (sb.st_size > 0) { nread = read(flash, buf, FLASH_BUF_SIZE); Modified: stable/8/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/8/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:33:47 2011 (r217839) +++ stable/8/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:44:11 2011 (r217840) @@ -254,7 +254,7 @@ The default locale is The available locales are .Dq volume , .Dq drive , -.Dq enclousure , +.Dq enclosure , .Dq battery , .Dq sas , .Dq controller , @@ -503,7 +503,7 @@ Enable periodic patrol reads initiated b The optional .Ar interval argument specifies the interval in seconds between patrol reads. -If patrol reads should be run continously, +If patrol reads should be run continuously, then .Ar interval should consist of the word From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:44:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5995510656C0; Tue, 25 Jan 2011 20:44:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 483EC8FC18; Tue, 25 Jan 2011 20:44:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKiPhd049780; Tue, 25 Jan 2011 20:44:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKiP8x049773; Tue, 25 Jan 2011 20:44:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252044.p0PKiP8x049773@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:44:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217841 - stable/7/usr.sbin/mfiutil X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:44:25 -0000 Author: jhb Date: Tue Jan 25 20:44:24 2011 New Revision: 217841 URL: http://svn.freebsd.org/changeset/base/217841 Log: MFC 204329,210723,210933,214778,215526: Sync mfiutil(8) with HEAD: - Handle malloc() failures more gracefully by error'ing out rather than segfaulting. - Fixed dependencies (make checkdpadd). - Fix typos and spelling mistakes. Modified: stable/7/usr.sbin/mfiutil/Makefile stable/7/usr.sbin/mfiutil/mfi_cmd.c stable/7/usr.sbin/mfiutil/mfi_config.c stable/7/usr.sbin/mfiutil/mfi_evt.c stable/7/usr.sbin/mfiutil/mfi_flash.c stable/7/usr.sbin/mfiutil/mfiutil.8 Directory Properties: stable/7/usr.sbin/mfiutil/ (props changed) Modified: stable/7/usr.sbin/mfiutil/Makefile ============================================================================== --- stable/7/usr.sbin/mfiutil/Makefile Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/Makefile Tue Jan 25 20:44:24 2011 (r217841) @@ -8,6 +8,7 @@ MAN8= mfiutil.8 CFLAGS+= -fno-builtin-strftime WARNS?=3 +DPADD= ${LIBUTIL} LDADD= -lutil # Here be dragons Modified: stable/7/usr.sbin/mfiutil/mfi_cmd.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_cmd.c Tue Jan 25 20:44:24 2011 (r217841) @@ -46,7 +46,7 @@ #include static const char *mfi_status_codes[] = { - "Command completed succesfully", + "Command completed successfully", "Invalid command", "Invalid DMCD opcode", "Invalid parameter", Modified: stable/7/usr.sbin/mfiutil/mfi_config.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_config.c Tue Jan 25 20:44:24 2011 (r217841) @@ -328,6 +328,10 @@ parse_array(int fd, int raid_type, char /* Validate each drive. */ info->drives = calloc(count, sizeof(struct mfi_pd_info)); + if (info->drives == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } info->drive_count = count; for (pinfo = info->drives; (cp = strsep(&array_str, ",")) != NULL; pinfo++) { @@ -638,6 +642,10 @@ create_volume(int ac, char **av) break; } arrays = calloc(narrays, sizeof(*arrays)); + if (arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < narrays; i++) { error = parse_array(fd, raid_type, av[i], &arrays[i]); if (error) @@ -673,6 +681,10 @@ create_volume(int ac, char **av) state.array_count = config->array_count; if (config->array_count > 0) { state.arrays = calloc(config->array_count, sizeof(int)); + if (state.arrays == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->array_count; i++) { ar = (struct mfi_array *)p; state.arrays[i] = ar->array_ref; @@ -685,6 +697,10 @@ create_volume(int ac, char **av) state.log_drv_count = config->log_drv_count; if (config->log_drv_count) { state.volumes = calloc(config->log_drv_count, sizeof(int)); + if (state.volumes == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (i = 0; i < config->log_drv_count; i++) { ld = (struct mfi_ld_config *)p; state.volumes[i] = ld->properties.ld.v.target_id; @@ -721,6 +737,10 @@ create_volume(int ac, char **av) config_size = sizeof(struct mfi_config_data) + sizeof(struct mfi_ld_config) * nvolumes + MFI_ARRAY_SIZE * narrays; config = calloc(1, config_size); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } config->size = config_size; config->array_count = narrays; config->array_size = MFI_ARRAY_SIZE; /* XXX: Firmware hardcode */ @@ -902,6 +922,10 @@ add_spare(int ac, char **av) spare = malloc(sizeof(struct mfi_spare) + sizeof(uint16_t) * config->array_count); + if (spare == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } bzero(spare, sizeof(struct mfi_spare)); spare->ref = info.ref; @@ -1170,6 +1194,10 @@ dump(int ac, char **av) } config = malloc(len); + if (config == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } if (sysctlbyname(buf, config, &len, NULL, 0) < 0) { error = errno; warn("Failed to read debug command"); Modified: stable/7/usr.sbin/mfiutil/mfi_evt.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_evt.c Tue Jan 25 20:44:24 2011 (r217841) @@ -624,6 +624,10 @@ show_events(int ac, char **av) } list = malloc(size); + if (list == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } for (seq = start;;) { if (mfi_get_events(fd, list, num_events, filter, seq, &status) < 0) { Modified: stable/7/usr.sbin/mfiutil/mfi_flash.c ============================================================================== --- stable/7/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfi_flash.c Tue Jan 25 20:44:24 2011 (r217841) @@ -163,6 +163,10 @@ flash_adapter(int ac, char **av) /* Upload the file 64k at a time. */ buf = malloc(FLASH_BUF_SIZE); + if (buf == NULL) { + warnx("malloc failed"); + return (ENOMEM); + } offset = 0; while (sb.st_size > 0) { nread = read(flash, buf, FLASH_BUF_SIZE); Modified: stable/7/usr.sbin/mfiutil/mfiutil.8 ============================================================================== --- stable/7/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:44:11 2011 (r217840) +++ stable/7/usr.sbin/mfiutil/mfiutil.8 Tue Jan 25 20:44:24 2011 (r217841) @@ -254,7 +254,7 @@ The default locale is The available locales are .Dq volume , .Dq drive , -.Dq enclousure , +.Dq enclosure , .Dq battery , .Dq sas , .Dq controller , @@ -503,7 +503,7 @@ Enable periodic patrol reads initiated b The optional .Ar interval argument specifies the interval in seconds between patrol reads. -If patrol reads should be run continously, +If patrol reads should be run continuously, then .Ar interval should consist of the word From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:48:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23E2E106564A; Tue, 25 Jan 2011 20:48:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 130808FC0A; Tue, 25 Jan 2011 20:48:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKmmkE049994; Tue, 25 Jan 2011 20:48:48 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKmmg5049991; Tue, 25 Jan 2011 20:48:48 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252048.p0PKmmg5049991@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:48:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217843 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:48:49 -0000 Author: jhb Date: Tue Jan 25 20:48:48 2011 New Revision: 217843 URL: http://svn.freebsd.org/changeset/base/217843 Log: MFC 215540: Set various POSIX capability sysctls to the version of the API that is supported rather than 1. They are supposed to return a suitable value for sysconf(3). While here, make the fsync sysctl match . Modified: stable/8/sys/kern/p1003_1b.c stable/8/sys/kern/posix4_mib.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/p1003_1b.c ============================================================================== --- stable/8/sys/kern/p1003_1b.c Tue Jan 25 20:46:54 2011 (r217842) +++ stable/8/sys/kern/p1003_1b.c Tue Jan 25 20:48:48 2011 (r217843) @@ -102,7 +102,7 @@ sched_attach(void) int ret = ksched_attach(&ksched); if (ret == 0) - p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 1); + p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 200112L); return ret; } Modified: stable/8/sys/kern/posix4_mib.c ============================================================================== --- stable/8/sys/kern/posix4_mib.c Tue Jan 25 20:46:54 2011 (r217842) +++ stable/8/sys/kern/posix4_mib.c Tue Jan 25 20:48:48 2011 (r217843) @@ -164,9 +164,10 @@ p31b_iscfg(int num) static void p31b_set_standard(void *dummy) { - /* ??? p31b_setcfg(CTL_P1003_1B_FSYNC, 1); */ - p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 1); - p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 1); + + p31b_setcfg(CTL_P1003_1B_FSYNC, 200112L); + p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 200112L); + p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 200112L); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:49:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5820B1065673; Tue, 25 Jan 2011 20:49:25 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 473BA8FC18; Tue, 25 Jan 2011 20:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKnPFT050045; Tue, 25 Jan 2011 20:49:25 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKnPKn050042; Tue, 25 Jan 2011 20:49:25 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252049.p0PKnPKn050042@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217844 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:49:25 -0000 Author: jhb Date: Tue Jan 25 20:49:24 2011 New Revision: 217844 URL: http://svn.freebsd.org/changeset/base/217844 Log: MFC 215540: Set various POSIX capability sysctls to the version of the API that is supported rather than 1. They are supposed to return a suitable value for sysconf(3). While here, make the fsync sysctl match . Modified: stable/7/sys/kern/p1003_1b.c stable/7/sys/kern/posix4_mib.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/p1003_1b.c ============================================================================== --- stable/7/sys/kern/p1003_1b.c Tue Jan 25 20:48:48 2011 (r217843) +++ stable/7/sys/kern/p1003_1b.c Tue Jan 25 20:49:24 2011 (r217844) @@ -102,7 +102,7 @@ sched_attach(void) int ret = ksched_attach(&ksched); if (ret == 0) - p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 1); + p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 200112L); return ret; } Modified: stable/7/sys/kern/posix4_mib.c ============================================================================== --- stable/7/sys/kern/posix4_mib.c Tue Jan 25 20:48:48 2011 (r217843) +++ stable/7/sys/kern/posix4_mib.c Tue Jan 25 20:49:24 2011 (r217844) @@ -134,9 +134,10 @@ p31b_iscfg(int num) static void p31b_set_standard(void *dummy) { - /* ??? p31b_setcfg(CTL_P1003_1B_FSYNC, 1); */ - p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 1); - p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 1); + + p31b_setcfg(CTL_P1003_1B_FSYNC, 200112L); + p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 200112L); + p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 200112L); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:54:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29C4A106566B; Tue, 25 Jan 2011 20:54:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18EF28FC14; Tue, 25 Jan 2011 20:54:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKsF0Y050215; Tue, 25 Jan 2011 20:54:15 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKsFQK050213; Tue, 25 Jan 2011 20:54:15 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252054.p0PKsFQK050213@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:54:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217845 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:54:16 -0000 Author: jhb Date: Tue Jan 25 20:54:15 2011 New Revision: 217845 URL: http://svn.freebsd.org/changeset/base/217845 Log: MFC 215541: Set the POSIX semaphore capability when the semaphore module is enabled. Modified: stable/8/sys/kern/uipc_sem.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/uipc_sem.c ============================================================================== --- stable/8/sys/kern/uipc_sem.c Tue Jan 25 20:49:24 2011 (r217844) +++ stable/8/sys/kern/uipc_sem.c Tue Jan 25 20:54:15 2011 (r217845) @@ -950,6 +950,7 @@ ksem_module_init(void) mtx_init(&ksem_count_lock, "ksem count", NULL, MTX_DEF); sx_init(&ksem_dict_lock, "ksem dictionary"); ksem_dictionary = hashinit(1024, M_KSEM, &ksem_hash); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); @@ -973,6 +974,7 @@ ksem_module_destroy(void) #endif syscall_helper_unregister(ksem_syscalls); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); mtx_destroy(&ksem_count_lock); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:54:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26B48106566B; Tue, 25 Jan 2011 20:54:30 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 15F9C8FC1F; Tue, 25 Jan 2011 20:54:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKsTdh050254; Tue, 25 Jan 2011 20:54:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKsTE8050252; Tue, 25 Jan 2011 20:54:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252054.p0PKsTE8050252@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:54:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217846 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:54:30 -0000 Author: jhb Date: Tue Jan 25 20:54:29 2011 New Revision: 217846 URL: http://svn.freebsd.org/changeset/base/217846 Log: MFC 215541: Set the POSIX semaphore capability when the semaphore module is enabled. Modified: stable/7/sys/kern/uipc_sem.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/uipc_sem.c ============================================================================== --- stable/7/sys/kern/uipc_sem.c Tue Jan 25 20:54:15 2011 (r217845) +++ stable/7/sys/kern/uipc_sem.c Tue Jan 25 20:54:29 2011 (r217846) @@ -869,6 +869,7 @@ ksem_module_init(void) mtx_init(&ksem_count_lock, "ksem count", NULL, MTX_DEF); sx_init(&ksem_dict_lock, "ksem dictionary"); ksem_dictionary = hashinit(1024, M_KSEM, &ksem_hash); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); @@ -900,6 +901,7 @@ ksem_module_destroy(void) SYSCALL_DEREGISTER(ksem_getvalue); SYSCALL_DEREGISTER(ksem_destroy); + p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); mtx_destroy(&ksem_count_lock); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:56:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A313B106564A; Tue, 25 Jan 2011 20:56:18 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92C5D8FC08; Tue, 25 Jan 2011 20:56:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKuIiF050350; Tue, 25 Jan 2011 20:56:18 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKuII0050348; Tue, 25 Jan 2011 20:56:18 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252056.p0PKuII0050348@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 20:56:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217847 - head/bin/sh X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:56:18 -0000 Author: jilles Date: Tue Jan 25 20:56:18 2011 New Revision: 217847 URL: http://svn.freebsd.org/changeset/base/217847 Log: sh: Clean up some old comments: * There is no plan for an alternative to the command "set". * Attempting to unset a readonly variable has not raised an error for quite a while, so the order of unsetting a variable and a function with the same name does not matter. MFC after: 1 week Modified: head/bin/sh/var.c Modified: head/bin/sh/var.c ============================================================================== --- head/bin/sh/var.c Tue Jan 25 20:54:29 2011 (r217846) +++ head/bin/sh/var.c Tue Jan 25 20:56:18 2011 (r217847) @@ -600,9 +600,8 @@ var_compare(const void *a, const void *b /* - * Command to list all variables which are set. Currently this command - * is invoked from the set command when the set command is called without - * any variables. + * Command to list all variables which are set. This is invoked from the + * set command when it is called without any options or operands. */ int @@ -840,9 +839,7 @@ setvarcmd(int argc, char **argv) /* - * The unset builtin command. We unset the function before we unset the - * variable to allow a function to be unset when there is a readonly variable - * with the same name. + * The unset builtin command. */ int From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 20:59:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C4241106564A; Tue, 25 Jan 2011 20:59:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B359D8FC12; Tue, 25 Jan 2011 20:59:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PKxlwN050492; Tue, 25 Jan 2011 20:59:47 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PKxl1c050490; Tue, 25 Jan 2011 20:59:47 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252059.p0PKxl1c050490@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 20:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217848 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 20:59:47 -0000 Author: jhb Date: Tue Jan 25 20:59:47 2011 New Revision: 217848 URL: http://svn.freebsd.org/changeset/base/217848 Log: MFC 214675: Don't leak the LLE lock if the arptimer callout is pending or inactive. Modified: stable/8/sys/netinet/if_ether.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/if_ether.c ============================================================================== --- stable/8/sys/netinet/if_ether.c Tue Jan 25 20:56:18 2011 (r217847) +++ stable/8/sys/netinet/if_ether.c Tue Jan 25 20:59:47 2011 (r217848) @@ -187,16 +187,16 @@ arptimer(void *arg) pkts_dropped = llentry_free(lle); ARPSTAT_ADD(dropped, pkts_dropped); ARPSTAT_INC(timeouts); - } + } else { #ifdef DIAGNOSTIC - else { struct sockaddr *l3addr = L3_ADDR(lle); log(LOG_INFO, "arptimer issue: %p, IPv4 address: \"%s\"\n", lle, inet_ntoa( ((const struct sockaddr_in *)l3addr)->sin_addr)); - } #endif + LLE_WUNLOCK(lle); + } } IF_AFDATA_UNLOCK(ifp); CURVNET_RESTORE(); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:04:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E21C5106566B; Tue, 25 Jan 2011 21:04:55 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1FCF8FC17; Tue, 25 Jan 2011 21:04:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PL4tOr050650; Tue, 25 Jan 2011 21:04:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PL4tCU050648; Tue, 25 Jan 2011 21:04:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101252104.p0PL4tCU050648@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 21:04:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217849 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:04:56 -0000 Author: kib Date: Tue Jan 25 21:04:55 2011 New Revision: 217849 URL: http://svn.freebsd.org/changeset/base/217849 Log: Fix get_program_var_addr() when type of the resolved symbol is functional. Use make_function_pointer then, otherwise ia64 is broken. Reported and tested by: marcel Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 25 20:59:47 2011 (r217848) +++ head/libexec/rtld-elf/rtld.c Tue Jan 25 21:04:55 2011 (r217849) @@ -2800,7 +2800,12 @@ get_program_var_addr(const char *name, R donelist_init(&donelist); if (symlook_global(&req, &donelist) != 0) return (NULL); - return ((const void **)(req.defobj_out->relocbase + req.sym_out->st_value)); + if (ELF_ST_TYPE(req.sym_out->st_info) == STT_FUNC) + return ((const void **)make_function_pointer(req.sym_out, + req.defobj_out)); + else + return ((const void **)(req.defobj_out->relocbase + + req.sym_out->st_value)); } /* From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:06:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 56A66106566C; Tue, 25 Jan 2011 21:06:49 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 466618FC14; Tue, 25 Jan 2011 21:06:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PL6n15050735; Tue, 25 Jan 2011 21:06:49 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PL6nAI050733; Tue, 25 Jan 2011 21:06:49 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101252106.p0PL6nAI050733@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 21:06:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217850 - head/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:06:49 -0000 Author: kib Date: Tue Jan 25 21:06:49 2011 New Revision: 217850 URL: http://svn.freebsd.org/changeset/base/217850 Log: Emit .note.GNU-stack for the syscall stubs generated by libc only on architectures that support this .note. In particular, do not unneccessary emit the notes on ia64 and sparc64, which ABI require non-executable stacks. Tested by: marcel Modified: head/lib/libc/sys/Makefile.inc Modified: head/lib/libc/sys/Makefile.inc ============================================================================== --- head/lib/libc/sys/Makefile.inc Tue Jan 25 21:04:55 2011 (r217849) +++ head/lib/libc/sys/Makefile.inc Tue Jan 25 21:06:49 2011 (r217850) @@ -53,16 +53,23 @@ SYM_MAPS+= ${.CURDIR}/sys/Symbol.map # Generated files CLEANFILES+= ${SASM} ${SPSEUDO} +.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386" || \ + ${MACHINE_CPUARCH} == "powerpc" +NOTE_GNU_STACK='\t.section .note.GNU-stack,"",%%progbits\n' +.else +NOTE_GNU_STACK='' +.endif + ${SASM}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >> ${.TARGET} - printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} ${SPSEUDO}: printf '#include "compat.h"\n' > ${.TARGET} printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \ >> ${.TARGET} - printf '\t.section .note.GNU-stack,"",%%progbits\n' >>${.TARGET} + printf ${NOTE_GNU_STACK} >>${.TARGET} MAN+= abort2.2 accept.2 access.2 acct.2 adjtime.2 \ aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \ From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:12:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 369E4106564A; Tue, 25 Jan 2011 21:12:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24C988FC0C; Tue, 25 Jan 2011 21:12:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PLCWfC050929; Tue, 25 Jan 2011 21:12:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PLCVDs050918; Tue, 25 Jan 2011 21:12:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101252112.p0PLCVDs050918@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 21:12:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217851 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:12:32 -0000 Author: kib Date: Tue Jan 25 21:12:31 2011 New Revision: 217851 URL: http://svn.freebsd.org/changeset/base/217851 Log: When loading dso without PT_GNU_STACK phdr, only call __pthread_map_stacks_exec() on architectures that allow executable stacks. Reported and tested by: marcel (ia64) Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h head/libexec/rtld-elf/arm/rtld_machdep.h head/libexec/rtld-elf/i386/rtld_machdep.h head/libexec/rtld-elf/ia64/rtld_machdep.h head/libexec/rtld-elf/map_object.c head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/powerpc/rtld_machdep.h head/libexec/rtld-elf/powerpc64/rtld_machdep.h head/libexec/rtld-elf/rtld.c head/libexec/rtld-elf/sparc64/rtld_machdep.h Modified: head/libexec/rtld-elf/amd64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/amd64/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/amd64/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -73,4 +73,7 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/arm/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/arm/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/arm/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -69,4 +69,7 @@ void _rtld_bind_start(void); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/i386/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/i386/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/i386/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -74,4 +74,7 @@ typedef struct { extern void *___tls_get_addr(tls_index *ti) __attribute__((__regparm__(1))); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/ia64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/ia64/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/ia64/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -65,4 +65,7 @@ void call_initfini_pointer(const struct extern void *__tls_get_addr(unsigned long module, unsigned long offset); +#define RTLD_DEFAULT_STACK_PF_EXEC 0 +#define RTLD_DEFAULT_STACK_EXEC 0 + #endif Modified: head/libexec/rtld-elf/map_object.c ============================================================================== --- head/libexec/rtld-elf/map_object.c Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/map_object.c Tue Jan 25 21:12:31 2011 (r217851) @@ -101,7 +101,7 @@ map_object(int fd, const char *path, con phdyn = phinterp = phtls = NULL; phdr_vaddr = 0; segs = alloca(sizeof(segs[0]) * hdr->e_phnum); - stack_flags = PF_X | PF_R | PF_W; + stack_flags = RTLD_DEFAULT_STACK_PF_EXEC | PF_R | PF_W; while (phdr < phlimit) { switch (phdr->p_type) { Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -69,4 +69,7 @@ void _rtld_bind_start(void); extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/powerpc/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/powerpc/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -84,4 +84,7 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/powerpc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/powerpc64/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/powerpc64/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -76,4 +76,7 @@ typedef struct { extern void *__tls_get_addr(tls_index* ti); +#define RTLD_DEFAULT_STACK_PF_EXEC PF_X +#define RTLD_DEFAULT_STACK_EXEC PROT_EXEC + #endif Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/rtld.c Tue Jan 25 21:12:31 2011 (r217851) @@ -191,7 +191,7 @@ extern Elf_Dyn _DYNAMIC; int osreldate, pagesize; -static int stack_prot = PROT_READ | PROT_WRITE | PROT_EXEC; +static int stack_prot = PROT_READ | PROT_WRITE | RTLD_DEFAULT_STACK_EXEC; static int max_stack_flags; /* Modified: head/libexec/rtld-elf/sparc64/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/sparc64/rtld_machdep.h Tue Jan 25 21:06:49 2011 (r217850) +++ head/libexec/rtld-elf/sparc64/rtld_machdep.h Tue Jan 25 21:12:31 2011 (r217851) @@ -65,4 +65,7 @@ typedef struct { extern void *__tls_get_addr(tls_index *ti); +#define RTLD_DEFAULT_STACK_PF_EXEC 0 +#define RTLD_DEFAULT_STACK_EXEC 0 + #endif From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:42:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DB0E106566C; Tue, 25 Jan 2011 21:42:06 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 434D18FC1B; Tue, 25 Jan 2011 21:42:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PLg6I0051681; Tue, 25 Jan 2011 21:42:06 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PLg6uC051679; Tue, 25 Jan 2011 21:42:06 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101252142.p0PLg6uC051679@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 25 Jan 2011 21:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-svnadmin@freebsd.org X-SVN-Group: svnadmin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217852 - svnadmin/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:42:06 -0000 Author: kib Date: Tue Jan 25 21:42:05 2011 New Revision: 217852 URL: http://svn.freebsd.org/changeset/base/217852 Log: Free dchagin Modified: svnadmin/conf/mentors Modified: svnadmin/conf/mentors ============================================================================== --- svnadmin/conf/mentors Tue Jan 25 21:12:31 2011 (r217851) +++ svnadmin/conf/mentors Tue Jan 25 21:42:05 2011 (r217852) @@ -13,7 +13,6 @@ anchie bz andreast nwhitehorn andrew imp -dchagin kib eri mlaier Co-mentor: thompsa gabor delphij hselasky thompsa From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:45:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B759F1065670; Tue, 25 Jan 2011 21:45:00 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A024D8FC1A; Tue, 25 Jan 2011 21:45:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PLj0jL051807; Tue, 25 Jan 2011 21:45:00 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PLj0TI051805; Tue, 25 Jan 2011 21:45:00 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252145.p0PLj0TI051805@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 21:45:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217853 - stable/8/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:45:00 -0000 Author: jilles Date: Tue Jan 25 21:45:00 2011 New Revision: 217853 URL: http://svn.freebsd.org/changeset/base/217853 Log: MFC r217484: mknod(2): The required include is , not . This is what SUSv4 requires, and also the only thing that works if strict standards compliance is requested or mknodat() is needed. PR: standards/123688 Submitted by: gcooper Modified: stable/8/lib/libc/sys/mknod.2 Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/sys/mknod.2 ============================================================================== --- stable/8/lib/libc/sys/mknod.2 Tue Jan 25 21:42:05 2011 (r217852) +++ stable/8/lib/libc/sys/mknod.2 Tue Jan 25 21:45:00 2011 (r217853) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -38,7 +38,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Ft int From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 21:51:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE9B110657C8; Tue, 25 Jan 2011 21:51:32 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DD9A68FC19; Tue, 25 Jan 2011 21:51:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PLpWmc052009; Tue, 25 Jan 2011 21:51:32 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PLpWYd052007; Tue, 25 Jan 2011 21:51:32 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252151.p0PLpWYd052007@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 21:51:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217854 - stable/7/lib/libc/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 21:51:33 -0000 Author: jilles Date: Tue Jan 25 21:51:32 2011 New Revision: 217854 URL: http://svn.freebsd.org/changeset/base/217854 Log: MFC r217484: mknod(2): The required include is , not . This is what SUSv4 requires, and also the only thing that works if strict standards compliance is requested. PR: standards/123688 Submitted by: gcooper Modified: stable/7/lib/libc/sys/mknod.2 Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/sys/mknod.2 ============================================================================== --- stable/7/lib/libc/sys/mknod.2 Tue Jan 25 21:45:00 2011 (r217853) +++ stable/7/lib/libc/sys/mknod.2 Tue Jan 25 21:51:32 2011 (r217854) @@ -28,7 +28,7 @@ .\" @(#)mknod.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 16, 2011 .Dt MKNOD 2 .Os .Sh NAME @@ -37,7 +37,7 @@ .Sh LIBRARY .Lb libc .Sh SYNOPSIS -.In unistd.h +.In sys/stat.h .Ft int .Fn mknod "const char *path" "mode_t mode" "dev_t dev" .Sh DESCRIPTION From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:08:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8894C106566B; Tue, 25 Jan 2011 22:08:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74EDA8FC25; Tue, 25 Jan 2011 22:08:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PM8Mnb052677; Tue, 25 Jan 2011 22:08:22 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PM8MKX052666; Tue, 25 Jan 2011 22:08:22 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252208.p0PM8MKX052666@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 22:08:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217855 - in stable/8/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:08:22 -0000 Author: jhb Date: Tue Jan 25 22:08:22 2011 New Revision: 217855 URL: http://svn.freebsd.org/changeset/base/217855 Log: MFC 214835: Adjust the order of operations in spinlock_enter() and spinlock_exit() to work properly with single-stepping in a kernel debugger. Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/arm/arm/machdep.c stable/8/sys/i386/i386/machdep.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/mips/mips/machdep.c stable/8/sys/pc98/pc98/machdep.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sun4v/sun4v/machdep.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c ============================================================================== --- stable/8/sys/amd64/amd64/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/amd64/amd64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -1757,11 +1757,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -1769,12 +1773,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } /* Modified: stable/8/sys/arm/arm/machdep.c ============================================================================== --- stable/8/sys/arm/arm/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/arm/arm/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -493,11 +493,15 @@ void spinlock_enter(void) { struct thread *td; + register_t cspr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_cspr = disable_interrupts(I32_bit | F32_bit); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + cspr = disable_interrupts(I32_bit | F32_bit); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_cspr = cspr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -505,12 +509,14 @@ void spinlock_exit(void) { struct thread *td; + register_t cspr; td = curthread; critical_exit(); + cspr = td->td_md.md_saved_cspr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - restore_interrupts(td->td_md.md_saved_cspr); + restore_interrupts(cspr); } /* Modified: stable/8/sys/i386/i386/machdep.c ============================================================================== --- stable/8/sys/i386/i386/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/i386/i386/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -2981,11 +2981,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2993,12 +2997,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/8/sys/ia64/ia64/machdep.c ============================================================================== --- stable/8/sys/ia64/ia64/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/ia64/ia64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -512,11 +512,15 @@ void spinlock_enter(void) { struct thread *td; + int intr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_intr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + intr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_intr = intr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -524,12 +528,14 @@ void spinlock_exit(void) { struct thread *td; + int intr; td = curthread; critical_exit(); + intr = td->td_md.md_saved_intr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_intr); + intr_restore(intr); } void Modified: stable/8/sys/mips/mips/machdep.c ============================================================================== --- stable/8/sys/mips/mips/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/mips/mips/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -449,11 +449,15 @@ void spinlock_enter(void) { struct thread *td; + register_t intr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_intr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + intr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_intr = intr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -461,12 +465,14 @@ void spinlock_exit(void) { struct thread *td; + register_t intr; td = curthread; critical_exit(); + intr = td->td_md.md_saved_intr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_intr); + intr_restore(intr); } /* Modified: stable/8/sys/pc98/pc98/machdep.c ============================================================================== --- stable/8/sys/pc98/pc98/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/pc98/pc98/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -2312,11 +2312,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2324,12 +2328,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/8/sys/powerpc/aim/machdep.c ============================================================================== --- stable/8/sys/powerpc/aim/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/powerpc/aim/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -704,11 +704,15 @@ void spinlock_enter(void) { struct thread *td; + register_t msr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_msr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + msr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_msr = msr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -716,12 +720,14 @@ void spinlock_exit(void) { struct thread *td; + register_t msr; td = curthread; critical_exit(); + msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_msr); + intr_restore(msr); } /* Modified: stable/8/sys/powerpc/booke/machdep.c ============================================================================== --- stable/8/sys/powerpc/booke/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/powerpc/booke/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -553,11 +553,15 @@ void spinlock_enter(void) { struct thread *td; + register_t msr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_msr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + msr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_msr = msr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -565,12 +569,14 @@ void spinlock_exit(void) { struct thread *td; + register_t msr; td = curthread; critical_exit(); + msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_msr); + intr_restore(msr); } /* Shutdown the CPU as much as possible. */ Modified: stable/8/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/8/sys/sparc64/sparc64/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/sparc64/sparc64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -223,9 +223,10 @@ spinlock_enter(void) if (td->td_md.md_spinlock_count == 0) { pil = rdpr(pil); wrpr(pil, 0, PIL_TICK); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -233,12 +234,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - wrpr(pil, td->td_md.md_saved_pil, 0); + wrpr(pil, pil, 0); } static phandle_t Modified: stable/8/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/8/sys/sun4v/sun4v/machdep.c Tue Jan 25 21:51:32 2011 (r217854) +++ stable/8/sys/sun4v/sun4v/machdep.c Tue Jan 25 22:08:22 2011 (r217855) @@ -268,9 +268,10 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) { pil = intr_disable(); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -278,14 +279,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) { - intr_restore(td->td_md.md_saved_pil); - } - + if (td->td_md.md_spinlock_count == 0) + intr_restore(pil); } unsigned From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:08:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1098E1065696; Tue, 25 Jan 2011 22:08:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F19098FC36; Tue, 25 Jan 2011 22:08:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PM8hMp052747; Tue, 25 Jan 2011 22:08:43 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PM8hN7052738; Tue, 25 Jan 2011 22:08:43 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252208.p0PM8hN7052738@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 22:08:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217856 - in stable/7/sys: amd64/amd64 arm/arm i386/i386 ia64/ia64 pc98/pc98 powerpc/powerpc sparc64/sparc64 sun4v/sun4v X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:08:44 -0000 Author: jhb Date: Tue Jan 25 22:08:43 2011 New Revision: 217856 URL: http://svn.freebsd.org/changeset/base/217856 Log: MFC 214835: Adjust the order of operations in spinlock_enter() and spinlock_exit() to work properly with single-stepping in a kernel debugger. Modified: stable/7/sys/amd64/amd64/machdep.c stable/7/sys/arm/arm/machdep.c stable/7/sys/i386/i386/machdep.c stable/7/sys/ia64/ia64/machdep.c stable/7/sys/pc98/pc98/machdep.c stable/7/sys/powerpc/powerpc/machdep.c stable/7/sys/sparc64/sparc64/machdep.c stable/7/sys/sun4v/sun4v/machdep.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/amd64/machdep.c ============================================================================== --- stable/7/sys/amd64/amd64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/amd64/amd64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -1405,11 +1405,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -1417,12 +1421,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } /* Modified: stable/7/sys/arm/arm/machdep.c ============================================================================== --- stable/7/sys/arm/arm/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/arm/arm/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -475,11 +475,15 @@ void spinlock_enter(void) { struct thread *td; + register_t cspr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_cspr = disable_interrupts(I32_bit | F32_bit); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + cspr = disable_interrupts(I32_bit | F32_bit); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_cspr = cspr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -487,12 +491,14 @@ void spinlock_exit(void) { struct thread *td; + register_t cspr; td = curthread; critical_exit(); + cspr = td->td_md.md_saved_cspr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - restore_interrupts(td->td_md.md_saved_cspr); + restore_interrupts(cspr); } /* Modified: stable/7/sys/i386/i386/machdep.c ============================================================================== --- stable/7/sys/i386/i386/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/i386/i386/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -2440,11 +2440,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2452,12 +2456,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/7/sys/ia64/ia64/machdep.c ============================================================================== --- stable/7/sys/ia64/ia64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/ia64/ia64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -410,11 +410,15 @@ void spinlock_enter(void) { struct thread *td; + int intr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_intr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + intr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_intr = intr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -422,12 +426,14 @@ void spinlock_exit(void) { struct thread *td; + int intr; td = curthread; critical_exit(); + intr = td->td_md.md_saved_intr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_intr); + intr_restore(intr); } void Modified: stable/7/sys/pc98/pc98/machdep.c ============================================================================== --- stable/7/sys/pc98/pc98/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/pc98/pc98/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -2179,11 +2179,15 @@ void spinlock_enter(void) { struct thread *td; + register_t flags; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_flags = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + flags = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_flags = flags; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -2191,12 +2195,14 @@ void spinlock_exit(void) { struct thread *td; + register_t flags; td = curthread; critical_exit(); + flags = td->td_md.md_saved_flags; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_flags); + intr_restore(flags); } #if defined(I586_CPU) && !defined(NO_F00F_HACK) Modified: stable/7/sys/powerpc/powerpc/machdep.c ============================================================================== --- stable/7/sys/powerpc/powerpc/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/powerpc/powerpc/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -942,11 +942,15 @@ void spinlock_enter(void) { struct thread *td; + register_t msr; td = curthread; - if (td->td_md.md_spinlock_count == 0) - td->td_md.md_saved_msr = intr_disable(); - td->td_md.md_spinlock_count++; + if (td->td_md.md_spinlock_count == 0) { + msr = intr_disable(); + td->td_md.md_spinlock_count = 1; + td->td_md.md_saved_msr = msr; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -954,12 +958,14 @@ void spinlock_exit(void) { struct thread *td; + register_t msr; td = curthread; critical_exit(); + msr = td->td_md.md_saved_msr; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - intr_restore(td->td_md.md_saved_msr); + intr_restore(msr); } /* Modified: stable/7/sys/sparc64/sparc64/machdep.c ============================================================================== --- stable/7/sys/sparc64/sparc64/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/sparc64/sparc64/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -222,9 +222,10 @@ spinlock_enter(void) if (td->td_md.md_spinlock_count == 0) { pil = rdpr(pil); wrpr(pil, 0, PIL_TICK); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -232,12 +233,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; if (td->td_md.md_spinlock_count == 0) - wrpr(pil, td->td_md.md_saved_pil, 0); + wrpr(pil, pil, 0); } static phandle_t Modified: stable/7/sys/sun4v/sun4v/machdep.c ============================================================================== --- stable/7/sys/sun4v/sun4v/machdep.c Tue Jan 25 22:08:22 2011 (r217855) +++ stable/7/sys/sun4v/sun4v/machdep.c Tue Jan 25 22:08:43 2011 (r217856) @@ -267,9 +267,10 @@ spinlock_enter(void) td = curthread; if (td->td_md.md_spinlock_count == 0) { pil = intr_disable(); + td->td_md.md_spinlock_count = 1; td->td_md.md_saved_pil = pil; - } - td->td_md.md_spinlock_count++; + } else + td->td_md.md_spinlock_count++; critical_enter(); } @@ -277,14 +278,14 @@ void spinlock_exit(void) { struct thread *td; + register_t pil; td = curthread; critical_exit(); + pil = td->td_md.md_saved_pil; td->td_md.md_spinlock_count--; - if (td->td_md.md_spinlock_count == 0) { - intr_restore(td->td_md.md_saved_pil); - } - + if (td->td_md.md_spinlock_count == 0) + intr_restore(pil); } unsigned From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:18:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3357B106564A; Tue, 25 Jan 2011 22:18:01 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 222848FC14; Tue, 25 Jan 2011 22:18:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PMI1MY053827; Tue, 25 Jan 2011 22:18:01 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PMI1cb053824; Tue, 25 Jan 2011 22:18:01 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101252218.p0PMI1cb053824@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 25 Jan 2011 22:18:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217857 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:18:01 -0000 Author: yongari Date: Tue Jan 25 22:18:00 2011 New Revision: 217857 URL: http://svn.freebsd.org/changeset/base/217857 Log: Prefer MSI-X to MSI on controllers that support MSI-X. All recent PCIe controllers(RTL8102E or later and RTL8168/8111C or later) supports either 2 or 4 MSI-X messages. Unfortunately vendor did not publicly release RSS related information yet. However switching to MSI-X is one-step forward to support RSS. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 25 22:08:43 2011 (r217856) +++ head/sys/dev/re/if_re.c Tue Jan 25 22:18:00 2011 (r217857) @@ -159,6 +159,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); /* Tunables. */ static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); +static int msix_disable = 0; +TUNABLE_INT("hw.re.msix_disable", &msix_disable); static int prefer_iomap = 0; TUNABLE_INT("hw.re.prefer_iomap", &prefer_iomap); @@ -1176,7 +1178,7 @@ re_attach(device_t dev) int hwrev; u_int16_t devid, re_did = 0; int error = 0, i, phy, rid; - int msic, reg; + int msic, msixc, reg; uint8_t cfg; sc = device_get_softc(dev); @@ -1226,18 +1228,51 @@ re_attach(device_t dev) sc->rl_btag = rman_get_bustag(sc->rl_res); sc->rl_bhandle = rman_get_bushandle(sc->rl_res); - msic = 0; - if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) { + msic = pci_msi_count(dev); + msixc = pci_msix_count(dev); + if (pci_find_extcap(dev, PCIY_EXPRESS, ®) == 0) sc->rl_flags |= RL_FLAG_PCIE; - msic = pci_msi_count(dev); - if (bootverbose) - device_printf(dev, "MSI count : %d\n", msic); + if (bootverbose) { + device_printf(dev, "MSI count : %d\n", msic); + device_printf(dev, "MSI-X count : %d\n", msixc); + } + if (msix_disable > 0) + msixc = 0; + if (msi_disable > 0) + msic = 0; + /* Prefer MSI-X to MSI. */ + if (msixc > 0) { + msixc = 1; + rid = PCIR_BAR(4); + sc->rl_res_pba = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &rid, RF_ACTIVE); + if (sc->rl_res_pba == NULL) { + device_printf(sc->rl_dev, + "could not allocate MSI-X PBA resource\n"); + } + if (sc->rl_res_pba != NULL && + pci_alloc_msix(dev, &msixc) == 0) { + if (msixc == 1) { + device_printf(dev, "Using %d MSI-X message\n", + msixc); + sc->rl_flags |= RL_FLAG_MSIX; + } else + pci_release_msi(dev); + } + if ((sc->rl_flags & RL_FLAG_MSIX) == 0) { + if (sc->rl_res_pba != NULL) + bus_release_resource(dev, SYS_RES_MEMORY, rid, + sc->rl_res_pba); + sc->rl_res_pba = NULL; + msixc = 0; + } } - if (msic > 0 && msi_disable == 0) { + /* Prefer MSI to INTx. */ + if (msixc == 0 && msic > 0) { msic = 1; if (pci_alloc_msi(dev, &msic) == 0) { if (msic == RL_MSI_MESSAGES) { - device_printf(dev, "Using %d MSI messages\n", + device_printf(dev, "Using %d MSI message\n", msic); sc->rl_flags |= RL_FLAG_MSI; /* Explicitly set MSI enable bit. */ @@ -1249,10 +1284,12 @@ re_attach(device_t dev) } else pci_release_msi(dev); } + if ((sc->rl_flags & RL_FLAG_MSI) == 0) + msic = 0; } /* Allocate interrupt */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { rid = 0; sc->rl_irq[0] = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); @@ -1539,7 +1576,7 @@ re_attach(device_t dev) #endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & RL_FLAG_MSI) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); @@ -1631,7 +1668,7 @@ re_detach(device_t dev) } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & RL_FLAG_MSI) == 0) { + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { if (sc->rl_irq[0] != NULL) { bus_release_resource(dev, SYS_RES_IRQ, 0, sc->rl_irq[0]); @@ -1647,6 +1684,10 @@ re_detach(device_t dev) } pci_release_msi(dev); } + if (sc->rl_res_pba) { + rid = PCIR_BAR(4); + bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); + } if (sc->rl_res) bus_release_resource(dev, sc->rl_res_type, sc->rl_res_id, sc->rl_res); Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Jan 25 22:08:43 2011 (r217856) +++ head/sys/pci/if_rlreg.h Tue Jan 25 22:18:00 2011 (r217857) @@ -864,6 +864,7 @@ struct rl_softc { struct resource *rl_res; int rl_res_id; int rl_res_type; + struct resource *rl_res_pba; struct resource *rl_irq[RL_MSI_MESSAGES]; void *rl_intrhand[RL_MSI_MESSAGES]; device_t rl_miibus; @@ -908,6 +909,7 @@ struct rl_softc { #define RL_FLAG_FASTETHER 0x0100 #define RL_FLAG_CMDSTOP 0x0200 #define RL_FLAG_MACRESET 0x0400 +#define RL_FLAG_MSIX 0x0800 #define RL_FLAG_WOLRXENB 0x1000 #define RL_FLAG_MACSLEEP 0x2000 #define RL_FLAG_PCIE 0x4000 From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:21:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C36D8106564A; Tue, 25 Jan 2011 22:21:05 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B354D8FC12; Tue, 25 Jan 2011 22:21:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PML5vO054172; Tue, 25 Jan 2011 22:21:05 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PML59n054170; Tue, 25 Jan 2011 22:21:05 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101252221.p0PML59n054170@svn.freebsd.org> From: John Baldwin Date: Tue, 25 Jan 2011 22:21:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217858 - head/usr.bin/csup X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:21:05 -0000 Author: jhb Date: Tue Jan 25 22:21:05 2011 New Revision: 217858 URL: http://svn.freebsd.org/changeset/base/217858 Log: Remove dead code. MFC after: 2 weeks Modified: head/usr.bin/csup/updater.c Modified: head/usr.bin/csup/updater.c ============================================================================== --- head/usr.bin/csup/updater.c Tue Jan 25 22:18:00 2011 (r217857) +++ head/usr.bin/csup/updater.c Tue Jan 25 22:21:05 2011 (r217858) @@ -770,7 +770,6 @@ updater_docoll(struct updater *up, struc if (sr->sr_serverattr == NULL) return (UPDATER_ERR_PROTO); - error = 0; error = updater_rcsedit(up, fup, name, rcsopt); if (error) return (error); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:25:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 113AF1065670; Tue, 25 Jan 2011 22:25:17 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00C2A8FC19; Tue, 25 Jan 2011 22:25:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PMPGve054499; Tue, 25 Jan 2011 22:25:16 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PMPGS7054496; Tue, 25 Jan 2011 22:25:16 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201101252225.p0PMPGS7054496@svn.freebsd.org> From: Martin Cracauer Date: Tue, 25 Jan 2011 22:25:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217859 - head/sbin/iscontrol X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:25:17 -0000 Author: cracauer Date: Tue Jan 25 22:25:16 2011 New Revision: 217859 URL: http://svn.freebsd.org/changeset/base/217859 Log: Fix compilation with debug on. Fix segfault when TargetAddress is missing or mis-spelled in config file. Modified: head/sbin/iscontrol/config.c head/sbin/iscontrol/fsm.c Modified: head/sbin/iscontrol/config.c ============================================================================== --- head/sbin/iscontrol/config.c Tue Jan 25 22:21:05 2011 (r217858) +++ head/sbin/iscontrol/config.c Tue Jan 25 22:25:16 2011 (r217859) @@ -295,7 +295,7 @@ keyLookup(char *key) { textkey_t *tk; - for(tk = keyMap; tk->name; tk++) { + for(tk = keyMap; tk->name && strcmp(tk->name, "end"); tk++) { if(strcasecmp(key, tk->name) == 0) return tk; } Modified: head/sbin/iscontrol/fsm.c ============================================================================== --- head/sbin/iscontrol/fsm.c Tue Jan 25 22:21:05 2011 (r217858) +++ head/sbin/iscontrol/fsm.c Tue Jan 25 22:25:16 2011 (r217859) @@ -359,8 +359,8 @@ doCAM(isess_t *sess) | for now will do this for each lun ... */ for(n = i = 0; i < sess->cam.target_nluns; i++) { - debug(2, "CAM path_id=%d target_id=%d target_lun=%d", - sess->cam.path_id, sess->cam.target_id, sess->cam.target_lun[i]); + debug(2, "CAM path_id=%d target_id=%d", + sess->cam.path_id, sess->cam.target_id); sess->camdev = cam_open_btl(sess->cam.path_id, sess->cam.target_id, i, O_RDWR, NULL); From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:25:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E1018106566C; Tue, 25 Jan 2011 22:25:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0B7D8FC25; Tue, 25 Jan 2011 22:25:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PMPo8W054603; Tue, 25 Jan 2011 22:25:50 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PMPo2T054601; Tue, 25 Jan 2011 22:25:50 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101252225.p0PMPo2T054601@svn.freebsd.org> From: Jack F Vogel Date: Tue, 25 Jan 2011 22:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217860 - releng/8.2/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:25:51 -0000 Author: jfv Date: Tue Jan 25 22:25:50 2011 New Revision: 217860 URL: http://svn.freebsd.org/changeset/base/217860 Log: MFC stable/8 r217710 - Pieces of the failure path in em_xmit got deleted along the way, correct this. - local_timer had a leftover TX_UNLOCK without matching LOCK in the error path, remove it. Approved by: re (bz) Modified: releng/8.2/sys/dev/e1000/if_em.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/e1000/if_em.c ============================================================================== --- releng/8.2/sys/dev/e1000/if_em.c Tue Jan 25 22:25:16 2011 (r217859) +++ releng/8.2/sys/dev/e1000/if_em.c Tue Jan 25 22:25:50 2011 (r217860) @@ -93,7 +93,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.1.8"; +char em_driver_version[] = "7.1.9"; /********************************************************************* * PCI Device ID Table @@ -1909,14 +1909,23 @@ em_xmit(struct tx_ring *txr, struct mbuf error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { + if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); + } else if (error != 0) { adapter->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } + + } else if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); } else if (error != 0) { adapter->no_tx_dma_setup++; + m_freem(*m_headp); + *m_headp = NULL; return (error); } @@ -2206,7 +2215,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - EM_TX_UNLOCK(txr); em_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:35:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6163106564A; Tue, 25 Jan 2011 22:35:35 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D47CC8FC13; Tue, 25 Jan 2011 22:35:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PMZZfo054864; Tue, 25 Jan 2011 22:35:35 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PMZZJW054860; Tue, 25 Jan 2011 22:35:35 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <201101252235.p0PMZZJW054860@svn.freebsd.org> From: Andrew Thompson Date: Tue, 25 Jan 2011 22:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217861 - releng/8.2/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:35:36 -0000 Author: thompsa Date: Tue Jan 25 22:35:35 2011 New Revision: 217861 URL: http://svn.freebsd.org/changeset/base/217861 Log: MFC r203134,r207990,r217289,r203135 Add manpages for run(4) and runfw(4). Approved by: re (kib) Added: releng/8.2/share/man/man4/run.4 - copied, changed from r203134, head/share/man/man4/run.4 releng/8.2/share/man/man4/runfw.4 - copied unchanged from r217289, head/share/man/man4/runfw.4 Modified: releng/8.2/share/man/man4/Makefile Directory Properties: releng/8.2/share/man/man4/ (props changed) Modified: releng/8.2/share/man/man4/Makefile ============================================================================== --- releng/8.2/share/man/man4/Makefile Tue Jan 25 22:25:50 2011 (r217860) +++ releng/8.2/share/man/man4/Makefile Tue Jan 25 22:35:35 2011 (r217861) @@ -338,6 +338,8 @@ MAN= aac.4 \ rp.4 \ rue.4 \ rum.4 \ + run.4 \ + runfw.4 \ sa.4 \ safe.4 \ sbp.4 \ Copied and modified: releng/8.2/share/man/man4/run.4 (from r203134, head/share/man/man4/run.4) ============================================================================== --- head/share/man/man4/run.4 Thu Jan 28 22:24:54 2010 (r203134, copy source) +++ releng/8.2/share/man/man4/run.4 Tue Jan 25 22:35:35 2011 (r217861) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 29, 2010 +.Dd January 12, 2011 .Os .Dt RUN 4 .Sh NAME @@ -36,11 +36,17 @@ kernel configuration file: .Cd "device wlan_amrr" .Ed .Pp +Firmware is also needed, and provided by: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp Alternatively, to load the driver as a -module at boot time, place the following line in +module at boot time, place the following lines in .Xr loader.conf 5 : .Bd -literal -offset indent if_run_load="YES" +runfw_load="YES" .Ed .Sh DESCRIPTION The @@ -68,6 +74,9 @@ Also known as mode, this is used when associating with an access point, through which all traffic passes. This mode is the default. +.It Host AP mode +In this mode the driver acts as an access point (base station) +for other cards. .It monitor mode In this mode the driver is able to receive packets without associating with an access point. @@ -94,11 +103,11 @@ hardware for the WEP40, WEP104, TKIP(+MI The .Nm driver can be configured at runtime with -.Xr ifconfig 8 -or on boot with -.Xr hostname.if 5 . +.Xr ifconfig 8 . .Sh HARDWARE -The following adapters should work: +The +.Nm +driver supports the following wireless adapters: .Pp .Bl -tag -width Ds -offset indent -compact .It Airlink101 AWLL6090 @@ -174,7 +183,7 @@ ifconfig wlan create wlandev run0 wlanmo .Ed .Sh DIAGNOSTICS .Bl -diag -.It "run%d: error %d, could not read firmware %s" +.It "run%d: faild load firmware of file runfw" For some reason, the driver was unable to read the microcode file from the filesystem. The file might be missing or corrupted. @@ -187,6 +196,7 @@ The driver will reset the hardware. This should not happen. .El .Sh SEE ALSO +.Xr runfw 4 , .Xr intro 4 , .Xr netintro 4 , .Xr usb 4 , Copied: releng/8.2/share/man/man4/runfw.4 (from r217289, head/share/man/man4/runfw.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ releng/8.2/share/man/man4/runfw.4 Tue Jan 25 22:35:35 2011 (r217861, copy of r217289, head/share/man/man4/runfw.4) @@ -0,0 +1,50 @@ +.\" Copyright (c) 2010 Akinori Furukoshi +.\" Copyright (c) 2010 Warren Block +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd January 12, 2011 +.Dt RUNFW 4 +.Os +.Sh NAME +.Nm runfw +.Nd "Firmware Module for Ralink driver" +.Sh SYNOPSIS +To compile this module into the kernel, place the following line in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device runfw" +.Ed +.Pp +This will include two firmware images, RT2870 and RT3071, inside the kernel. +.Xr run 4 +will load the appropriate image into the chip. +.Pp +Alternatively, to load the firmware images as a module at boot time, place +the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +runfw_load="YES" +.Ed +.Sh DESCRIPTION +This module provides firmware sets for the Ralink RT2700U, +RT2800U and RT3000U chip based USB WiFi adapters. +Please read Ralink's license, src/sys/contrib/dev/run/LICENSE. +.Sh SEE ALSO +.Xr run 4 , +.Xr firmware 9 From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 22:55:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE1101065675; Tue, 25 Jan 2011 22:55:50 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A349A8FC21; Tue, 25 Jan 2011 22:55:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PMtotD055342; Tue, 25 Jan 2011 22:55:50 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PMto4h055340; Tue, 25 Jan 2011 22:55:50 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101252255.p0PMto4h055340@svn.freebsd.org> From: Jack F Vogel Date: Tue, 25 Jan 2011 22:55:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217862 - releng/7.4/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 22:55:50 -0000 Author: jfv Date: Tue Jan 25 22:55:50 2011 New Revision: 217862 URL: http://svn.freebsd.org/changeset/base/217862 Log: MFC stable/7 r217723 - Pieces of the failure path in em_xmit got mangled, correct it. - local_timer had a leftover TX_UNLOCK without a matching TX_LOCK in the error path, remove it. Approved by: re (bz) Modified: releng/7.4/sys/dev/e1000/if_em.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/e1000/if_em.c ============================================================================== --- releng/7.4/sys/dev/e1000/if_em.c Tue Jan 25 22:35:35 2011 (r217861) +++ releng/7.4/sys/dev/e1000/if_em.c Tue Jan 25 22:55:50 2011 (r217862) @@ -90,7 +90,7 @@ int em_display_debug_stats = 0; /********************************************************************* * Driver version: *********************************************************************/ -char em_driver_version[] = "7.1.8"; +char em_driver_version[] = "7.1.9"; /********************************************************************* * PCI Device ID Table @@ -1788,14 +1788,23 @@ em_xmit(struct tx_ring *txr, struct mbuf error = bus_dmamap_load_mbuf_sg(txr->txtag, map, *m_headp, segs, &nsegs, BUS_DMA_NOWAIT); - if (error) { + if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); + } else if (error != 0) { adapter->no_tx_dma_setup++; m_freem(*m_headp); *m_headp = NULL; return (error); } + + } else if (error == ENOMEM) { + adapter->no_tx_dma_setup++; + return (error); } else if (error != 0) { adapter->no_tx_dma_setup++; + m_freem(*m_headp); + *m_headp = NULL; return (error); } @@ -2077,7 +2086,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - EM_TX_UNLOCK(txr); em_init_locked(adapter); } From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:02:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 48E2E106564A; Tue, 25 Jan 2011 23:02:26 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1CCE58FC16; Tue, 25 Jan 2011 23:02:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PN2QV1055535; Tue, 25 Jan 2011 23:02:26 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PN2PKk055533; Tue, 25 Jan 2011 23:02:26 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252302.p0PN2PKk055533@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 23:02:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217863 - stable/8/usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:02:26 -0000 Author: jilles Date: Tue Jan 25 23:02:25 2011 New Revision: 217863 URL: http://svn.freebsd.org/changeset/base/217863 Log: MFC r217133: sed: Try hard links to make -i target available continually. When creating a backup file, sed renamed the original before renaming the changed copy into place, leading to a short time when no file with the original name was present (usually only visible on SMP systems). Try creating the backup file using a hard link instead, avoiding this problem. If creating the hard link fails for any reason, fall back to the old rename method. When not creating a backup file, sed already renamed the changed copy onto the original. This remains unchanged. PR: bin/153261 Submitted by: Pedro F. Giffuni Reviewed by: dds (older version) Obtained from: Illumos Modified: stable/8/usr.bin/sed/main.c Directory Properties: stable/8/usr.bin/sed/ (props changed) Modified: stable/8/usr.bin/sed/main.c ============================================================================== --- stable/8/usr.bin/sed/main.c Tue Jan 25 22:55:50 2011 (r217862) +++ stable/8/usr.bin/sed/main.c Tue Jan 25 23:02:25 2011 (r217863) @@ -338,18 +338,35 @@ mf_fgets(SPACE *sp, enum e_spflag spflag if (infile != NULL) { fclose(infile); if (*oldfname != '\0') { - if (rename(fname, oldfname) != 0) { + /* if there was a backup file, remove it */ + unlink(oldfname); + /* + * Backup the original. Note that hard links + * are not supported on all filesystems. + */ + if ((link(fname, oldfname) != 0) && + (rename(fname, oldfname) != 0)) { warn("rename()"); - unlink(tmpfname); + if (*tmpfname) + unlink(tmpfname); exit(1); } *oldfname = '\0'; } if (*tmpfname != '\0') { if (outfile != NULL && outfile != stdout) - fclose(outfile); + if (fclose(outfile) != 0) { + warn("fclose()"); + unlink(tmpfname); + exit(1); + } outfile = NULL; - rename(tmpfname, fname); + if (rename(tmpfname, fname) != 0) { + /* this should not happen really! */ + warn("rename()"); + unlink(tmpfname); + exit(1); + } *tmpfname = '\0'; } outfname = NULL; From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:02:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40E121065670; Tue, 25 Jan 2011 23:02:39 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id 24DBF8FC0A; Tue, 25 Jan 2011 23:02:38 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from sa-nc-common2-70.static.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp026.mac.com (Oracle Communications Messaging Exchange Server 7u4-20.01 64bit (built Nov 21 2010)) with ESMTPSA id <0LFL00CKBMJ4YV70@asmtp026.mac.com>; Tue, 25 Jan 2011 14:01:54 -0800 (PST) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2011-01-25_08:2011-01-25, 2011-01-25, 1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=2 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1012030000 definitions=main-1101250168 From: Marcel Moolenaar In-reply-to: <201101252112.p0PLCVDs050918@svn.freebsd.org> Date: Tue, 25 Jan 2011 14:01:52 -0800 Message-id: References: <201101252112.p0PLCVDs050918@svn.freebsd.org> To: Konstantin Belousov X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217851 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:02:39 -0000 On Jan 25, 2011, at 1:12 PM, Konstantin Belousov wrote: > Author: kib > Date: Tue Jan 25 21:12:31 2011 > New Revision: 217851 > URL: http://svn.freebsd.org/changeset/base/217851 > > Log: > When loading dso without PT_GNU_STACK phdr, only call > __pthread_map_stacks_exec() on architectures that allow executable > stacks. Thanks for all the fixes! -- Marcel Moolenaar xcllnt@mac.com From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:04:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ACFD1065670; Tue, 25 Jan 2011 23:04:57 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 78C338FC0C; Tue, 25 Jan 2011 23:04:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PN4vsv055654; Tue, 25 Jan 2011 23:04:57 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PN4voO055651; Tue, 25 Jan 2011 23:04:57 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101252304.p0PN4voO055651@svn.freebsd.org> From: Jilles Tjoelker Date: Tue, 25 Jan 2011 23:04:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217864 - stable/8/tools/regression/usr.bin/sed X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:04:57 -0000 Author: jilles Date: Tue Jan 25 23:04:57 2011 New Revision: 217864 URL: http://svn.freebsd.org/changeset/base/217864 Log: MFC r217134: sed: Add test for r217863 (-i race). r217863 is the MFC of r217133. PR: bin/153261 Added: stable/8/tools/regression/usr.bin/sed/inplace_race.t - copied unchanged from r217134, head/tools/regression/usr.bin/sed/inplace_race.t Modified: stable/8/tools/regression/usr.bin/sed/Makefile Directory Properties: stable/8/tools/regression/usr.bin/sed/ (props changed) Modified: stable/8/tools/regression/usr.bin/sed/Makefile ============================================================================== --- stable/8/tools/regression/usr.bin/sed/Makefile Tue Jan 25 23:02:25 2011 (r217863) +++ stable/8/tools/regression/usr.bin/sed/Makefile Tue Jan 25 23:04:57 2011 (r217864) @@ -3,3 +3,4 @@ all: @m4 ${.CURDIR}/../regress.m4 ${.CURDIR}/regress.sh | sh /dev/stdin ${.CURDIR} @sh multitest.t + @sh inplace_race.t Copied: stable/8/tools/regression/usr.bin/sed/inplace_race.t (from r217134, head/tools/regression/usr.bin/sed/inplace_race.t) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/tools/regression/usr.bin/sed/inplace_race.t Tue Jan 25 23:04:57 2011 (r217864, copy of r217134, head/tools/regression/usr.bin/sed/inplace_race.t) @@ -0,0 +1,83 @@ +#!/bin/sh + +#- +# Copyright (c) 2011 Jilles Tjoelker +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ + +: "${SED=sed}" + +# This test really needs an SMP system. On an UP system, it will +# usually pass even if the race condition exists. +if command -v cpuset >/dev/null; then + case `cpuset -g -p $$` in + *,*) ;; + *) + echo '1..0 # Skipped: not an SMP system' + exit 0 ;; + esac +fi + +echo "1..1" + +T=$(mktemp -d "${TMPDIR:-/tmp}/sed-test.XXXXXX") +trap 'cd /; rm -rf "$T"' 0 +cd "$T" + +data=abababab +data=$data$data$data$data +data=$data$data$data$data +data=$data$data$data$data +data=$data$data$data$data +data="BEGIN +$data +END" +for i in 0 1 2 3 4 5 6 7 8 9; do + echo "$data" >file$i +done +len=${#data} + +i=0 +while [ $i -lt 100 ]; do + ${SED} -i.prev "s/$i/ab/" file[0-9] + i=$((i+1)) +done & +sedproc=$! + +while :; do + set -- file[0-9] + if [ $# -ne 10 ]; then + echo "not ok 1 inplace_race" + exit 3 + fi +done & +checkproc=$! + +wait $sedproc +kill $checkproc 2>/dev/null +wait $checkproc >/dev/null 2>&1 +if [ $? -ne 3 ]; then + echo "ok 1 inplace_race" +fi From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:20:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 341821065674; Tue, 25 Jan 2011 23:20:23 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 235C48FC12; Tue, 25 Jan 2011 23:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PNKN9n056026; Tue, 25 Jan 2011 23:20:23 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PNKNsN056024; Tue, 25 Jan 2011 23:20:23 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101252320.p0PNKNsN056024@svn.freebsd.org> From: Jack F Vogel Date: Tue, 25 Jan 2011 23:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217865 - releng/8.2/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:20:23 -0000 Author: jfv Date: Tue Jan 25 23:20:22 2011 New Revision: 217865 URL: http://svn.freebsd.org/changeset/base/217865 Log: MFC stable/8 r217711 Fix for kern/152853, pullup in the wrong place in em_xmit causes UDP failure. Thanks to Petr Lampa for the patch. Approved by: re (bz) Modified: releng/8.2/sys/dev/e1000/if_em.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/e1000/if_em.c ============================================================================== --- releng/8.2/sys/dev/e1000/if_em.c Tue Jan 25 23:04:57 2011 (r217864) +++ releng/8.2/sys/dev/e1000/if_em.c Tue Jan 25 23:20:22 2011 (r217865) @@ -1820,12 +1820,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1849,6 +1849,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:23:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 472D51065670; Tue, 25 Jan 2011 23:23:46 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 366828FC13; Tue, 25 Jan 2011 23:23:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PNNk0L056145; Tue, 25 Jan 2011 23:23:46 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PNNk6B056143; Tue, 25 Jan 2011 23:23:46 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101252323.p0PNNk6B056143@svn.freebsd.org> From: Jack F Vogel Date: Tue, 25 Jan 2011 23:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217866 - releng/7.4/sys/dev/e1000 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:23:46 -0000 Author: jfv Date: Tue Jan 25 23:23:45 2011 New Revision: 217866 URL: http://svn.freebsd.org/changeset/base/217866 Log: MFC stable/7 r217724 Fix to kern/152853, misplaced pullup in em_xmit breaks UDP tx, thanks to Petr Lampa for the patch. Approved by: re (bz) Modified: releng/7.4/sys/dev/e1000/if_em.c Directory Properties: releng/7.4/sys/ (props changed) releng/7.4/sys/cddl/contrib/opensolaris/ (props changed) releng/7.4/sys/contrib/dev/acpica/ (props changed) releng/7.4/sys/contrib/pf/ (props changed) Modified: releng/7.4/sys/dev/e1000/if_em.c ============================================================================== --- releng/7.4/sys/dev/e1000/if_em.c Tue Jan 25 23:20:22 2011 (r217865) +++ releng/7.4/sys/dev/e1000/if_em.c Tue Jan 25 23:23:45 2011 (r217866) @@ -1699,12 +1699,12 @@ em_xmit(struct tx_ring *txr, struct mbuf } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: @@ -1728,6 +1728,11 @@ em_xmit(struct tx_ring *txr, struct mbuf tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:25:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C09A106564A; Tue, 25 Jan 2011 23:25:23 +0000 (UTC) (envelope-from scf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6063D8FC14; Tue, 25 Jan 2011 23:25:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PNPNm7056231; Tue, 25 Jan 2011 23:25:23 GMT (envelope-from scf@svn.freebsd.org) Received: (from scf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PNPNrg056228; Tue, 25 Jan 2011 23:25:23 GMT (envelope-from scf@svn.freebsd.org) Message-Id: <201101252325.p0PNPNrg056228@svn.freebsd.org> From: Sean Farley Date: Tue, 25 Jan 2011 23:25:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217867 - stable/8/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:25:23 -0000 Author: scf Date: Tue Jan 25 23:25:23 2011 New Revision: 217867 URL: http://svn.freebsd.org/changeset/base/217867 Log: Merge from head to stable/8: r216813: Fix the LINUX_SOUND_MIXER_INFO ioctl to return success after the information is set to FreeBSD. It had been falling through to the end of linux_ioctl_sound() and returning ENOIOCTL. Noticed when running the Linux ALSA amixer tool. Add a LINUX_SOUND_MIXER_READ_CAPS ioctl which is used by the Skype v2.1.0.81 binary. Reviewed by: gavin Modified: stable/8/sys/compat/linux/linux_ioctl.c stable/8/sys/compat/linux/linux_ioctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_ioctl.c ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.c Tue Jan 25 23:23:45 2011 (r217866) +++ stable/8/sys/compat/linux/linux_ioctl.c Tue Jan 25 23:25:23 2011 (r217867) @@ -1743,7 +1743,7 @@ linux_ioctl_sound(struct thread *td, str strncpy(info.id, "OSS", sizeof(info.id) - 1); strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); copyout(&info, (void *)args->arg, sizeof(info)); - break; + return (0); } case 0x0030: { /* SOUND_OLD_MIXER_INFO */ struct linux_old_mixer_info info; @@ -1751,7 +1751,7 @@ linux_ioctl_sound(struct thread *td, str strncpy(info.id, "OSS", sizeof(info.id) - 1); strncpy(info.name, "FreeBSD OSS Mixer", sizeof(info.name) - 1); copyout(&info, (void *)args->arg, sizeof(info)); - break; + return (0); } default: return (ENOIOCTL); @@ -1768,6 +1768,10 @@ linux_ioctl_sound(struct thread *td, str args->cmd = SOUND_MIXER_READ_STEREODEVS; return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_READ_CAPS: + args->cmd = SOUND_MIXER_READ_CAPS; + return (ioctl(td, (struct ioctl_args *)args)); + case LINUX_SOUND_MIXER_READ_RECMASK: args->cmd = SOUND_MIXER_READ_RECMASK; return (ioctl(td, (struct ioctl_args *)args)); Modified: stable/8/sys/compat/linux/linux_ioctl.h ============================================================================== --- stable/8/sys/compat/linux/linux_ioctl.h Tue Jan 25 23:23:45 2011 (r217866) +++ stable/8/sys/compat/linux/linux_ioctl.h Tue Jan 25 23:25:23 2011 (r217867) @@ -267,6 +267,7 @@ #define LINUX_SOUND_MIXER_INFO 0x4d65 #define LINUX_OSS_GETVERSION 0x4d76 #define LINUX_SOUND_MIXER_READ_STEREODEVS 0x4dfb +#define LINUX_SOUND_MIXER_READ_CAPS 0x4dfc #define LINUX_SOUND_MIXER_READ_RECMASK 0x4dfd #define LINUX_SOUND_MIXER_READ_DEVMASK 0x4dfe #define LINUX_SOUND_MIXER_WRITE_RECSRC 0x4dff From owner-svn-src-all@FreeBSD.ORG Tue Jan 25 23:27:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 16263106564A; Tue, 25 Jan 2011 23:27:29 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04F2A8FC08; Tue, 25 Jan 2011 23:27:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0PNRSbR056324; Tue, 25 Jan 2011 23:27:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0PNRSTq056321; Tue, 25 Jan 2011 23:27:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101252327.p0PNRSTq056321@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 25 Jan 2011 23:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217868 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jan 2011 23:27:29 -0000 Author: yongari Date: Tue Jan 25 23:27:28 2011 New Revision: 217868 URL: http://svn.freebsd.org/changeset/base/217868 Log: Remove TX taskqueue and directly invoke re_start in interrupt task. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Tue Jan 25 23:25:23 2011 (r217867) +++ head/sys/dev/re/if_re.c Tue Jan 25 23:27:28 2011 (r217868) @@ -254,9 +254,9 @@ static int re_poll_locked (struct ifnet #endif static int re_intr (void *); static void re_tick (void *); -static void re_tx_task (void *, int); static void re_int_task (void *, int); static void re_start (struct ifnet *); +static void re_start_locked (struct ifnet *); static int re_ioctl (struct ifnet *, u_long, caddr_t); static void re_init (void *); static void re_init_locked (struct rl_softc *); @@ -1524,7 +1524,6 @@ re_attach(device_t dev) ifp->if_snd.ifq_drv_maxlen = RL_IFQ_MAXLEN; IFQ_SET_READY(&ifp->if_snd); - TASK_INIT(&sc->rl_txtask, 1, re_tx_task, ifp); TASK_INIT(&sc->rl_inttask, 0, re_int_task, sc); /* @@ -1634,7 +1633,6 @@ re_detach(device_t dev) RL_UNLOCK(sc); callout_drain(&sc->rl_stat_callout); taskqueue_drain(taskqueue_fast, &sc->rl_inttask); - taskqueue_drain(taskqueue_fast, &sc->rl_txtask); /* * Force off the IFF_UP flag here, in case someone * still had a BPF descriptor attached to this @@ -2365,7 +2363,7 @@ re_poll_locked(struct ifnet *ifp, enum p re_txeof(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); if (cmd == POLL_AND_CHECK_STATUS) { /* also check status register */ u_int16_t status; @@ -2468,7 +2466,7 @@ re_int_task(void *arg, int npending) } if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); RL_UNLOCK(sc); @@ -2673,19 +2671,21 @@ re_encap(struct rl_softc *sc, struct mbu } static void -re_tx_task(void *arg, int npending) +re_start(struct ifnet *ifp) { - struct ifnet *ifp; + struct rl_softc *sc; - ifp = arg; - re_start(ifp); + sc = ifp->if_softc; + RL_LOCK(sc); + re_start_locked(ifp); + RL_UNLOCK(sc); } /* * Main transmit routine for C+ and gigE NICs. */ static void -re_start(struct ifnet *ifp) +re_start_locked(struct ifnet *ifp) { struct rl_softc *sc; struct mbuf *m_head; @@ -2693,13 +2693,9 @@ re_start(struct ifnet *ifp) sc = ifp->if_softc; - RL_LOCK(sc); - if ((ifp->if_drv_flags & (IFF_DRV_RUNNING | IFF_DRV_OACTIVE)) != - IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) { - RL_UNLOCK(sc); + IFF_DRV_RUNNING || (sc->rl_flags & RL_FLAG_LINK) == 0) return; - } for (queued = 0; !IFQ_DRV_IS_EMPTY(&ifp->if_snd) && sc->rl_ldata.rl_tx_free > 1;) { @@ -2729,7 +2725,6 @@ re_start(struct ifnet *ifp) if (sc->rl_ldata.rl_tx_free != sc->rl_ldata.rl_tx_desc_cnt) CSR_WRITE_4(sc, RL_TIMERCNT, 1); #endif - RL_UNLOCK(sc); return; } @@ -2757,8 +2752,6 @@ re_start(struct ifnet *ifp) * Set a timeout in case the chip goes out to lunch. */ sc->rl_watchdog_timer = 5; - - RL_UNLOCK(sc); } static void @@ -3278,7 +3271,7 @@ re_watchdog(struct rl_softc *sc) if_printf(ifp, "watchdog timeout (missed Tx interrupts) " "-- recovering\n"); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); return; } @@ -3289,7 +3282,7 @@ re_watchdog(struct rl_softc *sc) ifp->if_drv_flags &= ~IFF_DRV_RUNNING; re_init_locked(sc); if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) - taskqueue_enqueue_fast(taskqueue_fast, &sc->rl_txtask); + re_start_locked(ifp); } /* Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Tue Jan 25 23:25:23 2011 (r217867) +++ head/sys/pci/if_rlreg.h Tue Jan 25 23:27:28 2011 (r217868) @@ -893,7 +893,6 @@ struct rl_softc { int rxcycles; #endif - struct task rl_txtask; struct task rl_inttask; int rl_txstart; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 01:02:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E77CC106564A; Wed, 26 Jan 2011 01:02:39 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC3378FC0C; Wed, 26 Jan 2011 01:02:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q12di1058437; Wed, 26 Jan 2011 01:02:39 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q12daY058435; Wed, 26 Jan 2011 01:02:39 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101260102.p0Q12daY058435@svn.freebsd.org> From: Doug Barton Date: Wed, 26 Jan 2011 01:02:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217869 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 01:02:40 -0000 Author: dougb Date: Wed Jan 26 01:02:39 2011 New Revision: 217869 URL: http://svn.freebsd.org/changeset/base/217869 Log: Fix date in .Dd Modified: head/share/man/man4/nfe.4 Modified: head/share/man/man4/nfe.4 ============================================================================== --- head/share/man/man4/nfe.4 Tue Jan 25 23:27:28 2011 (r217868) +++ head/share/man/man4/nfe.4 Wed Jan 26 01:02:39 2011 (r217869) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January, 15 2011 .Dt NFE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 01:07:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B7621065675; Wed, 26 Jan 2011 01:07:57 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4E38FC13; Wed, 26 Jan 2011 01:07:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q17uFA058569; Wed, 26 Jan 2011 01:07:56 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q17u77058566; Wed, 26 Jan 2011 01:07:56 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101260107.p0Q17u77058566@svn.freebsd.org> From: Doug Barton Date: Wed, 26 Jan 2011 01:07:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217870 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 01:07:57 -0000 Author: dougb Date: Wed Jan 26 01:07:56 2011 New Revision: 217870 URL: http://svn.freebsd.org/changeset/base/217870 Log: Fix my fix to nfe.4, and also fix re.4 So just when I thought my pointy hat collection was going down ... Modified: head/share/man/man4/nfe.4 head/share/man/man4/re.4 Modified: head/share/man/man4/nfe.4 ============================================================================== --- head/share/man/man4/nfe.4 Wed Jan 26 01:02:39 2011 (r217869) +++ head/share/man/man4/nfe.4 Wed Jan 26 01:07:56 2011 (r217870) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 15 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Wed Jan 26 01:02:39 2011 (r217869) +++ head/share/man/man4/re.4 Wed Jan 26 01:07:56 2011 (r217870) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 05:06:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33D80106564A; Wed, 26 Jan 2011 05:06:11 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E00F18FC15; Wed, 26 Jan 2011 05:06:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q56BwJ064036; Wed, 26 Jan 2011 05:06:11 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q56Bhf064034; Wed, 26 Jan 2011 05:06:11 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101260506.p0Q56Bhf064034@svn.freebsd.org> From: Doug Barton Date: Wed, 26 Jan 2011 05:06:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 05:06:12 -0000 Author: dougb Date: Wed Jan 26 05:06:11 2011 New Revision: 217871 URL: http://svn.freebsd.org/changeset/base/217871 Log: Clarify the availability of the noatime option on network file systems Modified: head/sbin/mount/mount.8 Modified: head/sbin/mount/mount.8 ============================================================================== --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) @@ -28,7 +28,7 @@ .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 .\" $FreeBSD$ .\" -.Dd February 10, 2010 +.Dd January 25, 2011 .Dt MOUNT 8 .Os .Sh NAME @@ -208,7 +208,11 @@ This option is useful on file systems where there are large numbers of files and performance is more critical than updating the file access time (which is rarely ever important). -This option is currently only supported on local file systems. +This option is not supported on network file systems when the +server is FreeBSD. +Support in network files servers on other operating systems +with a FreeBSD client is possible, +but should be tested before it is relied on. .It Cm noauto This file system should be skipped when .Nm From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 06:07:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 45A25106566B; Wed, 26 Jan 2011 06:07:25 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AB408FC0A; Wed, 26 Jan 2011 06:07:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q67OIi065264; Wed, 26 Jan 2011 06:07:24 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q67O6D065262; Wed, 26 Jan 2011 06:07:24 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201101260607.p0Q67O6D065262@svn.freebsd.org> From: Doug Barton Date: Wed, 26 Jan 2011 06:07:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217872 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 06:07:25 -0000 Author: dougb Date: Wed Jan 26 06:07:24 2011 New Revision: 217872 URL: http://svn.freebsd.org/changeset/base/217872 Log: Fix another broken date Modified: head/share/man/man4/rgephy.4 Modified: head/share/man/man4/rgephy.4 ============================================================================== --- head/share/man/man4/rgephy.4 Wed Jan 26 05:06:11 2011 (r217871) +++ head/share/man/man4/rgephy.4 Wed Jan 26 06:07:24 2011 (r217872) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 06:36:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBC3A1065673; Wed, 26 Jan 2011 06:36:14 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A06128FC0A; Wed, 26 Jan 2011 06:36:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q6aET2065925; Wed, 26 Jan 2011 06:36:14 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q6aE5j065922; Wed, 26 Jan 2011 06:36:14 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101260636.p0Q6aE5j065922@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 26 Jan 2011 06:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217873 - head/usr.bin/ktrdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 06:36:14 -0000 Author: dchagin Date: Wed Jan 26 06:36:14 2011 New Revision: 217873 URL: http://svn.freebsd.org/changeset/base/217873 Log: Add -H flag to print thread id. Modified: head/usr.bin/ktrdump/ktrdump.8 head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.8 ============================================================================== --- head/usr.bin/ktrdump/ktrdump.8 Wed Jan 26 06:07:24 2011 (r217872) +++ head/usr.bin/ktrdump/ktrdump.8 Wed Jan 26 06:36:14 2011 (r217873) @@ -33,7 +33,7 @@ .Nd print kernel ktr trace buffer .Sh SYNOPSIS .Nm -.Op Fl cfqrt +.Op Fl cfqrtH .Op Fl e Ar execfile .Op Fl i Ar ktrfile .Op Fl m Ar corefile @@ -55,6 +55,8 @@ Quiet mode; do not print the column head Print relative timestamps rather than absolute timestamps. .It Fl t Print the timestamp for each entry. +.It Fl H +Print the thread ID for each entry. .It Fl i Ar ktrfile File containing saved ktr trace events; for more information see the .Xr ktr 4 Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Wed Jan 26 06:07:24 2011 (r217872) +++ head/usr.bin/ktrdump/ktrdump.c Wed Jan 26 06:36:14 2011 (r217873) @@ -46,7 +46,7 @@ __FBSDID("$FreeBSD$"); #define SBUFLEN 128 #define USAGE \ - "usage: ktrdump [-cfqrt] [-e execfile] [-i ktrfile] [-m corefile] [-o outfile]\n" + "usage: ktrdump [-cfqrtH] [-e execfile] [-i ktrfile] [-m corefile] [-o outfile]\n" static void usage(void); @@ -66,6 +66,7 @@ static int qflag; static int rflag; static int tflag; static int iflag; +static int hflag; static char corefile[PATH_MAX]; static char execfile[PATH_MAX]; @@ -101,7 +102,7 @@ main(int ac, char **av) * Parse commandline arguments. */ out = stdout; - while ((c = getopt(ac, av, "cfqrte:i:m:o:")) != -1) + while ((c = getopt(ac, av, "cfqrtHe:i:m:o:")) != -1) switch (c) { case 'c': cflag = 1; @@ -139,6 +140,9 @@ main(int ac, char **av) case 't': tflag = 1; break; + case 'H': + hflag = 1; + break; case '?': default: usage(); @@ -191,6 +195,8 @@ main(int ac, char **av) fprintf(out, "%-16s ", "timestamp"); if (fflag) fprintf(out, "%-40s ", "file and line"); + if (hflag) + fprintf(out, "%-18s ", "tid"); fprintf(out, "%s", "trace"); fprintf(out, "\n"); @@ -202,6 +208,8 @@ main(int ac, char **av) if (fflag) fprintf(out, "---------------------------------------- "); + if (hflag) + fprintf(out, "------------------ "); fprintf(out, "----- "); fprintf(out, "\n"); } @@ -270,6 +278,8 @@ next: if ((c = *p++) == '\0') buf[i].ktr_line); fprintf(out, "%-40s ", obuf); } + if (hflag) + fprintf(out, "%p ", buf[i].ktr_thread); fprintf(out, desc, parms[0], parms[1], parms[2], parms[3], parms[4], parms[5]); fprintf(out, "\n"); From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 06:37:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 084D0106566B; Wed, 26 Jan 2011 06:37:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EC36F8FC13; Wed, 26 Jan 2011 06:37:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q6bpij065999; Wed, 26 Jan 2011 06:37:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q6bpra065997; Wed, 26 Jan 2011 06:37:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101260637.p0Q6bpra065997@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 06:37:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217874 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 06:37:52 -0000 Author: mav Date: Wed Jan 26 06:37:51 2011 New Revision: 217874 URL: http://svn.freebsd.org/changeset/base/217874 Log: Make device initialization sequence shorter when possible. Do not enable/ disable already enabled/disabled SATA features. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jan 26 06:36:14 2011 (r217873) +++ head/sys/cam/ata/ata_xpt.c Wed Jan 26 06:37:51 2011 (r217874) @@ -988,7 +988,9 @@ noerror: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - if (ident_buf->satasupport & ATA_SUPPORT_IFPWRMNGT) { + if ((ident_buf->satasupport & ATA_SUPPORT_IFPWRMNGT) && + (!(softc->caps & CTS_SATA_CAPS_H_PMREQ)) != + (!(ident_buf->sataenabled & ATA_SUPPORT_IFPWRMNGT))) { PROBE_SET_ACTION(softc, PROBE_SETPM); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -997,7 +999,9 @@ noerror: /* FALLTHROUGH */ case PROBE_SETPM: if (ident_buf->satacapabilities != 0xffff && - ident_buf->satacapabilities & ATA_SUPPORT_DAPST) { + (ident_buf->satacapabilities & ATA_SUPPORT_DAPST) && + (!(softc->caps & CTS_SATA_CAPS_H_APST)) != + (!(ident_buf->sataenabled & ATA_ENABLED_DAPST))) { PROBE_SET_ACTION(softc, PROBE_SETAPST); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); @@ -1005,7 +1009,9 @@ noerror: } /* FALLTHROUGH */ case PROBE_SETAPST: - if (ident_buf->satasupport & ATA_SUPPORT_AUTOACTIVATE) { + if ((ident_buf->satasupport & ATA_SUPPORT_AUTOACTIVATE) && + (!(softc->caps & CTS_SATA_CAPS_H_DMAAA)) != + (!(ident_buf->sataenabled & ATA_SUPPORT_AUTOACTIVATE))) { PROBE_SET_ACTION(softc, PROBE_SETDMAAA); xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 06:57:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2F831065672; Wed, 26 Jan 2011 06:57:48 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C289B8FC08; Wed, 26 Jan 2011 06:57:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q6vmiJ066550; Wed, 26 Jan 2011 06:57:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q6vmAM066548; Wed, 26 Jan 2011 06:57:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101260657.p0Q6vmAM066548@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 06:57:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217875 - head/sys/cam/ata X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 06:57:48 -0000 Author: mav Date: Wed Jan 26 06:57:48 2011 New Revision: 217875 URL: http://svn.freebsd.org/changeset/base/217875 Log: In addition to r217444 ignore also ATA status errors on DMA Auto-Activation enabling request. Some HP disks reported to return ABORT error there while declaring support for this feature. Modified: head/sys/cam/ata/ata_xpt.c Modified: head/sys/cam/ata/ata_xpt.c ============================================================================== --- head/sys/cam/ata/ata_xpt.c Wed Jan 26 06:37:51 2011 (r217874) +++ head/sys/cam/ata/ata_xpt.c Wed Jan 26 06:57:48 2011 (r217875) @@ -778,6 +778,14 @@ probedone(struct cam_periph *periph, uni } else if (softc->action == PROBE_SETPM && status == CAM_ATA_STATUS_ERROR) { goto noerror; + + /* + * Some HP SATA disks report supported DMA Auto-Activation, + * but return ABORT on attempt to enable it. + */ + } else if (softc->action == PROBE_SETDMAAA && + status == CAM_ATA_STATUS_ERROR) { + goto noerror; } /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 07:56:01 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 59F3A106564A; Wed, 26 Jan 2011 07:56:01 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by mx1.freebsd.org (Postfix) with ESMTP id D1ABE8FC17; Wed, 26 Jan 2011 07:56:00 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0Q7tviF021824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 26 Jan 2011 18:55:58 +1100 Date: Wed, 26 Jan 2011 18:55:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Barton In-Reply-To: <201101260506.p0Q56Bhf064034@svn.freebsd.org> Message-ID: <20110126173411.P972@besplex.bde.org> References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 07:56:01 -0000 On Wed, 26 Jan 2011, Doug Barton wrote: > Log: > Clarify the availability of the noatime option on network file systems > > Modified: > head/sbin/mount/mount.8 > > Modified: head/sbin/mount/mount.8 > ============================================================================== > --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) > +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) > @@ -28,7 +28,7 @@ > .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 > .\" $FreeBSD$ > .\" > -.Dd February 10, 2010 > +.Dd January 25, 2011 > .Dt MOUNT 8 > .Os > .Sh NAME > @@ -208,7 +208,11 @@ This option > is useful on file systems where there are large numbers of files and > performance is more critical than updating the file access time (which is > rarely ever important). > -This option is currently only supported on local file systems. > +This option is not supported on network file systems when the > +server is FreeBSD. > +Support in network files servers on other operating systems > +with a FreeBSD client is possible, > +but should be tested before it is relied on. Even atimes are not supported by at least the non-experimental FreeBSD client, so attempts to turn them off are nonsense and should have always failed at mount time. But such attempts bogusly always succeed and have no effect, even if atimes are otherwise supported, since: - for mount(2), the nonstandard option MOPT_NOATIME has always been bogusly in the standard options list MOPT_STDOPTS. Thus it is was never rejected by mount_nfs(8) or for other mount utilities than use mount(2), even for file systems for fies that don't even have atimes. - for nmount(2) in both the non-experimental and experimental cilent the unsupported option "noatime" is bogusly in the supported options list together with lots of other unsupported options like "suiddir", "nocluster[rw]", "multilabel" and "acls". All of these nonstandard options are also bogusly in MOPT_STDOPTS. - bogusly setting the MNT_ATIME flag in an attempt to turn off atime has no effect in any FreeBSD nfs client, since the MNT_ATIME flag is never referenced. And, at least in the non-experimental client, since even atimes are not supported, there is nothing useful that references to MNT_ATIME could do. Non-support of atimes by by at least the old FreeBSD client: Most reads are from the nfs cache (else most reads would be very slow). Since the client doesn't support atimes, it doesn't do the fancy caching of them that would be needed to make them sort of work without defeating the cache by telling the server about every read. So atimes just get updated on the server when the server is asked to fill the cache, and then only if the server supports atimes (not counting when an application on the client explicitly sets them using utimes(2). Full support for noatime/noatime on the client would involve negotating it with the server, so that the client's noatime flag has preference over the server flag on files read by that client... AFAIK there is no way to negotiate this. Client caching of atimes might also need delicate negotiation depending on how POSIXly you want atimes to work. I sometimes think that atimes should be handled mostly in vfs. The MNT_ATIME could then have an effect without any references to it in file systems that sort of support atimes, but ones that don't even have atimes should still make vfs reject attempts to use it. Bruce From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 08:39:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81D66106564A; Wed, 26 Jan 2011 08:39:34 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 709BC8FC12; Wed, 26 Jan 2011 08:39:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q8dYDH068928; Wed, 26 Jan 2011 08:39:34 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q8dYml068926; Wed, 26 Jan 2011 08:39:34 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101260839.p0Q8dYml068926@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 26 Jan 2011 08:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217876 - stable/8/sys/sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 08:39:34 -0000 Author: kib Date: Wed Jan 26 08:39:34 2011 New Revision: 217876 URL: http://svn.freebsd.org/changeset/base/217876 Log: MFC r217747: Fix typo. Modified: stable/8/sys/sys/pioctl.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/sys/pioctl.h ============================================================================== --- stable/8/sys/sys/pioctl.h Wed Jan 26 06:57:48 2011 (r217875) +++ stable/8/sys/sys/pioctl.h Wed Jan 26 08:39:34 2011 (r217876) @@ -69,7 +69,7 @@ struct procfs_status { /* * If PF_LINGER is set in procp->p_pfsflags, then the last close - * of a /proc//mem file will nto clear out the stops and continue + * of a /proc//mem file will not clear out the stops and continue * the process. */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 08:54:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2E73106566B; Wed, 26 Jan 2011 08:54:10 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77D548FC15; Wed, 26 Jan 2011 08:54:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q8sAh9069265; Wed, 26 Jan 2011 08:54:10 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q8sARB069263; Wed, 26 Jan 2011 08:54:10 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101260854.p0Q8sARB069263@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 08:54:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217877 - head/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 08:54:10 -0000 Author: mav Date: Wed Jan 26 08:54:10 2011 New Revision: 217877 URL: http://svn.freebsd.org/changeset/base/217877 Log: Hardware supported by siis(4) allows software control over activity LEDs. Expose that functionality to led(4) OR-ing it with regular LED activity. Modified: head/sys/dev/siis/siis.c Modified: head/sys/dev/siis/siis.c ============================================================================== --- head/sys/dev/siis/siis.c Wed Jan 26 08:39:34 2011 (r217876) +++ head/sys/dev/siis/siis.c Wed Jan 26 08:54:10 2011 (r217877) @@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include "siis.h" @@ -65,6 +66,7 @@ static int siis_ch_suspend(device_t dev) static int siis_ch_resume(device_t dev); static void siis_ch_intr_locked(void *data); static void siis_ch_intr(void *data); +static void siis_ch_led(void *priv, int onoff); static void siis_begin_transaction(device_t dev, union ccb *ccb); static void siis_dmasetprd(void *arg, bus_dma_segment_t *segs, int nsegs, int error); static void siis_execute_transaction(struct siis_slot *slot); @@ -516,6 +518,7 @@ siis_ch_attach(device_t dev) goto err3; } mtx_unlock(&ch->mtx); + ch->led = led_create(siis_ch_led, dev, device_get_nameunit(dev)); return (0); err3: @@ -536,6 +539,7 @@ siis_ch_detach(device_t dev) { struct siis_channel *ch = device_get_softc(dev); + led_destroy(ch->led); mtx_lock(&ch->mtx); xpt_async(AC_LOST_DEVICE, ch->path, NULL); xpt_free_path(ch->path); @@ -625,6 +629,21 @@ static driver_t siisch_driver = { }; DRIVER_MODULE(siisch, siis, siisch_driver, siis_devclass, 0, 0); +static void +siis_ch_led(void *priv, int onoff) +{ + device_t dev; + struct siis_channel *ch; + + dev = (device_t)priv; + ch = device_get_softc(dev); + + if (onoff == 0) + ATA_OUTL(ch->r_mem, SIIS_P_CTLCLR, SIIS_P_CTL_LED_ON); + else + ATA_OUTL(ch->r_mem, SIIS_P_CTLSET, SIIS_P_CTL_LED_ON); +} + struct siis_dc_cb_args { bus_addr_t maddr; int error; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 09:37:14 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A81021065670; Wed, 26 Jan 2011 09:37:14 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 848598FC1A; Wed, 26 Jan 2011 09:37:14 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id E122746B8A; Wed, 26 Jan 2011 04:37:13 -0500 (EST) Date: Wed, 26 Jan 2011 09:37:13 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Matthew D Fleming In-Reply-To: <201101251739.p0PHdqKX044842@svn.freebsd.org> Message-ID: References: <201101251739.p0PHdqKX044842@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:37:14 -0000 On Tue, 25 Jan 2011, Matthew D Fleming wrote: > .Dv SBUF_AUTOEXTEND . > .Pp > The > +.Fn sbuf_new_for_sysctl > +function will set up an sbuf with a drain function to use > +.Fn SYSCTL_OUT > +when the internal buffer fills. > +The sysctl old buffer will be wired, which allows for doing an > +.Fn sbuf_printf > +while holding a mutex. > +.Pp > +The > .Fn sbuf_delete > function clears the > .Fa sbuf Hmm. Is this description missing mention of how wiring failures are handled? (Also, it should probably mention that this call can sleep for potentially quite long periods of time, even if sbuf_printf (and friends) can't). Robert From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 09:37:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D56A81065673; Wed, 26 Jan 2011 09:37:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4DAC8FC0A; Wed, 26 Jan 2011 09:37:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0Q9bht4070234; Wed, 26 Jan 2011 09:37:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0Q9bhPY070232; Wed, 26 Jan 2011 09:37:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101260937.p0Q9bhPY070232@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Jan 2011 09:37:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217878 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 09:37:43 -0000 Author: adrian Date: Wed Jan 26 09:37:43 2011 New Revision: 217878 URL: http://svn.freebsd.org/changeset/base/217878 Log: * fix HAL_DEBUG_INTERRUPT to be a separate bit, it was overlapping with something else * add HAL_DEBUG_GPIO, for some GPIO related debugging I'm tinkering with at the moment. Modified: head/sys/dev/ath/ath_hal/ah_debug.h Modified: head/sys/dev/ath/ath_hal/ah_debug.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_debug.h Wed Jan 26 08:54:10 2011 (r217877) +++ head/sys/dev/ath/ath_hal/ah_debug.h Wed Jan 26 09:37:43 2011 (r217878) @@ -42,7 +42,8 @@ enum { HAL_DEBUG_EEPROM = 0x00008000, HAL_DEBUG_BEACON = 0x00010000, /* beacon setup work */ HAL_DEBUG_POWER = 0x00020000, /* power management */ - HAL_DEBUG_INTERRUPT = 0x00000080, /* interrupt handling */ + HAL_DEBUG_GPIO = 0x00040000, /* GPIO debugging */ + HAL_DEBUG_INTERRUPT = 0x00080000, /* interrupt handling */ HAL_DEBUG_ANY = 0xffffffff }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 10:08:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64DE9106564A; Wed, 26 Jan 2011 10:08:38 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 48AAD8FC14; Wed, 26 Jan 2011 10:08:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QA8c0E070986; Wed, 26 Jan 2011 10:08:38 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QA8ctq070983; Wed, 26 Jan 2011 10:08:38 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101261008.p0QA8ctq070983@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Jan 2011 10:08:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217879 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 10:08:38 -0000 Author: adrian Date: Wed Jan 26 10:08:37 2011 New Revision: 217879 URL: http://svn.freebsd.org/changeset/base/217879 Log: Break out the chainmask init code into a new function - ar5416InitChainMasks() . ath9k does a few different things here during config - if it's an early AR5416 with two chains, it enables all three chains for calibration and then restores the chainmask to the original values after initial calibration has completed. The reason behind this commit is to begin breaking out the chainmask configuration for this specific reason; follow-up commits will add the chainmask restore in the ar5416Reset() routine. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Jan 26 09:37:43 2011 (r217878) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Jan 26 10:08:37 2011 (r217879) @@ -201,7 +201,7 @@ extern void ar5416GetTargetPowersLeg(str CAL_TARGET_POWER_LEG *powInfo, uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, uint16_t numRates, HAL_BOOL isExtTarget); - +extern void ar5416InitChainMasks(struct ath_hal *ah); extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 09:37:43 2011 (r217878) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:08:37 2011 (r217879) @@ -209,13 +209,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO #endif } - if (AH5416(ah)->ah_rx_chainmask == 0x5 || - AH5416(ah)->ah_tx_chainmask == 0x5) - OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); - /* Setup Chain Masks */ - OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); - OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); - OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); + /* + * This routine swaps the analog chains - it should be done + * before any radio register twiddling is done. + */ + ar5416InitChainMasks(ah); /* Setup the transmit power values. */ if (!ah->ah_setTxPower(ah, chan, rfXpdGain)) { @@ -1114,6 +1112,18 @@ ar5416SetReset(struct ath_hal *ah, int t return AH_TRUE; } +void +ar5416InitChainMasks(struct ath_hal *ah) +{ + if (AH5416(ah)->ah_rx_chainmask == 0x5 || + AH5416(ah)->ah_tx_chainmask == 0x5) + OS_REG_WRITE(ah, AR_PHY_ANALOG_SWAP, AR_PHY_SWAP_ALT_CHAIN); + /* Setup Chain Masks */ + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, AH5416(ah)->ah_rx_chainmask); + OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); +} + #ifndef IS_5GHZ_FAST_CLOCK_EN #define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 10:34:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D0161065674; Wed, 26 Jan 2011 10:34:21 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C9A58FC17; Wed, 26 Jan 2011 10:34:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QAYLD5074010; Wed, 26 Jan 2011 10:34:21 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QAYLsL074008; Wed, 26 Jan 2011 10:34:21 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101261034.p0QAYLsL074008@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 26 Jan 2011 10:34:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217880 - head/sys/geom/journal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 10:34:21 -0000 Author: kib Date: Wed Jan 26 10:34:21 2011 New Revision: 217880 URL: http://svn.freebsd.org/changeset/base/217880 Log: Treat async buffer writes from the gjournal switcher thread the same as from syncer. We shall not sleep on running buffer space when suspending. Reproduced and tested by: pho PR: kern/154228 MFC after: 1 week Modified: head/sys/geom/journal/g_journal.c Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Wed Jan 26 10:08:37 2011 (r217879) +++ head/sys/geom/journal/g_journal.c Wed Jan 26 10:34:21 2011 (r217880) @@ -3033,6 +3033,7 @@ g_journal_switcher(void *arg) int error; mp = arg; + curthread->td_pflags |= TDP_NORUNNINGBUF; for (;;) { g_journal_switcher_wokenup = 0; error = tsleep(&g_journal_switcher_state, PRIBIO, "jsw:wait", From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 10:36:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8268C106564A; Wed, 26 Jan 2011 10:36:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 717698FC12; Wed, 26 Jan 2011 10:36:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QAahja074114; Wed, 26 Jan 2011 10:36:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QAahJR074111; Wed, 26 Jan 2011 10:36:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101261036.p0QAahJR074111@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Jan 2011 10:36:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217881 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 10:36:43 -0000 Author: adrian Date: Wed Jan 26 10:36:43 2011 New Revision: 217881 URL: http://svn.freebsd.org/changeset/base/217881 Log: Add an AR5416 workaround - force a different bias based on 2.4ghz channel frequency. Obtained from: Linux ath9k Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar2133.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar2133.c Wed Jan 26 10:34:21 2011 (r217880) +++ head/sys/dev/ath/ath_hal/ar5416/ar2133.c Wed Jan 26 10:36:43 2011 (r217881) @@ -58,6 +58,65 @@ ar2133WriteRegs(struct ath_hal *ah, u_in } /* + * Fix on 2.4 GHz band for orientation sensitivity issue by increasing + * rf_pwd_icsyndiv. + * + * Theoretical Rules: + * if 2 GHz band + * if forceBiasAuto + * if synth_freq < 2412 + * bias = 0 + * else if 2412 <= synth_freq <= 2422 + * bias = 1 + * else // synth_freq > 2422 + * bias = 2 + * else if forceBias > 0 + * bias = forceBias & 7 + * else + * no change, use value from ini file + * else + * no change, invalid band + * + * 1st Mod: + * 2422 also uses value of 2 + * + * + * 2nd Mod: + * Less than 2412 uses value of 0, 2412 and above uses value of 2 + */ +static void +ar2133ForceBias(struct ath_hal *ah, uint16_t synth_freq) +{ + uint32_t tmp_reg; + int reg_writes = 0; + uint32_t new_bias = 0; + struct ar2133State *priv = AR2133(ah); + + /* XXX this is a bit of a silly check for 2.4ghz channels -adrian */ + if (synth_freq >= 3000) + return; + + if (synth_freq < 2412) + new_bias = 0; + else if (synth_freq < 2422) + new_bias = 1; + else + new_bias = 2; + + /* pre-reverse this field */ + tmp_reg = ath_hal_reverseBits(new_bias, 3); + + HALDEBUG(ah, HAL_DEBUG_ANY, "%s: Force rf_pwd_icsyndiv to %1d on %4d\n", + __func__, new_bias, synth_freq); + + /* swizzle rf_pwd_icsyndiv */ + ar5416ModifyRfBuffer(priv->Bank6Data, tmp_reg, 3, 181, 3); + + /* write Bank 6 with new params */ + ath_hal_ini_bank_write(ah, &AH5416(ah)->ah_ini_bank6, priv->Bank6Data, reg_writes); +} + +/* * Take the MHz channel value and set the Channel value * * ASSUMES: Writes enabled to analog bus @@ -125,6 +184,10 @@ ar2133SetChannel(struct ath_hal *ah, con return AH_FALSE; } + /* Workaround for hw bug - AR5416 specific */ + if (AR_SREV_OWL(ah)) + ar2133ForceBias(ah, freq); + reg32 = (channelSel << 8) | (aModeRefSel << 2) | (bModeSynth << 1) | (1 << 5) | 0x1; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Jan 26 10:34:21 2011 (r217880) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Wed Jan 26 10:36:43 2011 (r217881) @@ -588,6 +588,10 @@ #define AR_XSREV_REVISION_KITE_11 1 /* Kite 1.1 */ #define AR_XSREV_REVISION_KITE_12 2 /* Kite 1.2 */ +#define AR_SREV_OWL(_ah) \ + ((AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_OWL_PCI) || \ + (AH_PRIVATE((_ah))->ah_macVersion == AR_XSREV_VERSION_OWL_PCIE)) + #define AR_SREV_OWL_20_OR_LATER(_ah) \ (AH_PRIVATE((_ah))->ah_macVersion >= AR_XSREV_VERSION_SOWL || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_OWL_20) From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 10:48:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9548D106566C; Wed, 26 Jan 2011 10:48:29 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A1238FC15; Wed, 26 Jan 2011 10:48:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QAmTwq074421; Wed, 26 Jan 2011 10:48:29 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QAmTcf074418; Wed, 26 Jan 2011 10:48:29 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101261048.p0QAmTcf074418@svn.freebsd.org> From: Adrian Chadd Date: Wed, 26 Jan 2011 10:48:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217882 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 10:48:29 -0000 Author: adrian Date: Wed Jan 26 10:48:29 2011 New Revision: 217882 URL: http://svn.freebsd.org/changeset/base/217882 Log: Add ar5416RestoreChainMask() which will undo any AR5416 specific chainmask overriding after calibration. This will get set for other two chain radios, such as AR9280 and later on, AR9287. It should however be a nul operation. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Jan 26 10:36:43 2011 (r217881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Wed Jan 26 10:48:29 2011 (r217882) @@ -202,6 +202,7 @@ extern void ar5416GetTargetPowersLeg(str uint16_t numChannels, CAL_TARGET_POWER_LEG *pNewPower, uint16_t numRates, HAL_BOOL isExtTarget); extern void ar5416InitChainMasks(struct ath_hal *ah); +extern void ar5416RestoreChainMask(struct ath_hal *ah); extern HAL_BOOL ar5416StopTxDma(struct ath_hal *ah, u_int q); extern HAL_BOOL ar5416SetupTxDesc(struct ath_hal *ah, struct ath_desc *ds, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:36:43 2011 (r217881) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Wed Jan 26 10:48:29 2011 (r217882) @@ -329,6 +329,8 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO if (!ar5416InitCal(ah, chan)) FAIL(HAL_ESELFTEST); + ar5416RestoreChainMask(ah); + AH_PRIVATE(ah)->ah_opmode = opmode; /* record operating mode */ if (bChannelChange && !IEEE80211_IS_CHAN_DFS(chan)) @@ -1124,6 +1126,18 @@ ar5416InitChainMasks(struct ath_hal *ah) OS_REG_WRITE(ah, AR_SELFGEN_MASK, AH5416(ah)->ah_tx_chainmask); } +void +ar5416RestoreChainMask(struct ath_hal *ah) +{ + int rx_chainmask = AH5416(ah)->ah_rx_chainmask; + + if ((rx_chainmask == 0x5) || (rx_chainmask == 0x3)) { + OS_REG_WRITE(ah, AR_PHY_RX_CHAINMASK, rx_chainmask); + OS_REG_WRITE(ah, AR_PHY_CAL_CHAINMASK, rx_chainmask); + } +} + + #ifndef IS_5GHZ_FAST_CLOCK_EN #define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE #endif From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 13:10:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C39BC1065673; Wed, 26 Jan 2011 13:10:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B27D28FC12; Wed, 26 Jan 2011 13:10:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QDA7mY077603; Wed, 26 Jan 2011 13:10:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QDA7IM077601; Wed, 26 Jan 2011 13:10:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101261310.p0QDA7IM077601@svn.freebsd.org> From: Alexander Motin Date: Wed, 26 Jan 2011 13:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217883 - head/sys/dev/siis X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 13:10:07 -0000 Author: mav Date: Wed Jan 26 13:10:07 2011 New Revision: 217883 URL: http://svn.freebsd.org/changeset/base/217883 Log: Add missing part of r217877. Modified: head/sys/dev/siis/siis.h Modified: head/sys/dev/siis/siis.h ============================================================================== --- head/sys/dev/siis/siis.h Wed Jan 26 10:48:29 2011 (r217882) +++ head/sys/dev/siis/siis.h Wed Jan 26 13:10:07 2011 (r217883) @@ -371,6 +371,7 @@ struct siis_channel { struct ata_dma dma; /* DMA data */ struct cam_sim *sim; struct cam_path *path; + struct cdev *led; /* Activity led led(4) cdev. */ int quirks; int pm_level; /* power management level */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 16:59:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C8BF1065673; Wed, 26 Jan 2011 16:59:08 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF6038FC0A; Wed, 26 Jan 2011 16:59:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QGx7LQ083249; Wed, 26 Jan 2011 16:59:07 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QGx7C5083247; Wed, 26 Jan 2011 16:59:07 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101261659.p0QGx7C5083247@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 26 Jan 2011 16:59:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217885 - stable/8/sys/net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 16:59:08 -0000 Author: bschmidt Date: Wed Jan 26 16:59:07 2011 New Revision: 217885 URL: http://svn.freebsd.org/changeset/base/217885 Log: MFC r217590: Jump to the next element and not to an arbitrary point. frm[1] contains the element's data length, frm[2] is the first byte of the element's data. Submitted by: Monthadar Al Jaberi Modified: stable/8/sys/net80211/ieee80211_mesh.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/net80211/ieee80211_mesh.c ============================================================================== --- stable/8/sys/net80211/ieee80211_mesh.c Wed Jan 26 13:18:26 2011 (r217884) +++ stable/8/sys/net80211/ieee80211_mesh.c Wed Jan 26 16:59:07 2011 (r217885) @@ -1461,7 +1461,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni meshid = frm; break; } - frm += frm[2] + 2; + frm += frm[1] + 2; } IEEE80211_VERIFY_ELEMENT(ssid, IEEE80211_NWID_LEN, return); IEEE80211_VERIFY_ELEMENT(rates, IEEE80211_RATE_MAXSIZE, return); From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 17:06:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E96A1065695; Wed, 26 Jan 2011 17:06:13 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB018FC0C; Wed, 26 Jan 2011 17:06:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QH6Djw083460; Wed, 26 Jan 2011 17:06:13 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QH6DuE083457; Wed, 26 Jan 2011 17:06:13 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101261706.p0QH6DuE083457@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 26 Jan 2011 17:06:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217886 - in head/sys: amd64/amd64 i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:06:13 -0000 Author: mdf Date: Wed Jan 26 17:06:13 2011 New Revision: 217886 URL: http://svn.freebsd.org/changeset/base/217886 Log: Set td_kstack_pages for thread0. This was already being done for most architectures, but i386 and amd64 were missing it. Submitted by: Mohd Fahadullah Modified: head/sys/amd64/amd64/machdep.c head/sys/i386/i386/machdep.c Modified: head/sys/amd64/amd64/machdep.c ============================================================================== --- head/sys/amd64/amd64/machdep.c Wed Jan 26 16:59:07 2011 (r217885) +++ head/sys/amd64/amd64/machdep.c Wed Jan 26 17:06:13 2011 (r217886) @@ -1527,12 +1527,14 @@ hammer_time(u_int64_t modulep, u_int64_t struct nmi_pcpu *np; u_int64_t msr; char *env; + size_t kstack0_sz; thread0.td_kstack = physfree + KERNBASE; - bzero((void *)thread0.td_kstack, KSTACK_PAGES * PAGE_SIZE); - physfree += KSTACK_PAGES * PAGE_SIZE; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + bzero((void *)thread0.td_kstack, kstack0_sz); + physfree += kstack0_sz; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -1674,8 +1676,8 @@ hammer_time(u_int64_t modulep, u_int64_t initializecpucache(); /* make an initial tss so cpu can get interrupt stack on syscall! */ - common_tss[0].tss_rsp0 = thread0.td_kstack + \ - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb); + common_tss[0].tss_rsp0 = thread0.td_kstack + + kstack0_sz - sizeof(struct pcb); /* Ensure the stack is aligned to 16 bytes */ common_tss[0].tss_rsp0 &= ~0xFul; PCPU_SET(rsp0, common_tss[0].tss_rsp0); Modified: head/sys/i386/i386/machdep.c ============================================================================== --- head/sys/i386/i386/machdep.c Wed Jan 26 16:59:07 2011 (r217885) +++ head/sys/i386/i386/machdep.c Wed Jan 26 17:06:13 2011 (r217886) @@ -2493,6 +2493,7 @@ init386(first) { unsigned long gdtmachpfn; int error, gsel_tss, metadata_missing, x, pa; + size_t kstack0_sz; struct pcpu *pc; struct callback_register event = { .type = CALLBACKTYPE_event, @@ -2504,8 +2505,9 @@ init386(first) }; thread0.td_kstack = proc0kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -2656,7 +2658,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); + kstack0_sz - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); HYPERVISOR_stack_switch(GSEL(GDATA_SEL, SEL_KPL), @@ -2716,11 +2718,13 @@ init386(first) { struct gate_descriptor *gdp; int gsel_tss, metadata_missing, x, pa; + size_t kstack0_sz; struct pcpu *pc; thread0.td_kstack = proc0kstack; - thread0.td_pcb = (struct pcb *) - (thread0.td_kstack + KSTACK_PAGES * PAGE_SIZE) - 1; + thread0.td_kstack_pages = KSTACK_PAGES; + kstack0_sz = thread0.td_kstack_pages * PAGE_SIZE; + thread0.td_pcb = (struct pcb *)(thread0.td_kstack + kstack0_sz) - 1; /* * This may be done better later if it gets more high level @@ -2912,7 +2916,7 @@ init386(first) /* make an initial tss so cpu can get interrupt stack on syscall! */ /* Note: -16 is so we can grow the trapframe if we came from vm86 */ PCPU_SET(common_tss.tss_esp0, thread0.td_kstack + - KSTACK_PAGES * PAGE_SIZE - sizeof(struct pcb) - 16); + kstack0_sz - sizeof(struct pcb) - 16); PCPU_SET(common_tss.tss_ss0, GSEL(GDATA_SEL, SEL_KPL)); gsel_tss = GSEL(GPROC0_SEL, SEL_KPL); PCPU_SET(tss_gdt, &gdt[GPROC0_SEL].sd); From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 17:12:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E14D1065672; Wed, 26 Jan 2011 17:12:27 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1886C8FC1C; Wed, 26 Jan 2011 17:12:26 +0000 (UTC) Received: by iwn39 with SMTP id 39so1112066iwn.13 for ; Wed, 26 Jan 2011 09:12:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=jXZesPiZ1E76m6YXGS1jxWkTvMZqgjpRbDsjZh8j+OI=; b=QRdDpANRzZMU/4xYVGhHihiavA6TgCwZA63CLw8WBzBhALu7ccTi2F4bqdOYR5mq5g TODxszgjizfXBY/wV8uT72XLXWtwbKi2amiG4BV0/5acamlnzm5hTRaIemHL/Qmw8GFa rnrn3QsXC3zEzLE8cmfHSpEEbzfXaTHZYCzu0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=HoEp0w3VbXmwB/VHqheOv18TWN0xIWQl7H/KIxtINhbAaVITH1heEKjf5AD76H57uC yNBHCFi5x4ddLTIHJDucvBRd5mPOupWpRMMAEgPF4s7jVN9snva8opNs4bA1bzAOYus/ 0UEC4hdQ1NAhLa44spNgw+peMZGJbViaPXVgg= MIME-Version: 1.0 Received: by 10.231.31.131 with SMTP id y3mr8541060ibc.179.1296061945978; Wed, 26 Jan 2011 09:12:25 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Wed, 26 Jan 2011 09:12:25 -0800 (PST) In-Reply-To: References: <201101251739.p0PHdqKX044842@svn.freebsd.org> Date: Wed, 26 Jan 2011 09:12:25 -0800 X-Google-Sender-Auth: 1KRcZsQlYVtpjPI_b4LtnU_sXro Message-ID: From: mdf@FreeBSD.org To: Robert Watson Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:12:27 -0000 On Wed, Jan 26, 2011 at 1:37 AM, Robert Watson wrote: > On Tue, 25 Jan 2011, Matthew D Fleming wrote: > >> .Dv SBUF_AUTOEXTEND . >> .Pp >> The >> +.Fn sbuf_new_for_sysctl >> +function will set up an sbuf with a drain function to use >> +.Fn SYSCTL_OUT >> +when the internal buffer fills. >> +The sysctl old buffer will be wired, which allows for doing an >> +.Fn sbuf_printf >> +while holding a mutex. >> +.Pp >> +The >> .Fn sbuf_delete >> function clears the >> .Fa sbuf > > Hmm. =A0Is this description missing mention of how wiring failures are > handled? (Also, it should probably mention that this call can sleep for > potentially quite long periods of time, even if sbuf_printf (and friends) > can't). I'm not sure how much to write, since some of the wiring failures are dealt with by the sysctl subsystem and are not documented. The current state of the actual code is that a failure in vslock(9) is ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets the sysctl_req->validlen to 0, which would behave perhaps slightly unexpectedly for the user since no data will be copied out. Any non-ENOMEM failure from vslock() presumably would also have been a failure from SYSCTL_OUT and this does get squashed, perhaps incorrectly. I'll think about saving the error code so that sbuf_finish can report it if nothing else has gone wrong. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 17:20:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 632AF106564A; Wed, 26 Jan 2011 17:20:35 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5058E8FC1A; Wed, 26 Jan 2011 17:20:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QHKZbq083785; Wed, 26 Jan 2011 17:20:35 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QHKZLv083773; Wed, 26 Jan 2011 17:20:35 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201101261720.p0QHKZLv083773@svn.freebsd.org> From: Bernhard Schmidt Date: Wed, 26 Jan 2011 17:20:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217887 - in releng/8.2/sys: dev/bwi dev/bwn dev/iwn dev/ral dev/usb/wlan dev/wpi net80211 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:20:35 -0000 Author: bschmidt Date: Wed Jan 26 17:20:34 2011 New Revision: 217887 URL: http://svn.freebsd.org/changeset/base/217887 Log: MFC r217511: Pull ieee80211_ratectl_node_init() calls from drivers into net80211. This fixes hostap mode for at least ral(4) and run(4), because there is no sufficient call into drivers which could be used initialize the node related ratectl variables. Approved by: re (bz) Modified: releng/8.2/sys/dev/bwi/if_bwi.c releng/8.2/sys/dev/bwn/if_bwn.c releng/8.2/sys/dev/iwn/if_iwn.c releng/8.2/sys/dev/ral/rt2560.c releng/8.2/sys/dev/ral/rt2661.c releng/8.2/sys/dev/usb/wlan/if_rum.c releng/8.2/sys/dev/usb/wlan/if_run.c releng/8.2/sys/dev/usb/wlan/if_ural.c releng/8.2/sys/dev/wpi/if_wpi.c releng/8.2/sys/net80211/ieee80211_node.c Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/bwi/if_bwi.c ============================================================================== --- releng/8.2/sys/dev/bwi/if_bwi.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/bwi/if_bwi.c Wed Jan 26 17:20:34 2011 (r217887) @@ -1764,7 +1764,6 @@ static int bwi_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { struct bwi_vap *bvp = BWI_VAP(vap); - const struct ieee80211_txparam *tp; struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; enum ieee80211_state ostate = vap->iv_state; @@ -1818,11 +1817,6 @@ bwi_newstate(struct ieee80211vap *vap, e sc->sc_txpwrcb_type = BWI_TXPWR_CALIB; #endif - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); - callout_reset(&sc->sc_calib_ch, hz, bwi_calibrate, sc); } back: Modified: releng/8.2/sys/dev/bwn/if_bwn.c ============================================================================== --- releng/8.2/sys/dev/bwn/if_bwn.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/bwn/if_bwn.c Wed Jan 26 17:20:34 2011 (r217887) @@ -8329,7 +8329,6 @@ bwn_phy_reset(struct bwn_mac *mac) static int bwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { - const struct ieee80211_txparam *tp; struct bwn_vap *bvp = BWN_VAP(vap); struct ieee80211com *ic= vap->iv_ic; struct ifnet *ifp = ic->ic_ifp; @@ -8378,11 +8377,6 @@ bwn_newstate(struct ieee80211vap *vap, e bwn_set_pretbtt(mac); bwn_spu_setdelay(mac, 0); bwn_set_macaddr(mac); - - /* Initializes ratectl for a node. */ - tp = &vap->iv_txparms[ieee80211_chan2mode(ic->ic_curchan)]; - if (tp->ucastrate == IEEE80211_FIXED_RATE_NONE) - ieee80211_ratectl_node_init(vap->iv_bss); } BWN_UNLOCK(sc); Modified: releng/8.2/sys/dev/iwn/if_iwn.c ============================================================================== --- releng/8.2/sys/dev/iwn/if_iwn.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/iwn/if_iwn.c Wed Jan 26 17:20:34 2011 (r217887) @@ -122,7 +122,6 @@ static void iwn_read_eeprom_channels(str static void iwn_read_eeprom_enhinfo(struct iwn_softc *); static struct ieee80211_node *iwn_node_alloc(struct ieee80211vap *, const uint8_t mac[IEEE80211_ADDR_LEN]); -static void iwn_newassoc(struct ieee80211_node *, int); static int iwn_media_change(struct ifnet *); static int iwn_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void iwn_rx_phy(struct iwn_softc *, struct iwn_rx_desc *, @@ -652,7 +651,6 @@ iwn_attach(device_t dev) ic->ic_vap_delete = iwn_vap_delete; ic->ic_raw_xmit = iwn_raw_xmit; ic->ic_node_alloc = iwn_node_alloc; - ic->ic_newassoc = iwn_newassoc; ic->ic_wme.wme_update = iwn_wme_update; ic->ic_update_mcast = iwn_update_mcast; ic->ic_scan_start = iwn_scan_start; @@ -1929,13 +1927,6 @@ iwn_node_alloc(struct ieee80211vap *vap, return malloc(sizeof (struct iwn_node), M_80211_NODE,M_NOWAIT | M_ZERO); } -static void -iwn_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int iwn_media_change(struct ifnet *ifp) { Modified: releng/8.2/sys/dev/ral/rt2560.c ============================================================================== --- releng/8.2/sys/dev/ral/rt2560.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/ral/rt2560.c Wed Jan 26 17:20:34 2011 (r217887) @@ -103,7 +103,6 @@ static void rt2560_reset_rx_ring(struct struct rt2560_rx_ring *); static void rt2560_free_rx_ring(struct rt2560_softc *, struct rt2560_rx_ring *); -static void rt2560_newassoc(struct ieee80211_node *, int); static int rt2560_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2560_eeprom_read(struct rt2560_softc *, uint8_t); @@ -301,7 +300,6 @@ rt2560_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2560_newassoc; ic->ic_raw_xmit = rt2560_raw_xmit; ic->ic_updateslot = rt2560_update_slot; ic->ic_update_promisc = rt2560_update_promisc; @@ -757,13 +755,6 @@ rt2560_free_rx_ring(struct rt2560_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2560_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2560_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: releng/8.2/sys/dev/ral/rt2661.c ============================================================================== --- releng/8.2/sys/dev/ral/rt2661.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/ral/rt2661.c Wed Jan 26 17:20:34 2011 (r217887) @@ -100,7 +100,6 @@ static void rt2661_reset_rx_ring(struct struct rt2661_rx_ring *); static void rt2661_free_rx_ring(struct rt2661_softc *, struct rt2661_rx_ring *); -static void rt2661_newassoc(struct ieee80211_node *, int); static int rt2661_newstate(struct ieee80211vap *, enum ieee80211_state, int); static uint16_t rt2661_eeprom_read(struct rt2661_softc *, uint8_t); @@ -304,7 +303,6 @@ rt2661_attach(device_t dev, int id) ieee80211_init_channels(ic, NULL, &bands); ieee80211_ifattach(ic, macaddr); - ic->ic_newassoc = rt2661_newassoc; #if 0 ic->ic_wme.wme_update = rt2661_wme_update; #endif @@ -764,13 +762,6 @@ rt2661_free_rx_ring(struct rt2661_softc bus_dma_tag_destroy(ring->data_dmat); } -static void -rt2661_newassoc(struct ieee80211_node *ni, int isnew) -{ - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - static int rt2661_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) { Modified: releng/8.2/sys/dev/usb/wlan/if_rum.c ============================================================================== --- releng/8.2/sys/dev/usb/wlan/if_rum.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/usb/wlan/if_rum.c Wed Jan 26 17:20:34 2011 (r217887) @@ -2206,8 +2206,6 @@ rum_ratectl_start(struct rum_softc *sc, /* clear statistic registers (STA_CSR0 to STA_CSR5) */ rum_read_multi(sc, RT2573_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&rvp->ratectl_ch, hz, rum_ratectl_timeout, rvp); } Modified: releng/8.2/sys/dev/usb/wlan/if_run.c ============================================================================== --- releng/8.2/sys/dev/usb/wlan/if_run.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/usb/wlan/if_run.c Wed Jan 26 17:20:34 2011 (r217887) @@ -2376,7 +2376,6 @@ run_newassoc(struct ieee80211_node *ni, DPRINTF("new assoc isnew=%d associd=%x addr=%s\n", isnew, ni->ni_associd, ether_sprintf(ni->ni_macaddr)); - ieee80211_ratectl_node_init(ni); sc->sc_ni[wcid] = ni; for (i = 0; i < rs->rs_nrates; i++) { Modified: releng/8.2/sys/dev/usb/wlan/if_ural.c ============================================================================== --- releng/8.2/sys/dev/usb/wlan/if_ural.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/usb/wlan/if_ural.c Wed Jan 26 17:20:34 2011 (r217887) @@ -2215,8 +2215,6 @@ ural_ratectl_start(struct ural_softc *sc /* clear statistic registers (STA_CSR0 to STA_CSR10) */ ural_read_multi(sc, RAL_STA_CSR0, sc->sta, sizeof sc->sta); - ieee80211_ratectl_node_init(ni); - usb_callout_reset(&uvp->ratectl_ch, hz, ural_ratectl_timeout, uvp); } Modified: releng/8.2/sys/dev/wpi/if_wpi.c ============================================================================== --- releng/8.2/sys/dev/wpi/if_wpi.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/dev/wpi/if_wpi.c Wed Jan 26 17:20:34 2011 (r217887) @@ -174,7 +174,6 @@ static int wpi_alloc_tx_ring(struct wpi_ int, int); static void wpi_reset_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); static void wpi_free_tx_ring(struct wpi_softc *, struct wpi_tx_ring *); -static void wpi_newassoc(struct ieee80211_node *, int); static int wpi_newstate(struct ieee80211vap *, enum ieee80211_state, int); static void wpi_mem_lock(struct wpi_softc *); static void wpi_mem_unlock(struct wpi_softc *); @@ -668,7 +667,6 @@ wpi_attach(device_t dev) ieee80211_ifattach(ic, macaddr); /* override default methods */ ic->ic_raw_xmit = wpi_raw_xmit; - ic->ic_newassoc = wpi_newassoc; ic->ic_wme.wme_update = wpi_wme_update; ic->ic_scan_start = wpi_scan_start; ic->ic_scan_end = wpi_scan_end; @@ -3233,14 +3231,6 @@ wpi_stop(struct wpi_softc *sc) } static void -wpi_newassoc(struct ieee80211_node *ni, int isnew) -{ - - /* XXX move */ - ieee80211_ratectl_node_init(ni); -} - -static void wpi_calib_timeout(void *arg) { struct wpi_softc *sc = arg; Modified: releng/8.2/sys/net80211/ieee80211_node.c ============================================================================== --- releng/8.2/sys/net80211/ieee80211_node.c Wed Jan 26 17:06:13 2011 (r217886) +++ releng/8.2/sys/net80211/ieee80211_node.c Wed Jan 26 17:20:34 2011 (r217887) @@ -1137,6 +1137,8 @@ ieee80211_alloc_node(struct ieee80211_no IEEE80211_NOTE(vap, IEEE80211_MSG_INACT, ni, "%s: inact_reload %u", __func__, ni->ni_inact_reload); + ieee80211_ratectl_node_init(ni); + return ni; } @@ -1174,6 +1176,8 @@ ieee80211_tmp_node(struct ieee80211vap * ni->ni_txpower = bss->ni_txpower; /* XXX optimize away */ ieee80211_psq_init(&ni->ni_psq, "unknown"); + + ieee80211_ratectl_node_init(ni); } else { /* XXX msg */ vap->iv_stats.is_rx_nodealloc++; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 17:31:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E2F106566B; Wed, 26 Jan 2011 17:31:03 +0000 (UTC) (envelope-from deischen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 677BC8FC0C; Wed, 26 Jan 2011 17:31:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QHV3Tw084046; Wed, 26 Jan 2011 17:31:03 GMT (envelope-from deischen@svn.freebsd.org) Received: (from deischen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QHV33e084044; Wed, 26 Jan 2011 17:31:03 GMT (envelope-from deischen@svn.freebsd.org) Message-Id: <201101261731.p0QHV33e084044@svn.freebsd.org> From: Daniel Eischen Date: Wed, 26 Jan 2011 17:31:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217888 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:31:03 -0000 Author: deischen Date: Wed Jan 26 17:31:03 2011 New Revision: 217888 URL: http://svn.freebsd.org/changeset/base/217888 Log: Prison check addresses set with multicast interface options. Reviewed by: bz MFC after: 1 week Modified: head/sys/netinet/in_pcb.c Modified: head/sys/netinet/in_pcb.c ============================================================================== --- head/sys/netinet/in_pcb.c Wed Jan 26 17:20:34 2011 (r217887) +++ head/sys/netinet/in_pcb.c Wed Jan 26 17:31:03 2011 (r217888) @@ -889,17 +889,20 @@ in_pcbconnect_setup(struct inpcb *inp, s if (imo->imo_multicast_ifp != NULL) { ifp = imo->imo_multicast_ifp; IN_IFADDR_RLOCK(); - TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) - if (ia->ia_ifp == ifp) + TAILQ_FOREACH(ia, &V_in_ifaddrhead, ia_link) { + if ((ia->ia_ifp == ifp) && + (cred == NULL || + prison_check_ip4(cred, + &ia->ia_addr.sin_addr) == 0)) break; - if (ia == NULL) { - IN_IFADDR_RUNLOCK(); + } + if (ia == NULL) error = EADDRNOTAVAIL; - } else { + else { laddr = ia->ia_addr.sin_addr; - IN_IFADDR_RUNLOCK(); error = 0; } + IN_IFADDR_RUNLOCK(); } } if (error) From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 17:55:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B812106566C; Wed, 26 Jan 2011 17:55:11 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 7667A8FC12; Wed, 26 Jan 2011 17:55:11 +0000 (UTC) Received: from lemongrass.sec.cl.cam.ac.uk (lemongrass.sec.cl.cam.ac.uk [128.232.18.47]) by cyrus.watson.org (Postfix) with ESMTPSA id BBD5946B03; Wed, 26 Jan 2011 12:55:10 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Wed, 26 Jan 2011 17:55:09 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 17:55:11 -0000 On 26 Jan 2011, at 17:12, mdf@FreeBSD.org wrote: >> Hmm. Is this description missing mention of how wiring failures are >> handled? (Also, it should probably mention that this call can sleep = for >> potentially quite long periods of time, even if sbuf_printf (and = friends) >> can't). >=20 > I'm not sure how much to write, since some of the wiring failures are > dealt with by the sysctl subsystem and are not documented. >=20 > The current state of the actual code is that a failure in vslock(9) is > ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets > the sysctl_req->validlen to 0, which would behave perhaps slightly > unexpectedly for the user since no data will be copied out. >=20 > Any non-ENOMEM failure from vslock() presumably would also have been a > failure from SYSCTL_OUT and this does get squashed, perhaps > incorrectly. >=20 > I'll think about saving the error code so that sbuf_finish can report > it if nothing else has gone wrong. Yeah, no specific opinions on the right answer, except perhaps that = sbuf_new_for_sysctl() failing due to ENOMEM is something worth making it = easy to report to the user. I suppose an important question is now often = we see this actually failing, and in what circumstances: if there's a = moderate chance of it failing on low-memory machines under memory = pressure, it suggests we've gone wrong somewhere... One nice thing about = the non-wiring model is that it's pretty cheap in the common case, = whereas the new code is pretty expensive in the common case. Maybe this = doesn't matter too much. Robert= From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 18:29:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D9DBE1065674; Wed, 26 Jan 2011 18:29:10 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7604F8FC15; Wed, 26 Jan 2011 18:29:10 +0000 (UTC) Received: by iyb26 with SMTP id 26so659577iyb.13 for ; Wed, 26 Jan 2011 10:29:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Jf6ThKcIT7Q+7AzQkB7N9A2kbCX0isr+WD9n/ZtENCc=; b=tNEHHDLjQWkaioDYoxoXYYO5+oO4NxKNk5rG2V63hgK95gWuiTeWouqmTr8Ed1omPz pFqsK1Kn0S0HX0cgd07KckqfpuCdm+9GJA2Cu9V+brljixyigKI9VlScNYLkuxLQCzQR JDs6nQgIW1P7xNccWPFcxnD6weWoKsliy2dV4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=MJ4EHcbMtLPlnfc0/aenetRR2Mo7MhDBqHvpn/hPvPbDGFUJk3g0utaWw/OXvJc55s rdjNL03aledjSiYBLsMmqmQE/zS6vI+ajC779IMHqq+wsp0aJEgXXTzs8YDuSAEyZZgO Tqp0F8rBZloXQX3NRkZl3ISx5KziANf4OTWAM= MIME-Version: 1.0 Received: by 10.231.31.131 with SMTP id y3mr8658025ibc.179.1296066549748; Wed, 26 Jan 2011 10:29:09 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Wed, 26 Jan 2011 10:29:09 -0800 (PST) In-Reply-To: <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> Date: Wed, 26 Jan 2011 10:29:09 -0800 X-Google-Sender-Auth: bSrYxGw5nnbmolwHXILjnoPLyf0 Message-ID: From: mdf@FreeBSD.org To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 18:29:11 -0000 On Wed, Jan 26, 2011 at 9:55 AM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 17:12, mdf@FreeBSD.org wrote: > >>> Hmm. =A0Is this description missing mention of how wiring failures are >>> handled? (Also, it should probably mention that this call can sleep for >>> potentially quite long periods of time, even if sbuf_printf (and friend= s) >>> can't). >> >> I'm not sure how much to write, since some of the wiring failures are >> dealt with by the sysctl subsystem and are not documented. >> >> The current state of the actual code is that a failure in vslock(9) is >> ignored, unless it's ENOMEM in which case sysctl_wire_old_buffer sets >> the sysctl_req->validlen to 0, which would behave perhaps slightly >> unexpectedly for the user since no data will be copied out. >> >> Any non-ENOMEM failure from vslock() presumably would also have been a >> failure from SYSCTL_OUT and this does get squashed, perhaps >> incorrectly. >> >> I'll think about saving the error code so that sbuf_finish can report >> it if nothing else has gone wrong. > > Yeah, no specific opinions on the right answer, except perhaps that sbuf_= new_for_sysctl() > failing due to ENOMEM is something worth making it easy to report to the = user. The ENOMEM is already managed and squashed inside sysctl_wire_old_buffer(), so there's no way for sbuf_new_for_sysctl() to report it. It may end up happening automagically since it sets the validlen to 0. > I suppose an important question is now often we see this actually failing I don't believe we've ever seen a memory failure relating to sysctls at Isilon and we've been using the equivalent of this code for a few years. Our machines aren't low memory but they are under memory pressure sometimes. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 18:43:16 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0EE0E1065697; Wed, 26 Jan 2011 18:43:16 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F2BFC8FC24; Wed, 26 Jan 2011 18:43:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QIhFX5085748; Wed, 26 Jan 2011 18:43:15 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QIhFU5085746; Wed, 26 Jan 2011 18:43:15 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101261843.p0QIhFU5085746@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 26 Jan 2011 18:43:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217890 - head/usr.bin/getopt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 18:43:16 -0000 Author: uqs Date: Wed Jan 26 18:43:15 2011 New Revision: 217890 URL: http://svn.freebsd.org/changeset/base/217890 Log: Fix typo in example getopt(1) script: $i vs $1 [1] While here apply style hammer. PR: docs/154289 [1] Submitted by: Jamie Landeg Jones MFC after: 1 week Modified: head/usr.bin/getopt/getopt.1 Modified: head/usr.bin/getopt/getopt.1 ============================================================================== --- head/usr.bin/getopt/getopt.1 Wed Jan 26 18:03:03 2011 (r217889) +++ head/usr.bin/getopt/getopt.1 Wed Jan 26 18:43:15 2011 (r217890) @@ -1,6 +1,6 @@ .\" $FreeBSD$ .\" -.Dd July 7, 2010 +.Dd January 26, 2011 .Dt GETOPT 1 .Os .Sh NAME @@ -54,8 +54,7 @@ which requires an argument. args=\`getopt abo: $*\` # you should not use \`getopt abo: "$@"\` since that would parse # the arguments differently from what the set command below does. -if [ $? -ne 0 ] -then +if [ $? -ne 0 ]; then echo 'Usage: ...' exit 2 fi @@ -63,22 +62,23 @@ set \-\- $args # You cannot use the set command with a backquoted getopt directly, # since the exit code from getopt would be shadowed by those of set, # which is zero by definition. -while true; -do - case "$1" - in - \-a|\-b) - echo flag $i set; sflags="${i#-}$sflags"; - shift;; - \-o) - echo oarg is "'"$2"'"; oarg="$2"; shift; - shift;; - \-\-) - shift; break;; +while true; do + case "$1" in + \-a|\-b) + echo "flag $1 set"; sflags="${1#-}$sflags" + shift + ;; + \-o) + echo "oarg is '$2'"; oarg="$2" + shift; shift + ;; + \-\-) + shift; break + ;; esac done -echo single-char flags: "'"$sflags"'" -echo oarg is "'"$oarg"'" +echo "single-char flags: '$sflags'" +echo "oarg is '$oarg'" .Ed .Pp This code will accept any of the following as equivalent: From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 19:39:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A601106566C; Wed, 26 Jan 2011 19:39:31 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 585ED8FC08; Wed, 26 Jan 2011 19:39:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QJdVSk087195; Wed, 26 Jan 2011 19:39:31 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QJdVYK087190; Wed, 26 Jan 2011 19:39:31 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201101261939.p0QJdVYK087190@svn.freebsd.org> From: Ulrich Spoerlein Date: Wed, 26 Jan 2011 19:39:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217893 - in head/share/doc/papers: kernmalloc sysperf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 19:39:31 -0000 Author: uqs Date: Wed Jan 26 19:39:31 2011 New Revision: 217893 URL: http://svn.freebsd.org/changeset/base/217893 Log: Unroll vgrind filter to no longer depend on vgrind(1) during buildworld. The source files haven't been touched in ages and this is unlikely to change in the future. Added: head/share/doc/papers/kernmalloc/appendix.ms (contents, props changed) head/share/doc/papers/sysperf/appendix.ms (contents, props changed) Modified: head/share/doc/papers/kernmalloc/Makefile head/share/doc/papers/sysperf/Makefile Modified: head/share/doc/papers/kernmalloc/Makefile ============================================================================== --- head/share/doc/papers/kernmalloc/Makefile Wed Jan 26 19:24:41 2011 (r217892) +++ head/share/doc/papers/kernmalloc/Makefile Wed Jan 26 19:39:31 2011 (r217893) @@ -10,9 +10,5 @@ USE_EQN= USE_PIC= USE_SOELIM= USE_TBL= -CLEANFILES= appendix.ms - -appendix.ms: appendix.t - ${GRIND} < ${.ALLSRC} > ${.TARGET} .include Added: head/share/doc/papers/kernmalloc/appendix.ms ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/papers/kernmalloc/appendix.ms Wed Jan 26 19:39:31 2011 (r217893) @@ -0,0 +1,275 @@ +.\" $FreeBSD$ +.am vS +.. +.am vE +.. +'ss 23 +'ds _ \d\(mi\u +'ps 9z +'vs 10p +'ds - \(mi +'ds / \\h'\\w' 'u-\\w'/'u'/ +'ds /* \\h'\\w' 'u-\\w'/'u'/* +'bd B 3 +'bd S B 3 +'nr cm 0 +'nf +'de vH +'ev 2 +'ft 1 +'sp .35i +'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0' +'sp .25i +'ft 1 +\f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u' +.sp .05i +'ev +'ds =G \\*(=F +.. +'de vF +'ev 2 +'sp .35i +'ie o 'tl '\f2\\*(=M''Page % of \\*(=G\fP' +'el 'tl '\f2Page % of \\*(=G''\\*(=M\fP' +'bp +'ev +'ft 1 +'if \\n(cm=1 'ft 2 +.. +'de () +'pn 1 +.. +'de +C +'nr cm 1 +'ft 2 +'ds +K +'ds -K +.. +'de -C +'nr cm 0 +'ft 1 +'ds +K \f3 +'ds -K \fP +.. +'+C +'-C +'am +C +'ne 3 +.. +'de FN +\f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de FC +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de -F +'rm =f +.. +'ft 1 +'lg 0 +'-F +.\" Copyright (c) 1988 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. +.\" +.\" @(#)appendix.t 5.1 (Berkeley) 4/16/91 +.\" +.bp +.H 1 "Appendix A - Implementation Details" +.LP +.nf +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Constants for setting the parameters of the kernel memory allocator\&. + \fI*\fP + \fI*\fP 2 \fI*\fP\fI*\fP MINBUCKET is the smallest unit of memory that will be + \fI*\fP allocated\&. It must be at least large enough to hold a pointer\&. + \fI*\fP + \fI*\fP Units of memory less or equal to MAXALLOCSAVE will permanently + \fI*\fP allocate physical memory; requests for these size pieces of memory + \fI*\fP are quite fast\&. Allocations greater than MAXALLOCSAVE must + \fI*\fP always allocate and free physical memory; requests for these size + \fI*\fP allocations should be done infrequently as they will be slow\&. + \fI*\fP Constraints: CLBYTES <= MAXALLOCSAVE <= 2 \fI*\fP\fI*\fP (MINBUCKET + 14) + \fI*\fP and MAXALLOCSIZE must be a power of two\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K#define\*(-K MINBUCKET\h'|31n'4\h'|51n'\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + 4 => min allocation of 16 bytes \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +'FN MAXALLOCSAVE +\*(+K#define\*(-K MAXALLOCSAVE\h'|31n'(2 \fI*\fP CLBYTES) + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Maximum amount of kernel dynamic memory\&. + \fI*\fP Constraints: must be a multiple of the pagesize\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +'FN MAXKMEM +\*(+K#define\*(-K MAXKMEM\h'|31n'(1024 \fI*\fP PAGESIZE) + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Arena for all kernel dynamic memory allocation\&. + \fI*\fP This arena is known to start on a page boundary\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+Kextern\*(-K \*(+Kchar\*(-K kmembase[MAXKMEM]; + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Array of descriptors that describe the contents of each page + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+Kstruct\*(-K kmemsizes \*(+K{\*(-K +\h'|11n'\*(+Kshort\*(-K\h'|21n'ks\*_indx;\h'|41n'\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + bucket index, size of small allocations \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\h'|11n'u\*_short\h'|21n'ks\*_pagecnt;\h'|41n'\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + for large allocations, pages allocated \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K}\*(-K\c\c +'-F + kmemsizes[MAXKMEM \fI\h'\w' 'u-\w'/'u'/\fP PAGESIZE]; +'FC MAXALLOCSAVE + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Set of buckets for each size of memory block that is retained + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+Kstruct\*(-K kmembuckets \*(+K{\*(-K +\h'|11n'caddr\*_t kb\*_next;\h'|41n'\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + list of free blocks \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K}\*(-K\c\c +'-F + bucket[MINBUCKET + 16]; +.bp +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Macro to convert a size to a bucket index\&. If the size is constant, + \fI*\fP this macro reduces to a compile time constant\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +'FN MINALLOCSIZE +\*(+K#define\*(-K MINALLOCSIZE\h'|31n'(1 << MINBUCKET) +'FN BUCKETINDX +\*(+K#define\*(-K BUCKETINDX(size) \e +\h'|11n'(size) <= (MINALLOCSIZE \fI*\fP 128) \e +\h'|21n'? (size) <= (MINALLOCSIZE \fI*\fP 8) \e +\h'|31n'? (size) <= (MINALLOCSIZE \fI*\fP 2) \e +\h'|41n'? (size) <= (MINALLOCSIZE \fI*\fP 1) \e +\h'|51n'? (MINBUCKET + 0) \e +\h'|51n': (MINBUCKET + 1) \e +\h'|41n': (size) <= (MINALLOCSIZE \fI*\fP 4) \e +\h'|51n'? (MINBUCKET + 2) \e +\h'|51n': (MINBUCKET + 3) \e +\h'|31n': (size) <= (MINALLOCSIZE\fI*\fP 32) \e +\h'|41n'? (size) <= (MINALLOCSIZE \fI*\fP 16) \e +\h'|51n'? (MINBUCKET + 4) \e +\h'|51n': (MINBUCKET + 5) \e +\h'|41n': (size) <= (MINALLOCSIZE \fI*\fP 64) \e +\h'|51n'? (MINBUCKET + 6) \e +\h'|51n': (MINBUCKET + 7) \e +\h'|21n': (size) <= (MINALLOCSIZE \fI*\fP 2048) \e +\h'|31n'\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + etc \&.\&.\&. \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Macro versions for the usual cases of malloc\fI\h'\w' 'u-\w'/'u'/\fPfree + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +'FN MALLOC +\*(+K#define\*(-K MALLOC(space, cast, size, flags) \*(+K{\*(-K \e +\h'|11n'\*(+Kregister\*(-K \*(+Kstruct\*(-K kmembuckets \fI*\fPkbp = &bucket[BUCKETINDX(size)]; \e +\h'|11n'\*(+Klong\*(-K s = splimp(); \e +\h'|11n'\*(+Kif\*(-K (kbp\*->kb\*_next == NULL) \*(+K{\*(-K \e +\h'|21n'(space) = (cast)malloc(size, flags); \e +\h'|11n'\*(+K}\*(-K \*(+Kelse\*(-K \*(+K{\*(-K \e +\h'|21n'(space) = (cast)kbp\*->kb\*_next; \e +\h'|21n'kbp\*->kb\*_next = \fI*\fP(caddr\*_t \fI*\fP)(space); \e +\h'|11n'\*(+K}\*(-K \e +\h'|11n'splx(s); \e +\*(+K}\*(-K\c\c +'-F + +'FC BUCKETINDX + +'FN FREE +\*(+K#define\*(-K FREE(addr) \*(+K{\*(-K \e +\h'|11n'\*(+Kregister\*(-K \*(+Kstruct\*(-K kmembuckets \fI*\fPkbp; \e +\h'|11n'\*(+Kregister\*(-K \*(+Kstruct\*(-K kmemsizes \fI*\fPksp = \e +\h'|21n'&kmemsizes[((addr) \*- kmembase) \fI\h'\w' 'u-\w'/'u'/\fP PAGESIZE]; \e +\h'|11n'\*(+Klong\*(-K s = splimp(); \e +\h'|11n'\*(+Kif\*(-K (1 << ksp\*->ks\*_indx > MAXALLOCSAVE) \*(+K{\*(-K \e +\h'|21n'free(addr); \e +\h'|11n'\*(+K}\*(-K \*(+Kelse\*(-K \*(+K{\*(-K \e +\h'|21n'kbp = &bucket[ksp\*->ks\*_indx]; \e +\h'|21n'\fI*\fP(caddr\*_t \fI*\fP)(addr) = kbp\*->kb\*_next; \e +\h'|21n'kbp\*->kb\*_next = (caddr\*_t)(addr); \e +\h'|11n'\*(+K}\*(-K \e +\h'|11n'splx(s); \e +\*(+K}\*(-K\c\c +'-F + +'FC BUCKETINDX +.vE Modified: head/share/doc/papers/sysperf/Makefile ============================================================================== --- head/share/doc/papers/sysperf/Makefile Wed Jan 26 19:24:41 2011 (r217892) +++ head/share/doc/papers/sysperf/Makefile Wed Jan 26 19:39:31 2011 (r217893) @@ -3,17 +3,10 @@ VOLUME= papers DOC= sysperf -SRCS= 0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t appendix.tmp +SRCS= 0.t 1.t 2.t 3.t 4.t 5.t 6.t 7.t appendix.ms EXTRA= a1.t a2.t MACROS= -ms USE_EQN= USE_TBL= -CLEANFILES= appendix.tmp - -appendix.tmp: a1.t a2.t - ${GRIND} ${.CURDIR}/a1.t | awk '/\.\(\)/{ cnt = 2 } \ - { if (cnt) cnt -= 1; else print $$0; } ' > appendix.tmp - ${GRIND} -lcsh ${.CURDIR}/a2.t | awk '/\.\(\)/{ cnt = 2 } \ - { if (cnt) cnt -= 1; else print $$0; } ' >> appendix.tmp .include Added: head/share/doc/papers/sysperf/appendix.ms ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/doc/papers/sysperf/appendix.ms Wed Jan 26 19:39:31 2011 (r217893) @@ -0,0 +1,1040 @@ +.\" $FreeBSD$ +.am vS +.. +.am vE +.. +'ss 23 +'ds _ \d\(mi\u +'ps 9z +'vs 10p +'ds - \(mi +'ds / \\h'\\w' 'u-\\w'/'u'/ +'ds /* \\h'\\w' 'u-\\w'/'u'/* +'bd B 3 +'bd S B 3 +'nr cm 0 +'nf +'de vH +'ev 2 +'ft 1 +'sp .35i +'tl '\s14\f3\\*(=F\fP\s0'\\*(=H'\f3\s14\\*(=F\fP\s0' +'sp .25i +'ft 1 +\f2\s12\h'\\n(.lu-\w'\\*(=f'u'\\*(=f\fP\s0\h'|0u' +.sp .05i +'ev +'ds =G \\*(=F +.. +'de vF +'ev 2 +'sp .35i +'ie o 'tl '\f2\\*(=M''Page % of \\*(=G\fP' +'el 'tl '\f2Page % of \\*(=G''\\*(=M\fP' +'bp +'ev +'ft 1 +'if \\n(cm=1 'ft 2 +.. +'de () +'pn 1 +.. +'de +C +'nr cm 1 +'ft 2 +'ds +K +'ds -K +.. +'de -C +'nr cm 0 +'ft 1 +'ds +K \f3 +'ds -K \fP +.. +'+C +'-C +'am +C +'ne 3 +.. +'de FN +\f2\s14\h'\\n(.lu-\w'\\$1'u'\\$1\fP\s0\h'|0u'\c +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de FC +.if r x .if \\nx .if d =F .tm \\$1 \\*(=F \\n% +'ds =f \&...\\$1 +.. +'de -F +'rm =f +.. +'ft 1 +'lg 0 +'-F +.\" Copyright (c) 1985 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. All advertising materials mentioning features or use of this software +.\" must display the following acknowledgement: +.\" This product includes software developed by the University of +.\" California, Berkeley and its contributors. +.\" 4. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS 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 REGENTS 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. +.\" +.\" @(#)a1.t 5.1 (Berkeley) 4/17/91 +.\" +.ds RH Appendix A \- Benchmark sources +.nr H2 1 +.sp 2 +.de vS +.nf +.. +.de vE +.fi +.. +.bp +.SH +\s+2Appendix A \- Benchmark sources\s-2 +.LP +The programs shown here run under 4.2 with only routines +from the standard libraries. When run under 4.1 they were augmented +with a \fIgetpagesize\fP routine and a copy of the \fIrandom\fP +function from the C library. The \fIvforks\fP and \fIvexecs\fP +programs are constructed from the \fIforks\fP and \fIexecs\fP programs, +respectively, by substituting calls to \fIfork\fP with calls to +\fIvfork\fP. +.SH +syscall +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP System call overhead benchmark\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K ncalls; + +\h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K +\h'|21n'printf("usage: %s #syscalls\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'ncalls = atoi(argv[1]); +\h'|11n'\*(+Kwhile\*(-K (ncalls\*-\*- > 0) +\h'|21n'(\*(+Kvoid\*(-K) getpid(); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +csw +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Context switching benchmark\&. + \fI*\fP + \fI*\fP Force system to context switch 2\fI*\fPnsigs + \fI*\fP times by forking and exchanging signals\&. + \fI*\fP To calculate system overhead for a context + \fI*\fP switch, the signocsw program must be run + \fI*\fP with nsigs\&. Overhead is then estimated by + \fI*\fP\h'|11n't1 = time csw + \fI*\fP\h'|11n't2 = time signocsw + \fI*\fP\h'|11n'overhead = t1 \*- 2 \fI*\fP t2; + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K#include\*(-K + +\*(+Kint\*(-K\h'|11n'sigsub(); +\*(+Kint\*(-K\h'|11n'otherpid; +\*(+Kint\*(-K\h'|11n'nsigs; + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kint\*(-K pid; + +\h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K +\h'|21n'printf("usage: %s nsignals\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'nsigs = atoi(argv[1]); +\h'|11n'signal(SIGALRM, sigsub); +\h'|11n'otherpid = getpid(); +\h'|11n'pid = fork(); +\h'|11n'\*(+Kif\*(-K (pid != 0) \*(+K{\*(-K +\h'|21n'otherpid = pid; +\h'|21n'kill(otherpid, SIGALRM); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kfor\*(-K (;;) +\h'|21n'sigpause(0); +\*(+K}\*(-K\c\c +'-F + + +'FN sigsub +sigsub() +\*(+K{\*(-K + +\h'|11n'signal(SIGALRM, sigsub); +\h'|11n'kill(otherpid, SIGALRM); +\h'|11n'\*(+Kif\*(-K (\*-\*-nsigs <= 0) +\h'|21n'exit(0); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +signocsw +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Signal without context switch benchmark\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K#include\*(-K + +\*(+Kint\*(-K\h'|11n'pid; +\*(+Kint\*(-K\h'|11n'nsigs; +\*(+Kint\*(-K\h'|11n'sigsub(); + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i; + +\h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K +\h'|21n'printf("usage: %s nsignals\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'nsigs = atoi(argv[1]); +\h'|11n'signal(SIGALRM, sigsub); +\h'|11n'pid = getpid(); +\h'|11n'\*(+Kfor\*(-K (i = 0; i < nsigs; i++) +\h'|21n'kill(pid, SIGALRM); +\*(+K}\*(-K\c\c +'-F + + +'FN sigsub +sigsub() +\*(+K{\*(-K + +\h'|11n'signal(SIGALRM, sigsub); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +pipeself +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP IPC benchmark, + \fI*\fP write to self using pipes\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kchar\*(-K buf[512]; +\h'|11n'\*(+Kint\*(-K fd[2], msgsize; +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter; + +\h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K +\h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'argc\*-\*-, argv++; +\h'|11n'iter = atoi(\fI*\fPargv); +\h'|11n'argc\*-\*-, argv++; +\h'|11n'msgsize = atoi(\fI*\fPargv); +\h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K +\h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv); +\h'|21n'exit(2); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K +\h'|21n'perror("pipe"); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K +\h'|21n'write(fd[1], buf, msgsize); +\h'|21n'read(fd[0], buf, msgsize); +\h'|11n'\*(+K}\*(-K +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +pipediscard +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP IPC benchmarkl, + \fI*\fP write and discard using pipes\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kchar\*(-K buf[512]; +\h'|11n'\*(+Kint\*(-K fd[2], msgsize; +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter; + +\h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K +\h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'argc\*-\*-, argv++; +\h'|11n'iter = atoi(\fI*\fPargv); +\h'|11n'argc\*-\*-, argv++; +\h'|11n'msgsize = atoi(\fI*\fPargv); +\h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K +\h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv); +\h'|21n'exit(2); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K +\h'|21n'perror("pipe"); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (fork() == 0) +\h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) +\h'|31n'read(fd[0], buf, msgsize); +\h'|11n'\*(+Kelse\*(-K +\h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) +\h'|31n'write(fd[1], buf, msgsize); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +pipeback +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP IPC benchmark, + \fI*\fP read and reply using pipes\&. + \fI*\fP + \fI*\fP Process forks and exchanges messages + \fI*\fP over a pipe in a request\*-response fashion\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kchar\*(-K buf[512]; +\h'|11n'\*(+Kint\*(-K fd[2], fd2[2], msgsize; +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K i, iter; + +\h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K +\h'|21n'printf("usage: %s iterations message\*-size\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'argc\*-\*-, argv++; +\h'|11n'iter = atoi(\fI*\fPargv); +\h'|11n'argc\*-\*-, argv++; +\h'|11n'msgsize = atoi(\fI*\fPargv); +\h'|11n'\*(+Kif\*(-K (msgsize > \*(+Ksizeof\*(-K (buf) || msgsize <= 0) \*(+K{\*(-K +\h'|21n'printf("%s: Bad message size\&.\en", \fI*\fPargv); +\h'|21n'exit(2); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (pipe(fd) < 0) \*(+K{\*(-K +\h'|21n'perror("pipe"); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (pipe(fd2) < 0) \*(+K{\*(-K +\h'|21n'perror("pipe"); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (fork() == 0) +\h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K +\h'|31n'read(fd[0], buf, msgsize); +\h'|31n'write(fd2[1], buf, msgsize); +\h'|21n'\*(+K}\*(-K +\h'|11n'\*(+Kelse\*(-K +\h'|21n'\*(+Kfor\*(-K (i = 0; i < iter; i++) \*(+K{\*(-K +\h'|31n'write(fd[1], buf, msgsize); +\h'|31n'read(fd2[0], buf, msgsize); +\h'|21n'\*(+K}\*(-K +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +forks +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Benchmark program to calculate fork+wait + \fI*\fP overhead (approximately)\&. Process + \fI*\fP forks and exits while parent waits\&. + \fI*\fP The time to run this program is used + \fI*\fP in calculating exec overhead\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nforks, i; +\h'|11n'\*(+Kchar\*(-K \fI*\fPcp; +\h'|11n'\*(+Kint\*(-K pid, child, status, brksize; + +\h'|11n'\*(+Kif\*(-K (argc < 2) \*(+K{\*(-K +\h'|21n'printf("usage: %s number\*-of\*-forks sbrk\*-size\en", argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'nforks = atoi(argv[1]); +\h'|11n'\*(+Kif\*(-K (nforks < 0) \*(+K{\*(-K +\h'|21n'printf("%s: bad number of forks\en", argv[1]); +\h'|21n'exit(2); +\h'|11n'\*(+K}\*(-K +\h'|11n'brksize = atoi(argv[2]); +\h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K +\h'|21n'printf("%s: bad size to sbrk\en", argv[2]); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'cp = (\*(+Kchar\*(-K \fI*\fP)sbrk(brksize); +\h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K +\h'|21n'perror("sbrk"); +\h'|21n'exit(4); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024) +\h'|21n'cp[i] = i; +\h'|11n'\*(+Kwhile\*(-K (nforks\*-\*- > 0) \*(+K{\*(-K +\h'|21n'child = fork(); +\h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K +\h'|31n'perror("fork"); +\h'|31n'exit(\*-1); +\h'|21n'\*(+K}\*(-K +\h'|21n'\*(+Kif\*(-K (child == 0) +\h'|31n'\*_exit(\*-1); +\h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child) +\h'|31n'; +\h'|11n'\*(+K}\*(-K +\h'|11n'exit(0); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +execs +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Benchmark program to calculate exec + \fI*\fP overhead (approximately)\&. Process + \fI*\fP forks and execs "null" test program\&. + \fI*\fP The time to run the fork program should + \fI*\fP then be deducted from this one to + \fI*\fP estimate the overhead for the exec\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K nexecs, i; +\h'|11n'\*(+Kchar\*(-K \fI*\fPcp, \fI*\fPsbrk(); +\h'|11n'\*(+Kint\*(-K pid, child, status, brksize; + +\h'|11n'\*(+Kif\*(-K (argc < 3) \*(+K{\*(-K +\h'|21n'printf("usage: %s number\*-of\*-execs sbrk\*-size job\*-name\en", +\h'|21n' argv[0]); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'nexecs = atoi(argv[1]); +\h'|11n'\*(+Kif\*(-K (nexecs < 0) \*(+K{\*(-K +\h'|21n'printf("%s: bad number of execs\en", argv[1]); +\h'|21n'exit(2); +\h'|11n'\*(+K}\*(-K +\h'|11n'brksize = atoi(argv[2]); +\h'|11n'\*(+Kif\*(-K (brksize < 0) \*(+K{\*(-K +\h'|21n'printf("%s: bad size to sbrk\en", argv[2]); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'cp = sbrk(brksize); +\h'|11n'\*(+Kif\*(-K ((\*(+Kint\*(-K)cp == \*-1) \*(+K{\*(-K +\h'|21n'perror("sbrk"); +\h'|21n'exit(4); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kfor\*(-K (i = 0; i < brksize; i += 1024) +\h'|21n'cp[i] = i; +\h'|11n'\*(+Kwhile\*(-K (nexecs\*-\*- > 0) \*(+K{\*(-K +\h'|21n'child = fork(); +\h'|21n'\*(+Kif\*(-K (child == \*-1) \*(+K{\*(-K +\h'|31n'perror("fork"); +\h'|31n'exit(\*-1); +\h'|21n'\*(+K}\*(-K +\h'|21n'\*(+Kif\*(-K (child == 0) \*(+K{\*(-K +\h'|31n'execv(argv[3], argv); +\h'|31n'perror("execv"); +\h'|31n'\*_exit(\*-1); +\h'|21n'\*(+K}\*(-K +\h'|21n'\*(+Kwhile\*(-K ((pid = wait(&status)) != \*-1 && pid != child) +\h'|31n'; +\h'|11n'\*(+K}\*(-K +\h'|11n'exit(0); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +nulljob +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Benchmark "null job" program\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K + +\h'|11n'exit(0); +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +bigjob +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Benchmark "null big job" program\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + 250 here is intended to approximate vi\'s text+data size \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+Kchar\*(-K\h'|11n'space[1024 \fI*\fP 250] = "force into data segment"; + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K + +\h'|11n'exit(0); +\*(+K}\*(-K\c\c +'-F + +.vE +.bp +.SH +seqpage +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Sequential page access benchmark\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K#include\*(-K + +\*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc(); + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K i, niter; +\h'|11n'\*(+Kregister\*(-K \*(+Kchar\*(-K \fI*\fPpf, \fI*\fPlastpage; +\h'|11n'\*(+Kint\*(-K npages = 4096, pagesize, vflag = 0; +\h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname; + +\h'|11n'name = argv[0]; +\h'|11n'argc\*-\*-, argv++; +again: +\h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K +usage: +\h'|21n'printf("usage: %s [ \*-v ] [ \*-p #pages ] niter\en", name); +\h'|21n'exit(1); +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-p") == 0) \*(+K{\*(-K +\h'|21n'argc\*-\*-, argv++; +\h'|21n'\*(+Kif\*(-K (argc < 1) +\h'|31n'\*(+Kgoto\*(-K usage; +\h'|21n'npages = atoi(\fI*\fPargv); +\h'|21n'\*(+Kif\*(-K (npages <= 0) \*(+K{\*(-K +\h'|31n'printf("%s: Bad page count\&.\en", \fI*\fPargv); +\h'|31n'exit(2); +\h'|21n'\*(+K}\*(-K +\h'|21n'argc\*-\*-, argv++; +\h'|21n'\*(+Kgoto\*(-K again; +\h'|11n'\*(+K}\*(-K +\h'|11n'\*(+Kif\*(-K (strcmp(\fI*\fPargv, "\*-v") == 0) \*(+K{\*(-K +\h'|21n'argc\*-\*-, argv++; +\h'|21n'vflag++; +\h'|21n'\*(+Kgoto\*(-K again; +\h'|11n'\*(+K}\*(-K +\h'|11n'niter = atoi(\fI*\fPargv); +\h'|11n'pagesize = getpagesize(); +\h'|11n'pages = valloc(npages \fI*\fP pagesize); +\h'|11n'\*(+Kif\*(-K (pages == (\*(+Kchar\*(-K \fI*\fP)0) \*(+K{\*(-K +\h'|21n'printf("Can\'t allocate %d pages (%2\&.1f megabytes)\&.\en", +\h'|21n' npages, (npages \fI*\fP pagesize) \fI\h'\w' 'u-\w'/'u'/\fP (1024\&. \fI*\fP 1024\&.)); +\h'|21n'exit(3); +\h'|11n'\*(+K}\*(-K +\h'|11n'lastpage = pages + (npages \fI*\fP pagesize); +\h'|11n'\*(+Kif\*(-K (vflag) +\h'|21n'vadvise(VA\*_SEQL); +\h'|11n'\*(+Kfor\*(-K (i = 0; i < niter; i++) +\h'|21n'\*(+Kfor\*(-K (pf = pages; pf < lastpage; pf += pagesize) +\h'|31n'\fI*\fPpf = 1; +\*(+K}\*(-K\c\c +'-F + +.vE +.SH +randpage +.LP +.vS +\fI\h'\w' 'u-\w'/'u'/\fP\fI*\fP\c\c +'+C + + \fI*\fP Random page access benchmark\&. + \fI*\fP\fI\h'\w' 'u-\w'/'u'/\fP\c +'-C + +\*(+K#include\*(-K + +\*(+Kchar\*(-K\h'|11n'\fI*\fPvalloc(); +\*(+Kint\*(-K\h'|11n'rand(); + +'FN main +main(argc, argv) +\h'|11n'\*(+Kchar\*(-K \fI*\fPargv[]; +\*(+K{\*(-K +\h'|11n'\*(+Kregister\*(-K \*(+Kint\*(-K npages = 4096, pagesize, pn, i, niter; +\h'|11n'\*(+Kint\*(-K vflag = 0, debug = 0; +\h'|11n'\*(+Kchar\*(-K \fI*\fPpages, \fI*\fPname; + +\h'|11n'name = argv[0]; +\h'|11n'argc\*-\*-, argv++; +again: +\h'|11n'\*(+Kif\*(-K (argc < 1) \*(+K{\*(-K +usage: +\h'|21n'printf("usage: %s [ \*-d ] [ \*-v ] [ \*-p #pages ] niter\en", name); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 19:49:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4C87E106566C; Wed, 26 Jan 2011 19:49:04 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B4978FC1A; Wed, 26 Jan 2011 19:49:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QJn4lC087471; Wed, 26 Jan 2011 19:49:04 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QJn4ql087464; Wed, 26 Jan 2011 19:49:04 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101261949.p0QJn4ql087464@svn.freebsd.org> From: Michael Tuexen Date: Wed, 26 Jan 2011 19:49:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217894 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 19:49:06 -0000 Author: tuexen Date: Wed Jan 26 19:49:03 2011 New Revision: 217894 URL: http://svn.freebsd.org/changeset/base/217894 Log: Change infrastructure for SCTP_MAX_BURST to allow compliance with the latest socket API ID. Especially it can be disabled. Full compliance needs changing the structure used in the socket option. Since this breaks the API, it will be a seperate commit which will not be MFCed to stable/8. MFC after: 3 months. Modified: head/sys/netinet/sctp_cc_functions.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_pcb.h head/sys/netinet/sctp_structs.h head/sys/netinet/sctp_sysctl.h head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_cc_functions.c ============================================================================== --- head/sys/netinet/sctp_cc_functions.c Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_cc_functions.c Wed Jan 26 19:49:03 2011 (r217894) @@ -601,8 +601,11 @@ sctp_cwnd_update_after_packet_dropped(st * Take 1/4 of the space left or max burst up .. whichever * is less. */ - incr = min((bw_avail - *on_queue) >> 2, - stcb->asoc.max_burst * net->mtu); + incr = (bw_avail - *on_queue) >> 2; + if ((stcb->asoc.max_burst > 0) && + (stcb->asoc.max_burst * net->mtu < incr)) { + incr = stcb->asoc.max_burst * net->mtu; + } net->cwnd += incr; } if (net->cwnd > bw_avail) { Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_output.c Wed Jan 26 19:49:03 2011 (r217894) @@ -9322,7 +9322,7 @@ sctp_chunk_output(struct sctp_inpcb *inp struct sctp_association *asoc; struct sctp_nets *net; int error = 0, num_out = 0, tot_out = 0, ret = 0, reason_code = 0, - burst_cnt = 0, burst_limit = 0; + burst_cnt = 0; struct timeval now; int now_filled = 0; int nagle_on = 0; @@ -9425,12 +9425,11 @@ sctp_chunk_output(struct sctp_inpcb *inp &now, &now_filled, frag_point, so_locked); return; } - if (tot_frs > asoc->max_burst) { + if ((asoc->max_burst > 0) && (tot_frs > asoc->max_burst)) { /* Hit FR burst limit */ return; } if ((num_out == 0) && (ret == 0)) { - /* No more retrans to send */ break; } @@ -9439,7 +9438,6 @@ sctp_chunk_output(struct sctp_inpcb *inp sctp_auditing(12, inp, stcb, NULL); #endif /* Check for bad destinations, if they exist move chunks around. */ - burst_limit = asoc->max_burst; TAILQ_FOREACH(net, &asoc->nets, sctp_next) { if ((net->dest_state & SCTP_ADDR_NOT_REACHABLE) == SCTP_ADDR_NOT_REACHABLE) { @@ -9468,24 +9466,29 @@ sctp_chunk_output(struct sctp_inpcb *inp * { burst_limit = asoc->max_burst * * SCTP_SAT_NETWORK_BURST_INCR; } */ - if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { - if ((net->flight_size + (burst_limit * net->mtu)) < net->cwnd) { - /* - * JRS - Use the congestion control - * given in the congestion control - * module - */ - asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, burst_limit); - if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { - sctp_log_maxburst(stcb, net, 0, burst_limit, SCTP_MAX_BURST_APPLIED); + if (asoc->max_burst > 0) { + if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst)) { + if ((net->flight_size + (asoc->max_burst * net->mtu)) < net->cwnd) { + /* + * JRS - Use the congestion + * control given in the + * congestion control module + */ + asoc->cc_functions.sctp_cwnd_update_after_output(stcb, net, asoc->max_burst); + if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { + sctp_log_maxburst(stcb, net, 0, asoc->max_burst, SCTP_MAX_BURST_APPLIED); + } + SCTP_STAT_INCR(sctps_maxburstqueued); + } + net->fast_retran_ip = 0; + } else { + if (net->flight_size == 0) { + /* + * Should be decaying the + * cwnd here + */ + ; } - SCTP_STAT_INCR(sctps_maxburstqueued); - } - net->fast_retran_ip = 0; - } else { - if (net->flight_size == 0) { - /* Should be decaying the cwnd here */ - ; } } } @@ -9540,11 +9543,13 @@ sctp_chunk_output(struct sctp_inpcb *inp /* Nothing left to send */ break; } - } while (num_out && (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || - (burst_cnt < burst_limit))); + } while (num_out && + ((asoc->max_burst == 0) || + SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) || + (burst_cnt < asoc->max_burst))); if (SCTP_BASE_SYSCTL(sctp_use_cwnd_based_maxburst) == 0) { - if (burst_cnt >= burst_limit) { + if ((asoc->max_burst > 0) && (burst_cnt >= asoc->max_burst)) { SCTP_STAT_INCR(sctps_maxburstqueued); asoc->burst_limit_applied = 1; if (SCTP_BASE_SYSCTL(sctp_logging_level) & SCTP_LOG_MAXBURST_ENABLE) { Modified: head/sys/netinet/sctp_pcb.h ============================================================================== --- head/sys/netinet/sctp_pcb.h Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_pcb.h Wed Jan 26 19:49:03 2011 (r217894) @@ -317,7 +317,7 @@ struct sctp_pcb { uint32_t initial_sequence_debug; uint32_t adaptation_layer_indicator; uint32_t store_at; - uint8_t max_burst; + uint32_t max_burst; char current_secret_number; char last_secret_number; }; Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_structs.h Wed Jan 26 19:49:03 2011 (r217894) @@ -1058,7 +1058,7 @@ struct sctp_association { uint8_t send_sack; /* max burst after fast retransmit completes */ - uint8_t max_burst; + uint32_t max_burst; uint8_t sat_network; /* RTT is in range of sat net or greater */ uint8_t sat_network_lockout; /* lockout code */ Modified: head/sys/netinet/sctp_sysctl.h ============================================================================== --- head/sys/netinet/sctp_sysctl.h Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_sysctl.h Wed Jan 26 19:49:03 2011 (r217894) @@ -184,7 +184,7 @@ struct sctp_sysctl { /* maxburst: Default max burst for sctp endpoints */ #define SCTPCTL_MAXBURST_DESC "Default max burst for sctp endpoints" -#define SCTPCTL_MAXBURST_MIN 1 +#define SCTPCTL_MAXBURST_MIN 0 #define SCTPCTL_MAXBURST_MAX 0xFFFFFFFF #define SCTPCTL_MAXBURST_DEFAULT SCTP_DEF_MAX_BURST Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:39:31 2011 (r217893) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:49:03 2011 (r217894) @@ -1972,7 +1972,11 @@ flags_out: SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize); SCTP_INP_RLOCK(inp); - *value = inp->sctp_ep.max_burst; + if (inp->sctp_ep.max_burst < 256) { + *value = inp->sctp_ep.max_burst; + } else { + *value = 255; + } SCTP_INP_RUNLOCK(inp); *optsize = sizeof(uint8_t); } @@ -3591,9 +3595,7 @@ sctp_setopt(struct socket *so, int optna SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize); SCTP_INP_WLOCK(inp); - if (*burst) { - inp->sctp_ep.max_burst = *burst; - } + inp->sctp_ep.max_burst = *burst; SCTP_INP_WUNLOCK(inp); } break; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 19:55:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 588C5106567A; Wed, 26 Jan 2011 19:55:54 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 480248FC0A; Wed, 26 Jan 2011 19:55:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QJtsga087740; Wed, 26 Jan 2011 19:55:54 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QJtssi087738; Wed, 26 Jan 2011 19:55:54 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101261955.p0QJtssi087738@svn.freebsd.org> From: Michael Tuexen Date: Wed, 26 Jan 2011 19:55:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217895 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 19:55:54 -0000 Author: tuexen Date: Wed Jan 26 19:55:54 2011 New Revision: 217895 URL: http://svn.freebsd.org/changeset/base/217895 Log: Make SCTP_MAX_BURST compliant with the latest version of the socket API ID. This is not compatible with the API in stable/8. Modified: head/sys/netinet/sctp_usrreq.c Modified: head/sys/netinet/sctp_usrreq.c ============================================================================== --- head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:49:03 2011 (r217894) +++ head/sys/netinet/sctp_usrreq.c Wed Jan 26 19:55:54 2011 (r217895) @@ -1967,18 +1967,21 @@ flags_out: break; case SCTP_MAX_BURST: { - uint8_t *value; + struct sctp_assoc_value *av; - SCTP_CHECK_AND_CAST(value, optval, uint8_t, *optsize); + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, *optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); - SCTP_INP_RLOCK(inp); - if (inp->sctp_ep.max_burst < 256) { - *value = inp->sctp_ep.max_burst; + if (stcb) { + av->assoc_value = stcb->asoc.max_burst; + SCTP_TCB_UNLOCK(stcb); } else { - *value = 255; + SCTP_INP_RLOCK(inp); + av->assoc_value = inp->sctp_ep.max_burst; + SCTP_INP_RUNLOCK(inp); } - SCTP_INP_RUNLOCK(inp); - *optsize = sizeof(uint8_t); + *optsize = sizeof(struct sctp_assoc_value); + } break; case SCTP_MAXSEG: @@ -3590,13 +3593,19 @@ sctp_setopt(struct socket *so, int optna break; case SCTP_MAX_BURST: { - uint8_t *burst; + struct sctp_assoc_value *av; - SCTP_CHECK_AND_CAST(burst, optval, uint8_t, optsize); + SCTP_CHECK_AND_CAST(av, optval, struct sctp_assoc_value, optsize); + SCTP_FIND_STCB(inp, stcb, av->assoc_id); - SCTP_INP_WLOCK(inp); - inp->sctp_ep.max_burst = *burst; - SCTP_INP_WUNLOCK(inp); + if (stcb) { + stcb->asoc.max_burst = av->assoc_value; + SCTP_TCB_UNLOCK(stcb); + } else { + SCTP_INP_WLOCK(inp); + inp->sctp_ep.max_burst = av->assoc_value; + SCTP_INP_WUNLOCK(inp); + } } break; case SCTP_MAXSEG: From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:03:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA5F81065670; Wed, 26 Jan 2011 20:03:58 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 975C68FC12; Wed, 26 Jan 2011 20:03:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QK3w6D088024; Wed, 26 Jan 2011 20:03:58 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QK3wmY088010; Wed, 26 Jan 2011 20:03:58 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101262003.p0QK3wmY088010@svn.freebsd.org> From: Dmitry Chagin Date: Wed, 26 Jan 2011 20:03:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217896 - in head/sys: amd64/amd64 amd64/linux32 compat/linprocfs fs/procfs i386/linux kern powerpc/aim powerpc/powerpc sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:03:58 -0000 Author: dchagin Date: Wed Jan 26 20:03:58 2011 New Revision: 217896 URL: http://svn.freebsd.org/changeset/base/217896 Log: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month Modified: head/sys/amd64/amd64/vm_machdep.c head/sys/amd64/linux32/linux32_machdep.c head/sys/compat/linprocfs/linprocfs.c head/sys/fs/procfs/procfs_dbregs.c head/sys/fs/procfs/procfs_fpregs.c head/sys/fs/procfs/procfs_map.c head/sys/fs/procfs/procfs_regs.c head/sys/i386/linux/linux_machdep.c head/sys/kern/kern_jail.c head/sys/kern/sys_process.c head/sys/powerpc/aim/trap.c head/sys/powerpc/powerpc/exec_machdep.c head/sys/sys/sysent.h Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/amd64/amd64/vm_machdep.c Wed Jan 26 20:03:58 2011 (r217896) @@ -445,7 +445,7 @@ cpu_set_upcall_kse(struct thread *td, vo cpu_thread_clean(td); #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { /* * Set the trap frame to point at the beginning of the uts * function. @@ -498,7 +498,7 @@ cpu_set_user_tls(struct thread *td, void pcb = td->td_pcb; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { pcb->pcb_gsbase = (register_t)tls_base; return (0); } Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/amd64/linux32/linux32_machdep.c Wed Jan 26 20:03:58 2011 (r217896) @@ -131,7 +131,7 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL. */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) error = linux_proc_init(td, 0, 0); return (error); } Modified: head/sys/compat/linprocfs/linprocfs.c ============================================================================== --- head/sys/compat/linprocfs/linprocfs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/compat/linprocfs/linprocfs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -928,7 +928,7 @@ do { \ #ifdef COMPAT_FREEBSD32 env_vector32 = NULL; - if ((p->p_sysent->sv_flags & SV_ILP32) != 0) { + if (SV_PROC_FLAG(p, SV_ILP32) != 0) { env_vector32 = malloc(sizeof(*env_vector32) * MAX_ARGV_STR, M_TEMP, M_WAITOK); elm_len = sizeof(int32_t); Modified: head/sys/fs/procfs/procfs_dbregs.c ============================================================================== --- head/sys/fs/procfs/procfs_dbregs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_dbregs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -107,7 +107,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: head/sys/fs/procfs/procfs_fpregs.c ============================================================================== --- head/sys/fs/procfs/procfs_fpregs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_fpregs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -106,7 +106,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: head/sys/fs/procfs/procfs_map.c ============================================================================== --- head/sys/fs/procfs/procfs_map.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_map.c Wed Jan 26 20:03:58 2011 (r217896) @@ -100,8 +100,8 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 - if (curproc->p_sysent->sv_flags & SV_ILP32) { - if (!(p->p_sysent->sv_flags & SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (!(SV_PROC_FLAG(p, SV_ILP32))) return (EOPNOTSUPP); wrap32 = 1; } Modified: head/sys/fs/procfs/procfs_regs.c ============================================================================== --- head/sys/fs/procfs/procfs_regs.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/fs/procfs/procfs_regs.c Wed Jan 26 20:03:58 2011 (r217896) @@ -106,7 +106,7 @@ procfs_doprocregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { PROC_UNLOCK(p); return (EINVAL); } Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/i386/linux/linux_machdep.c Wed Jan 26 20:03:58 2011 (r217896) @@ -146,8 +146,8 @@ linux_execve(struct thread *td, struct l * linux_proc_init, this leads to a panic on KASSERT * because such process has p->p_emuldata == NULL */ - if (td->td_proc->p_sysent == &elf_linux_sysvec) - error = linux_proc_init(td, 0, 0); + if (SV_PROC_ABI(td->td_proc) == SV_ABI_LINUX) + error = linux_proc_init(td, 0, 0); return (error); } Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/kern/kern_jail.c Wed Jan 26 20:03:58 2011 (r217896) @@ -745,7 +745,7 @@ kern_jail_set(struct thread *td, struct } #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32; error = vfs_copyopt(opts, "host.hostid", &hid32, sizeof(hid32)); @@ -1972,7 +1972,7 @@ kern_jail_get(struct thread *td, struct if (error != 0 && error != ENOENT) goto done_deref; #ifdef COMPAT_FREEBSD32 - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { uint32_t hid32 = pr->pr_hostid; error = vfs_setopt(opts, "host.hostid", &hid32, sizeof(hid32)); Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/kern/sys_process.c Wed Jan 26 20:03:58 2011 (r217896) @@ -727,7 +727,7 @@ kern_ptrace(struct thread *td, int req, * Set the wrap controls accordingly. */ if (SV_CURPROC_FLAG(SV_ILP32)) { - if (td2->td_proc->p_sysent->sv_flags & SV_ILP32) + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32)) safe = 1; wrap32 = 1; } Modified: head/sys/powerpc/aim/trap.c ============================================================================== --- head/sys/powerpc/aim/trap.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/powerpc/aim/trap.c Wed Jan 26 20:03:58 2011 (r217896) @@ -389,7 +389,7 @@ cpu_fetch_syscall_args(struct thread *td * so as to maintain quad alignment * for the rest of the args. */ - if (p->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(p, SV_ILP32)) { params += sizeof(register_t); sa->code = *(register_t *) params; params += sizeof(register_t); @@ -410,7 +410,7 @@ cpu_fetch_syscall_args(struct thread *td sa->narg = sa->callp->sy_narg; - if (p->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(p, SV_ILP32)) { argsz = sizeof(uint32_t); for (i = 0; i < n; i++) @@ -430,7 +430,7 @@ cpu_fetch_syscall_args(struct thread *td error = 0; #ifdef __powerpc64__ - if (p->p_sysent->sv_flags & SV_ILP32 && sa->narg > n) { + if (SV_PROC_FLAG(p, SV_ILP32) && sa->narg > n) { /* Expand the size of arguments copied from the stack */ for (i = sa->narg; i >= n; i--) Modified: head/sys/powerpc/powerpc/exec_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/powerpc/powerpc/exec_machdep.c Wed Jan 26 20:03:58 2011 (r217896) @@ -156,7 +156,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, #endif #ifdef COMPAT_FREEBSD32 - if (p->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(p, SV_ILP32)) { siginfo_to_siginfo32(&ksi->ksi_info, &siginfo32); sig = siginfo32.si_signo; code = siginfo32.si_code; @@ -251,7 +251,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, tf->fixreg[FIRSTARG] = sig; #ifdef COMPAT_FREEBSD32 tf->fixreg[FIRSTARG+2] = (register_t)usfp + - ((p->p_sysent->sv_flags & SV_ILP32) ? + ((SV_PROC_FLAG(p, SV_ILP32)) ? offsetof(struct sigframe32, sf_uc) : offsetof(struct sigframe, sf_uc)); #else @@ -263,7 +263,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, * Signal handler installed with SA_SIGINFO. */ #ifdef COMPAT_FREEBSD32 - if (p->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(p, SV_ILP32)) { sf32.sf_si = siginfo32; tf->fixreg[FIRSTARG+1] = (register_t)usfp + offsetof(struct sigframe32, sf_si); @@ -871,7 +871,7 @@ cpu_set_syscall_retval(struct thread *td tf = td->td_frame; if (tf->fixreg[0] == SYS___syscall && - (p->p_sysent->sv_flags & SV_ILP32)) { + (SV_PROC_FLAG(p, SV_ILP32))) { int code = tf->fixreg[FIRSTARG + 1]; if (p->p_sysent->sv_mask) code &= p->p_sysent->sv_mask; @@ -944,7 +944,7 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - if (td->td_proc->p_sysent->sv_flags & SV_LP64) + if (SV_PROC_FLAG(td->td_proc, SV_LP64)) td->td_frame->fixreg[13] = (register_t)tls_base + 0x7010; else td->td_frame->fixreg[2] = (register_t)tls_base + 0x7008; @@ -1011,7 +1011,7 @@ cpu_set_upcall_kse(struct thread *td, vo tf->fixreg[1] = (register_t)sp; tf->fixreg[3] = (register_t)arg; - if (td->td_proc->p_sysent->sv_flags & SV_ILP32) { + if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { tf->srr0 = (register_t)entry; #ifdef AIM tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT; Modified: head/sys/sys/sysent.h ============================================================================== --- head/sys/sys/sysent.h Wed Jan 26 19:55:54 2011 (r217895) +++ head/sys/sys/sysent.h Wed Jan 26 20:03:58 2011 (r217896) @@ -129,8 +129,10 @@ struct sysentvec { #define SV_SHP 0x010000 #define SV_ABI_MASK 0xff -#define SV_CURPROC_FLAG(x) (curproc->p_sysent->sv_flags & (x)) -#define SV_CURPROC_ABI() (curproc->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_PROC_FLAG(p, x) ((p)->p_sysent->sv_flags & (x)) +#define SV_PROC_ABI(p) ((p)->p_sysent->sv_flags & SV_ABI_MASK) +#define SV_CURPROC_FLAG(x) SV_PROC_FLAG(curproc, x) +#define SV_CURPROC_ABI() SV_PROC_ABI(curproc) /* same as ELFOSABI_XXX, to prevent header pollution */ #define SV_ABI_LINUX 3 #define SV_ABI_FREEBSD 9 From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:08:53 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8A451065673; Wed, 26 Jan 2011 20:08:53 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CEF58FC12; Wed, 26 Jan 2011 20:08:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QK8rH5088171; Wed, 26 Jan 2011 20:08:53 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QK8rUt088168; Wed, 26 Jan 2011 20:08:53 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262008.p0QK8rUt088168@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217897 - in stable/8/sys/dev: aac mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:08:53 -0000 Author: jhb Date: Wed Jan 26 20:08:53 2011 New Revision: 217897 URL: http://svn.freebsd.org/changeset/base/217897 Log: MFC 216235,216236: When masking direct and processor devices during an inquiry, properly preserve the upper bits of the first data byte. Modified: stable/8/sys/dev/aac/aac_cam.c stable/8/sys/dev/mfi/mfi_cam.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/aac/aac_cam.c ============================================================================== --- stable/8/sys/dev/aac/aac_cam.c Wed Jan 26 20:03:58 2011 (r217896) +++ stable/8/sys/dev/aac/aac_cam.c Wed Jan 26 20:08:53 2011 (r217897) @@ -587,7 +587,8 @@ aac_cam_complete(struct aac_command *cm) (device == T_PROCESSOR) || (sc->flags & AAC_FLAGS_CAM_PASSONLY)) ccb->csio.data_ptr[0] = - ((device & 0xe0) | T_NODEVICE); + ((ccb->csio.data_ptr[0] & 0xe0) | + T_NODEVICE); } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && ccb->ccb_h.target_lun != 0) { /* fix for INQUIRYs on Lun>0 */ Modified: stable/8/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/8/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:03:58 2011 (r217896) +++ stable/8/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:08:53 2011 (r217897) @@ -340,14 +340,14 @@ mfip_done(struct mfi_command *cm) ccbh->status = CAM_REQ_CMP; csio->scsi_status = pt->header.scsi_status; if (ccbh->flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; + command = csio->cdb_io.cdb_ptr[0]; else - command = ccb->csio.cdb_io.cdb_bytes[0]; + command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { - device = ccb->csio.data_ptr[0] & 0x1f; + device = csio->data_ptr[0] & 0x1f; if ((device == T_DIRECT) || (device == T_PROCESSOR)) csio->data_ptr[0] = - (device & 0xe0) | T_NODEVICE; + (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } break; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:09:08 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C96721065679; Wed, 26 Jan 2011 20:09:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DEEB8FC13; Wed, 26 Jan 2011 20:09:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QK98hc088218; Wed, 26 Jan 2011 20:09:08 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QK986U088215; Wed, 26 Jan 2011 20:09:08 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262009.p0QK986U088215@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:09:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217898 - in stable/7/sys/dev: aac mfi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:09:08 -0000 Author: jhb Date: Wed Jan 26 20:09:08 2011 New Revision: 217898 URL: http://svn.freebsd.org/changeset/base/217898 Log: MFC 216235,216236: When masking direct and processor devices during an inquiry, properly preserve the upper bits of the first data byte. Modified: stable/7/sys/dev/aac/aac_cam.c stable/7/sys/dev/mfi/mfi_cam.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/aac/aac_cam.c ============================================================================== --- stable/7/sys/dev/aac/aac_cam.c Wed Jan 26 20:08:53 2011 (r217897) +++ stable/7/sys/dev/aac/aac_cam.c Wed Jan 26 20:09:08 2011 (r217898) @@ -539,7 +539,8 @@ aac_cam_complete(struct aac_command *cm) (device == T_PROCESSOR) || (sc->flags & AAC_FLAGS_CAM_PASSONLY)) ccb->csio.data_ptr[0] = - ((device & 0xe0) | T_NODEVICE); + ((ccb->csio.data_ptr[0] & 0xe0) | + T_NODEVICE); } else if (ccb->ccb_h.status == CAM_SEL_TIMEOUT && ccb->ccb_h.target_lun != 0) { /* fix for INQUIRYs on Lun>0 */ Modified: stable/7/sys/dev/mfi/mfi_cam.c ============================================================================== --- stable/7/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:08:53 2011 (r217897) +++ stable/7/sys/dev/mfi/mfi_cam.c Wed Jan 26 20:09:08 2011 (r217898) @@ -340,14 +340,14 @@ mfip_done(struct mfi_command *cm) ccbh->status = CAM_REQ_CMP; csio->scsi_status = pt->header.scsi_status; if (ccbh->flags & CAM_CDB_POINTER) - command = ccb->csio.cdb_io.cdb_ptr[0]; + command = csio->cdb_io.cdb_ptr[0]; else - command = ccb->csio.cdb_io.cdb_bytes[0]; + command = csio->cdb_io.cdb_bytes[0]; if (command == INQUIRY) { - device = ccb->csio.data_ptr[0] & 0x1f; + device = csio->data_ptr[0] & 0x1f; if ((device == T_DIRECT) || (device == T_PROCESSOR)) csio->data_ptr[0] = - (device & 0xe0) | T_NODEVICE; + (csio->data_ptr[0] & 0xe0) | T_NODEVICE; } break; } From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:14:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 052B41065695; Wed, 26 Jan 2011 20:14:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE0258FC29; Wed, 26 Jan 2011 20:14:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKE3OY088385; Wed, 26 Jan 2011 20:14:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKE3tu088383; Wed, 26 Jan 2011 20:14:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262014.p0QKE3tu088383@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:14:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217899 - stable/8/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:14:04 -0000 Author: jhb Date: Wed Jan 26 20:14:03 2011 New Revision: 217899 URL: http://svn.freebsd.org/changeset/base/217899 Log: MFC 216334: When reopening a stream backed by an open file descriptor, do not close the existing file descriptor. Instead, let dup2() atomically close the old file descriptor when assigning the newly opened file to the same descriptor. This closes a race in a multithreaded application where a concurrent open() could allocate the existing file descriptor in between the calls to close() and dup2(). Modified: stable/8/lib/libc/stdio/freopen.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdio/freopen.c ============================================================================== --- stable/8/lib/libc/stdio/freopen.c Wed Jan 26 20:09:08 2011 (r217898) +++ stable/8/lib/libc/stdio/freopen.c Wed Jan 26 20:14:03 2011 (r217899) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:14:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81DC31065670; Wed, 26 Jan 2011 20:14:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 568AD8FC21; Wed, 26 Jan 2011 20:14:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKECik088425; Wed, 26 Jan 2011 20:14:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKECiT088423; Wed, 26 Jan 2011 20:14:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262014.p0QKECiT088423@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:14:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217900 - stable/7/lib/libc/stdio X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:14:12 -0000 Author: jhb Date: Wed Jan 26 20:14:12 2011 New Revision: 217900 URL: http://svn.freebsd.org/changeset/base/217900 Log: MFC 216334: When reopening a stream backed by an open file descriptor, do not close the existing file descriptor. Instead, let dup2() atomically close the old file descriptor when assigning the newly opened file to the same descriptor. This closes a race in a multithreaded application where a concurrent open() could allocate the existing file descriptor in between the calls to close() and dup2(). Modified: stable/7/lib/libc/stdio/freopen.c Directory Properties: stable/7/lib/libc/ (props changed) stable/7/lib/libc/stdtime/ (props changed) Modified: stable/7/lib/libc/stdio/freopen.c ============================================================================== --- stable/7/lib/libc/stdio/freopen.c Wed Jan 26 20:14:03 2011 (r217899) +++ stable/7/lib/libc/stdio/freopen.c Wed Jan 26 20:14:12 2011 (r217900) @@ -150,14 +150,6 @@ freopen(file, mode, fp) /* Get a new descriptor to refer to the new file. */ f = _open(file, oflags, DEFFILEMODE); - if (f < 0 && isopen) { - /* If out of fd's close the old one and try again. */ - if (errno == ENFILE || errno == EMFILE) { - (void) (*fp->_close)(fp->_cookie); - isopen = 0; - f = _open(file, oflags, DEFFILEMODE); - } - } sverrno = errno; finish: @@ -165,9 +157,11 @@ finish: * Finish closing fp. Even if the open succeeded above, we cannot * keep fp->_base: it may be the wrong size. This loses the effect * of any setbuffer calls, but stdio has always done this before. + * + * Leave the existing file descriptor open until dup2() is called + * below to avoid races where a concurrent open() in another thread + * could claim the existing descriptor. */ - if (isopen) - (void) (*fp->_close)(fp->_cookie); if (fp->_flags & __SMBF) free((char *)fp->_bf._base); fp->_w = 0; @@ -186,6 +180,8 @@ finish: memset(&fp->_extra->mbstate, 0, sizeof(mbstate_t)); if (f < 0) { /* did not get it after all */ + if (isopen) + (void) (*fp->_close)(fp->_cookie); fp->_flags = 0; /* set it free */ FUNLOCKFILE(fp); errno = sverrno; /* restore in case _close clobbered */ @@ -197,11 +193,12 @@ finish: * to maintain the descriptor. Various C library routines (perror) * assume stderr is always fd STDERR_FILENO, even if being freopen'd. */ - if (wantfd >= 0 && f != wantfd) { + if (wantfd >= 0) { if (_dup2(f, wantfd) >= 0) { (void)_close(f); f = wantfd; - } + } else + (void)_close(fp->_file); } /* From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:18:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8022C106564A; Wed, 26 Jan 2011 20:18:56 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54B8C8FC12; Wed, 26 Jan 2011 20:18:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKIufw088656; Wed, 26 Jan 2011 20:18:56 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKIu8c088655; Wed, 26 Jan 2011 20:18:56 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262018.p0QKIu8c088655@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:18:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217901 - in stable/8/lib/libc: . locale stdtime sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:18:56 -0000 Author: jhb Date: Wed Jan 26 20:18:56 2011 New Revision: 217901 URL: http://svn.freebsd.org/changeset/base/217901 Log: Cleanup mergeinfo a bit. Modified: Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:25:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 699A3106566C; Wed, 26 Jan 2011 20:25:40 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D108FC0A; Wed, 26 Jan 2011 20:25:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKPeTA088877; Wed, 26 Jan 2011 20:25:40 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKPeKd088874; Wed, 26 Jan 2011 20:25:40 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101262025.p0QKPeKd088874@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 26 Jan 2011 20:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217902 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:25:40 -0000 Author: yongari Date: Wed Jan 26 20:25:40 2011 New Revision: 217902 URL: http://svn.freebsd.org/changeset/base/217902 Log: Do not use interrupt taskqueue on controllers with MSI/MSI-X capability. One of reason using interrupt taskqueue in re(4) was to reduce number of TX/RX interrupts under load because re(4) controllers have no good TX/RX interrupt moderation mechanism. Basic TX interrupt moderation is done by hardware for most controllers but RX interrupt moderation through undocumented register showed poor RX performance so it was disabled in r215025. Using taskqueue to handle RX interrupt greatly reduced number of interrupts but re(4) consumed all available CPU cycles to run the taskqueue under high TX/RX network load. This can happen even with RTL810x fast ethernet controller and I believe this is not acceptable for most systems. To mitigate the issue, use one-shot timer register to moderate RX interrupts. The timer register provides programmable one-shot timer and can be used to suppress interrupt generation. The timer runs at 125MHZ on PCIe controllers so the minimum time allowed for the timer is 8ns. Data sheet says the register is 32 bits but experimentation shows only lower 13 bits are valid so maximum time that can be programmed is 65.528us. This yields theoretical maximum number of RX interrupts that could be generated per second is about 15260. Combined with TX completion interrupts re(4) shall generate less than 20k interrupts. This number is still slightly high compared to other intelligent ethernet controllers but system is very responsive even under high network load. Introduce sysctl variable dev.re.%d.int_rx_mod that controls amount of time to delay RX interrupt processing in units of us. Value 0 completely disables RX interrupt moderation. To provide old behavior for controllers that have MSI/MSI-X capability, introduce a new tunable hw.re.intr_filter. If the tunable is set to non-zero value, driver will use interrupt taskqueue. The default value of the tunable is 0. This tunable has no effect on controllers that has no MSI/MSI-X capability or if MSI/MSI-X is explicitly disabled by administrator. While I'm here cleanup interrupt setup/teardown since re(4) uses single MSI/MSI-X message at this moment. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Jan 26 20:18:56 2011 (r217901) +++ head/sys/dev/re/if_re.c Wed Jan 26 20:25:40 2011 (r217902) @@ -157,6 +157,8 @@ MODULE_DEPEND(re, miibus, 1, 1, 1); #include "miibus_if.h" /* Tunables. */ +static int intr_filter = 0; +TUNABLE_INT("hw.re.intr_filter", &intr_filter); static int msi_disable = 0; TUNABLE_INT("hw.re.msi_disable", &msi_disable); static int msix_disable = 0; @@ -253,6 +255,7 @@ static int re_poll (struct ifnet *, enu static int re_poll_locked (struct ifnet *, enum poll_cmd, int); #endif static int re_intr (void *); +static void re_intr_msi (void *); static void re_tick (void *); static void re_int_task (void *, int); static void re_start (struct ifnet *); @@ -290,6 +293,8 @@ static int re_diag (struct rl_softc *); static void re_add_sysctls (struct rl_softc *); static int re_sysctl_stats (SYSCTL_HANDLER_ARGS); +static int sysctl_int_range (SYSCTL_HANDLER_ARGS, int, int); +static int sysctl_hw_re_int_mod (SYSCTL_HANDLER_ARGS); static device_method_t re_methods[] = { /* Device interface */ @@ -1574,19 +1579,19 @@ re_attach(device_t dev) } #endif +#ifdef RE_TX_MODERATION + intr_filter = 1; +#endif /* Hook interrupt last to avoid having to lock softc */ - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + error = bus_setup_intr(dev, sc->rl_irq[0], + INTR_TYPE_NET | INTR_MPSAFE, NULL, re_intr_msi, sc, + &sc->rl_intrhand[0]); + } else { error = bus_setup_intr(dev, sc->rl_irq[0], INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, &sc->rl_intrhand[0]); - else { - for (i = 0; i < RL_MSI_MESSAGES; i++) { - error = bus_setup_intr(dev, sc->rl_irq[i], - INTR_TYPE_NET | INTR_MPSAFE, re_intr, NULL, sc, - &sc->rl_intrhand[i]); - if (error != 0) - break; - } } if (error) { device_printf(dev, "couldn't set up irq\n"); @@ -1657,31 +1662,22 @@ re_detach(device_t dev) * stopped here. */ - for (i = 0; i < RL_MSI_MESSAGES; i++) { - if (sc->rl_intrhand[i] != NULL) { - bus_teardown_intr(dev, sc->rl_irq[i], - sc->rl_intrhand[i]); - sc->rl_intrhand[i] = NULL; - } + if (sc->rl_intrhand[0] != NULL) { + bus_teardown_intr(dev, sc->rl_irq[0], sc->rl_intrhand[0]); + sc->rl_intrhand[0] = NULL; } if (ifp != NULL) if_free(ifp); - if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) { - if (sc->rl_irq[0] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, 0, - sc->rl_irq[0]); - sc->rl_irq[0] = NULL; - } - } else { - for (i = 0, rid = 1; i < RL_MSI_MESSAGES; i++, rid++) { - if (sc->rl_irq[i] != NULL) { - bus_release_resource(dev, SYS_RES_IRQ, rid, - sc->rl_irq[i]); - sc->rl_irq[i] = NULL; - } - } - pci_release_msi(dev); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + rid = 0; + else + rid = 1; + if (sc->rl_irq[0] != NULL) { + bus_release_resource(dev, SYS_RES_IRQ, rid, sc->rl_irq[0]); + sc->rl_irq[0] = NULL; } + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0) + pci_release_msi(dev); if (sc->rl_res_pba) { rid = PCIR_BAR(4); bus_release_resource(dev, SYS_RES_MEMORY, rid, sc->rl_res_pba); @@ -1970,6 +1966,7 @@ re_rx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -1993,6 +1990,7 @@ re_jrx_list_init(struct rl_softc *sc) sc->rl_ldata.rl_rx_prodidx = 0; sc->rl_head = sc->rl_tail = NULL; + sc->rl_int_rx_act = 0; return (0); } @@ -2478,6 +2476,87 @@ re_int_task(void *arg, int npending) CSR_WRITE_2(sc, RL_IMR, RL_INTRS_CPLUS); } +static void +re_intr_msi(void *xsc) +{ + struct rl_softc *sc; + struct ifnet *ifp; + uint16_t intrs, status; + + sc = xsc; + RL_LOCK(sc); + + ifp = sc->rl_ifp; +#ifdef DEVICE_POLLING + if (ifp->if_capenable & IFCAP_POLLING) { + RL_UNLOCK(sc); + return; + } +#endif + /* Disable interrupts. */ + CSR_WRITE_2(sc, RL_IMR, 0); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) { + RL_UNLOCK(sc); + return; + } + + intrs = RL_INTRS_CPLUS; + status = CSR_READ_2(sc, RL_ISR); + CSR_WRITE_2(sc, RL_ISR, status); + if (sc->rl_int_rx_act > 0) { + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + status &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | RL_ISR_FIFO_OFLOW | + RL_ISR_RX_OVERRUN); + } + + if (status & (RL_ISR_TIMEOUT_EXPIRED | RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) { + re_rxeof(sc, NULL); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (sc->rl_int_rx_mod != 0 && + (status & (RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN)) != 0) { + /* Rearm one-shot timer. */ + CSR_WRITE_4(sc, RL_TIMERCNT, 1); + intrs &= ~(RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN); + sc->rl_int_rx_act = 1; + } else { + intrs |= RL_ISR_RX_OK | RL_ISR_RX_ERR | + RL_ISR_FIFO_OFLOW | RL_ISR_RX_OVERRUN; + sc->rl_int_rx_act = 0; + } + } + } + + /* + * Some chips will ignore a second TX request issued + * while an existing transmission is in progress. If + * the transmitter goes idle but there are still + * packets waiting to be sent, we need to restart the + * channel here to flush them out. This only seems to + * be required with the PCIe devices. + */ + if ((status & (RL_ISR_TX_OK | RL_ISR_TX_DESC_UNAVAIL)) && + (sc->rl_flags & RL_FLAG_PCIE)) + CSR_WRITE_1(sc, sc->rl_txstart, RL_TXSTART_START); + if (status & (RL_ISR_TX_OK | RL_ISR_TX_ERR | RL_ISR_TX_DESC_UNAVAIL)) + re_txeof(sc); + + if (status & RL_ISR_SYSTEM_ERR) { + ifp->if_drv_flags &= ~IFF_DRV_RUNNING; + re_init_locked(sc); + } + + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { + if (!IFQ_DRV_IS_EMPTY(&ifp->if_snd)) + re_start_locked(ifp); + CSR_WRITE_2(sc, RL_IMR, intrs); + } + RL_UNLOCK(sc); +} + static int re_encap(struct rl_softc *sc, struct mbuf **m_head) { @@ -3007,18 +3086,35 @@ re_init_locked(struct rl_softc *sc) CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB|RL_CMD_RX_ENB); #endif -#ifdef RE_TX_MODERATION /* * Initialize the timer interrupt register so that * a timer interrupt will be generated once the timer * reaches a certain number of ticks. The timer is - * reloaded on each transmit. This gives us TX interrupt + * reloaded on each transmit. + */ +#ifdef RE_TX_MODERATION + /* + * Use timer interrupt register to moderate TX interrupt * moderation, which dramatically improves TX frame rate. */ if (sc->rl_type == RL_8169) CSR_WRITE_4(sc, RL_TIMERINT_8169, 0x800); else CSR_WRITE_4(sc, RL_TIMERINT, 0x400); +#else + /* + * Use timer interrupt register to moderate RX interrupt + * moderation. + */ + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) != 0 && + intr_filter == 0) { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, + RL_USECS(sc->rl_int_rx_mod)); + } else { + if (sc->rl_type == RL_8169) + CSR_WRITE_4(sc, RL_TIMERINT_8169, RL_USECS(0)); + } #endif /* @@ -3535,6 +3631,7 @@ re_add_sysctls(struct rl_softc *sc) { struct sysctl_ctx_list *ctx; struct sysctl_oid_list *children; + int error; ctx = device_get_sysctl_ctx(sc->rl_dev); children = SYSCTL_CHILDREN(device_get_sysctl_tree(sc->rl_dev)); @@ -3542,6 +3639,26 @@ re_add_sysctls(struct rl_softc *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "stats", CTLTYPE_INT | CTLFLAG_RW, sc, 0, re_sysctl_stats, "I", "Statistics Information"); + if ((sc->rl_flags & (RL_FLAG_MSI | RL_FLAG_MSIX)) == 0) + return; + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "int_rx_mod", + CTLTYPE_INT | CTLFLAG_RW, &sc->rl_int_rx_mod, 0, + sysctl_hw_re_int_mod, "I", "re RX interrupt moderation"); + /* Pull in device tunables. */ + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + error = resource_int_value(device_get_name(sc->rl_dev), + device_get_unit(sc->rl_dev), "int_rx_mod", &sc->rl_int_rx_mod); + if (error == 0) { + if (sc->rl_int_rx_mod < RL_TIMER_MIN || + sc->rl_int_rx_mod > RL_TIMER_MAX) { + device_printf(sc->rl_dev, "int_rx_mod value out of " + "range; using default: %d\n", + RL_TIMER_DEFAULT); + sc->rl_int_rx_mod = RL_TIMER_DEFAULT; + } + } + } static int @@ -3619,3 +3736,29 @@ done: return (error); } + +static int +sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) +{ + int error, value; + + if (arg1 == NULL) + return (EINVAL); + value = *(int *)arg1; + error = sysctl_handle_int(oidp, &value, 0, req); + if (error || req->newptr == NULL) + return (error); + if (value < low || value > high) + return (EINVAL); + *(int *)arg1 = value; + + return (0); +} + +static int +sysctl_hw_re_int_mod(SYSCTL_HANDLER_ARGS) +{ + + return (sysctl_int_range(oidp, arg1, arg2, req, RL_TIMER_MIN, + RL_TIMER_MAX)); +} Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Jan 26 20:18:56 2011 (r217901) +++ head/sys/pci/if_rlreg.h Wed Jan 26 20:25:40 2011 (r217902) @@ -497,6 +497,14 @@ #define RL_EARLYTXTHRESH_CNT 0x003F /* byte count times 8 */ +/* Timer interrupt register */ +#define RL_TIMERINT_8169_VAL 0x00001FFF +#define RL_TIMER_MIN 0 +#define RL_TIMER_MAX 65 /* 65.528us */ +#define RL_TIMER_DEFAULT RL_TIMER_MAX +#define RL_TIMER_PCIE_CLK 125 /* 125MHZ */ +#define RL_USECS(x) ((x) * RL_TIMER_PCIE_CLK) + /* * Gigabit PHY access register (8169 only) */ @@ -896,6 +904,8 @@ struct rl_softc { struct task rl_inttask; int rl_txstart; + int rl_int_rx_act; + int rl_int_rx_mod; uint32_t rl_flags; #define RL_FLAG_MSI 0x0001 #define RL_FLAG_AUTOPAD 0x0002 From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:26:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7F1F1065695; Wed, 26 Jan 2011 20:26:46 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 970D18FC19; Wed, 26 Jan 2011 20:26:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKQkxe088935; Wed, 26 Jan 2011 20:26:46 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKQkr4088933; Wed, 26 Jan 2011 20:26:46 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262026.p0QKQkr4088933@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:26:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217903 - stable/8/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:26:46 -0000 Author: jhb Date: Wed Jan 26 20:26:46 2011 New Revision: 217903 URL: http://svn.freebsd.org/changeset/base/217903 Log: MFC 216590: Don't whine about child drivers calling pci_enable_busmaster(). That is perfectly normal. Modified: stable/8/sys/dev/pci/vga_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/pci/vga_pci.c ============================================================================== --- stable/8/sys/dev/pci/vga_pci.c Wed Jan 26 20:25:40 2011 (r217902) +++ stable/8/sys/dev/pci/vga_pci.c Wed Jan 26 20:26:46 2011 (r217903) @@ -243,8 +243,6 @@ static int vga_pci_enable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_enable_busmaster\n", - device_get_nameunit(child)); return (pci_enable_busmaster(dev)); } @@ -252,8 +250,6 @@ static int vga_pci_disable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_disable_busmaster\n", - device_get_nameunit(child)); return (pci_disable_busmaster(dev)); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:26:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 81FB5106564A; Wed, 26 Jan 2011 20:26:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 713F58FC1F; Wed, 26 Jan 2011 20:26:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKQwQh088975; Wed, 26 Jan 2011 20:26:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKQw4g088973; Wed, 26 Jan 2011 20:26:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262026.p0QKQw4g088973@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:26:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217904 - stable/7/sys/dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:26:58 -0000 Author: jhb Date: Wed Jan 26 20:26:58 2011 New Revision: 217904 URL: http://svn.freebsd.org/changeset/base/217904 Log: MFC 216590: Don't whine about child drivers calling pci_enable_busmaster(). That is perfectly normal. Modified: stable/7/sys/dev/pci/vga_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/pci/vga_pci.c ============================================================================== --- stable/7/sys/dev/pci/vga_pci.c Wed Jan 26 20:26:46 2011 (r217903) +++ stable/7/sys/dev/pci/vga_pci.c Wed Jan 26 20:26:58 2011 (r217904) @@ -222,8 +222,6 @@ static int vga_pci_enable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_enable_busmaster\n", - device_get_nameunit(child)); return (pci_enable_busmaster(dev)); } @@ -231,8 +229,6 @@ static int vga_pci_disable_busmaster(device_t dev, device_t child) { - device_printf(dev, "child %s requested pci_disable_busmaster\n", - device_get_nameunit(child)); return (pci_disable_busmaster(dev)); } From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:29:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 993AA1065674; Wed, 26 Jan 2011 20:29:11 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 887568FC0A; Wed, 26 Jan 2011 20:29:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKTBDU089080; Wed, 26 Jan 2011 20:29:11 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKTBsX089078; Wed, 26 Jan 2011 20:29:11 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262029.p0QKTBsX089078@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:29:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217905 - stable/8/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:29:11 -0000 Author: jhb Date: Wed Jan 26 20:29:11 2011 New Revision: 217905 URL: http://svn.freebsd.org/changeset/base/217905 Log: MFC 216621: Fix a typo in a comment. Modified: stable/8/sys/netinet/tcp_timer.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/netinet/tcp_timer.c ============================================================================== --- stable/8/sys/netinet/tcp_timer.c Wed Jan 26 20:26:58 2011 (r217904) +++ stable/8/sys/netinet/tcp_timer.c Wed Jan 26 20:29:11 2011 (r217905) @@ -511,7 +511,7 @@ tcp_timer_rexmt(void * xtp) TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we havn't got any response to + * Disable rfc1323 if we haven't got any response to * our third SYN to work-around some broken terminal servers * (most of which have hopefully been retired) that have bad VJ * header compression code which trashes TCP segments containing From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:29:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7E221065673; Wed, 26 Jan 2011 20:29:28 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C71C08FC0C; Wed, 26 Jan 2011 20:29:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKTSCv089121; Wed, 26 Jan 2011 20:29:28 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKTSQl089119; Wed, 26 Jan 2011 20:29:28 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262029.p0QKTSQl089119@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:29:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217906 - stable/7/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:29:29 -0000 Author: jhb Date: Wed Jan 26 20:29:28 2011 New Revision: 217906 URL: http://svn.freebsd.org/changeset/base/217906 Log: MFC 216621: Fix a typo in a comment. Modified: stable/7/sys/netinet/tcp_timer.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/netinet/tcp_timer.c ============================================================================== --- stable/7/sys/netinet/tcp_timer.c Wed Jan 26 20:29:11 2011 (r217905) +++ stable/7/sys/netinet/tcp_timer.c Wed Jan 26 20:29:28 2011 (r217906) @@ -485,7 +485,7 @@ tcp_timer_rexmt(void * xtp) TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we havn't got any response to + * Disable rfc1323 if we haven't got any response to * our third SYN to work-around some broken terminal servers * (most of which have hopefully been retired) that have bad VJ * header compression code which trashes TCP segments containing From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:30:32 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 765B310656B7 for ; Wed, 26 Jan 2011 20:30:32 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id CF3568FC1A for ; Wed, 26 Jan 2011 20:30:31 +0000 (UTC) Received: (qmail 20304 invoked by uid 399); 26 Jan 2011 20:30:29 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 26 Jan 2011 20:30:29 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D408463.4000001@FreeBSD.org> Date: Wed, 26 Jan 2011 12:30:27 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20101212 Thunderbird/3.1.7 MIME-Version: 1.0 To: Bruce Evans References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> In-Reply-To: <20110126173411.P972@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:30:32 -0000 On 01/25/2011 23:55, Bruce Evans wrote: > On Wed, 26 Jan 2011, Doug Barton wrote: > >> Log: >> Clarify the availability of the noatime option on network file systems >> >> Modified: >> head/sbin/mount/mount.8 >> >> Modified: head/sbin/mount/mount.8 >> ============================================================================== >> >> --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) >> +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) >> @@ -28,7 +28,7 @@ >> .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 >> .\" $FreeBSD$ >> .\" >> -.Dd February 10, 2010 >> +.Dd January 25, 2011 >> .Dt MOUNT 8 >> .Os >> .Sh NAME >> @@ -208,7 +208,11 @@ This option >> is useful on file systems where there are large numbers of files and >> performance is more critical than updating the file access time (which is >> rarely ever important). >> -This option is currently only supported on local file systems. >> +This option is not supported on network file systems when the >> +server is FreeBSD. >> +Support in network files servers on other operating systems >> +with a FreeBSD client is possible, >> +but should be tested before it is relied on. > > Even atimes are not supported by at least the non-experimental FreeBSD > client, so attempts to turn them off are nonsense and should have > always failed at mount time. But such attempts bogusly always succeed > and have no effect, even if atimes are otherwise supported, since: > - for mount(2), the nonstandard option MOPT_NOATIME has always been > bogusly in the standard options list MOPT_STDOPTS. Thus it is was > never rejected by mount_nfs(8) or for other mount utilities than > use mount(2), even for file systems for fies that don't even have atimes. > - for nmount(2) in both the non-experimental and experimental cilent > the unsupported option "noatime" is bogusly in the supported options > list together with lots of other unsupported options like "suiddir", > "nocluster[rw]", "multilabel" and "acls". All of these nonstandard > options are also bogusly in MOPT_STDOPTS. > - bogusly setting the MNT_ATIME flag in an attempt to turn off atime has > no effect in any FreeBSD nfs client, since the MNT_ATIME flag is never > referenced. And, at least in the non-experimental client, since even > atimes are not supported, there is nothing useful that references to > MNT_ATIME could do. > > Non-support of atimes by by at least the old FreeBSD client: Most > reads are from the nfs cache (else most reads would be very slow). > Since the client doesn't support atimes, it doesn't do the fancy caching > of them that would be needed to make them sort of work without defeating > the cache by telling the server about every read. So atimes just get > updated on the server when the server is asked to fill the cache, and > then only if the server supports atimes (not counting when an application > on the client explicitly sets them using utimes(2). Full support for > noatime/noatime on the client would involve negotating it with the > server, so that the client's noatime flag has preference over the > server flag on files read by that client... AFAIK there is no way to > negotiate this. Client caching of atimes might also need delicate > negotiation depending on how POSIXly you want atimes to work. > > I sometimes think that atimes should be handled mostly in vfs. The > MNT_ATIME could then have an effect without any references to it in > file systems that sort of support atimes, but ones that don't even > have atimes should still make vfs reject attempts to use it. I think I understand most, if not all of what you wrote here, but I'm not nearly smart enough to translate it into something succinct for the man page. :) My concern was that the man page says that we don't support the option at all, but with a FreeBSD client and a solaris server it has a demonstrable effect. If someone wants to improve the wording then by all means, either make a suggestion or just do it. :) Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:36:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A062C106566B; Wed, 26 Jan 2011 20:36:04 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EE818FC1A; Wed, 26 Jan 2011 20:36:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKa4sQ089397; Wed, 26 Jan 2011 20:36:04 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKa4vh089393; Wed, 26 Jan 2011 20:36:04 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262036.p0QKa4vh089393@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:36:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217908 - in stable/8/sys/dev: if_ndis mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:36:04 -0000 Author: jhb Date: Wed Jan 26 20:36:04 2011 New Revision: 217908 URL: http://svn.freebsd.org/changeset/base/217908 Log: MFC 216486,216764: Use bus_alloc_resource_any() instead of bus_alloc_resource(). Modified: stable/8/sys/dev/if_ndis/if_ndis_pccard.c stable/8/sys/dev/if_ndis/if_ndis_pci.c stable/8/sys/dev/mpt/mpt_pci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:34:16 2011 (r217907) +++ stable/8/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:36:04 2011 (r217908) @@ -198,9 +198,8 @@ ndis_attach_pccard(dev) resource_list_init(&sc->ndis_rl); sc->ndis_io_rid = 0; - sc->ndis_res_io = bus_alloc_resource(dev, - SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->ndis_io_rid, RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -213,8 +212,7 @@ ndis_attach_pccard(dev) rman_get_size(sc->ndis_res_io)); rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, Modified: stable/8/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/8/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:34:16 2011 (r217907) +++ stable/8/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:36:04 2011 (r217908) @@ -192,9 +192,9 @@ ndis_attach_pci(dev) switch (rle->type) { case SYS_RES_IOPORT: sc->ndis_io_rid = rle->rid; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -214,10 +214,10 @@ ndis_attach_pci(dev) if (sc->ndis_res_mem) { sc->ndis_altmem_rid = rle->rid; sc->ndis_res_altmem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_altmem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_altmem == NULL) { device_printf(dev, "couldn't map alt " @@ -228,10 +228,10 @@ ndis_attach_pci(dev) } else { sc->ndis_mem_rid = rle->rid; sc->ndis_res_mem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_mem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_mem == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -243,9 +243,9 @@ ndis_attach_pci(dev) break; case SYS_RES_IRQ: rid = rle->rid; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); @@ -270,8 +270,8 @@ ndis_attach_pci(dev) */ if (sc->ndis_irq == NULL) { rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't route interrupt\n"); error = ENXIO; Modified: stable/8/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/8/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:34:16 2011 (r217907) +++ stable/8/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:36:04 2011 (r217908) @@ -510,8 +510,8 @@ mpt_pci_attach(device_t dev) * some cards otherwise). */ mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); - mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -521,8 +521,8 @@ mpt_pci_attach(device_t dev) /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); - mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 20:36:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EAF71065672; Wed, 26 Jan 2011 20:36:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CFDC8FC13; Wed, 26 Jan 2011 20:36:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QKaKDB089439; Wed, 26 Jan 2011 20:36:20 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QKaKf1089435; Wed, 26 Jan 2011 20:36:20 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101262036.p0QKaKf1089435@svn.freebsd.org> From: John Baldwin Date: Wed, 26 Jan 2011 20:36:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217909 - in stable/7/sys/dev: if_ndis mpt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 20:36:21 -0000 Author: jhb Date: Wed Jan 26 20:36:20 2011 New Revision: 217909 URL: http://svn.freebsd.org/changeset/base/217909 Log: MFC 216486,216764: Use bus_alloc_resource_any() instead of bus_alloc_resource(). Modified: stable/7/sys/dev/if_ndis/if_ndis_pccard.c stable/7/sys/dev/if_ndis/if_ndis_pci.c stable/7/sys/dev/mpt/mpt_pci.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/if_ndis/if_ndis_pccard.c ============================================================================== --- stable/7/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/if_ndis/if_ndis_pccard.c Wed Jan 26 20:36:20 2011 (r217909) @@ -195,9 +195,8 @@ ndis_attach_pccard(dev) resource_list_init(&sc->ndis_rl); sc->ndis_io_rid = 0; - sc->ndis_res_io = bus_alloc_resource(dev, - SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &sc->ndis_io_rid, RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -210,8 +209,7 @@ ndis_attach_pccard(dev) rman_get_size(sc->ndis_res_io)); rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, Modified: stable/7/sys/dev/if_ndis/if_ndis_pci.c ============================================================================== --- stable/7/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/if_ndis/if_ndis_pci.c Wed Jan 26 20:36:20 2011 (r217909) @@ -195,9 +195,9 @@ ndis_attach_pci(dev) switch (rle->type) { case SYS_RES_IOPORT: sc->ndis_io_rid = rle->rid; - sc->ndis_res_io = bus_alloc_resource(dev, + sc->ndis_res_io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->ndis_io_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_io == NULL) { device_printf(dev, "couldn't map iospace\n"); @@ -217,10 +217,10 @@ ndis_attach_pci(dev) if (sc->ndis_res_mem) { sc->ndis_altmem_rid = rle->rid; sc->ndis_res_altmem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_altmem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_altmem == NULL) { device_printf(dev, "couldn't map alt " @@ -231,10 +231,10 @@ ndis_attach_pci(dev) } else { sc->ndis_mem_rid = rle->rid; sc->ndis_res_mem = - bus_alloc_resource(dev, + bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->ndis_mem_rid, - 0, ~0, 1, RF_ACTIVE); + RF_ACTIVE); if (sc->ndis_res_mem == NULL) { device_printf(dev, "couldn't map memory\n"); @@ -246,9 +246,9 @@ ndis_attach_pci(dev) break; case SYS_RES_IRQ: rid = rle->rid; - sc->ndis_irq = bus_alloc_resource(dev, - SYS_RES_IRQ, &rid, 0, ~0, 1, - RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, + SYS_RES_IRQ, &rid, + RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't map interrupt\n"); @@ -273,8 +273,8 @@ ndis_attach_pci(dev) */ if (sc->ndis_irq == NULL) { rid = 0; - sc->ndis_irq = bus_alloc_resource(dev, SYS_RES_IRQ, - &rid, 0, ~0, 1, RF_SHAREABLE | RF_ACTIVE); + sc->ndis_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, + &rid, RF_SHAREABLE | RF_ACTIVE); if (sc->ndis_irq == NULL) { device_printf(dev, "couldn't route interrupt\n"); error = ENXIO; Modified: stable/7/sys/dev/mpt/mpt_pci.c ============================================================================== --- stable/7/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:36:04 2011 (r217908) +++ stable/7/sys/dev/mpt/mpt_pci.c Wed Jan 26 20:36:20 2011 (r217909) @@ -510,8 +510,8 @@ mpt_pci_attach(device_t dev) * some cards otherwise). */ mpt->pci_pio_rid = PCIR_BAR(MPT_IO_BAR); - mpt->pci_pio_reg = bus_alloc_resource(dev, SYS_RES_IOPORT, - &mpt->pci_pio_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, + &mpt->pci_pio_rid, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { device_printf(dev, "unable to map registers in PIO mode\n"); goto bad; @@ -521,8 +521,8 @@ mpt_pci_attach(device_t dev) /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt->pci_mem_rid = PCIR_BAR(MPT_MEM_BAR); - mpt->pci_reg = bus_alloc_resource(dev, SYS_RES_MEMORY, - &mpt->pci_mem_rid, 0, ~0, 0, RF_ACTIVE); + mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &mpt->pci_mem_rid, RF_ACTIVE); if (mpt->pci_reg == NULL) { device_printf(dev, "Unable to memory map registers.\n"); if (mpt->is_sas) { From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:07:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1095106566B; Wed, 26 Jan 2011 21:07:44 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B07408FC08; Wed, 26 Jan 2011 21:07:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QL7ipo090182; Wed, 26 Jan 2011 21:07:44 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QL7i9e090179; Wed, 26 Jan 2011 21:07:44 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101262107.p0QL7i9e090179@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 26 Jan 2011 21:07:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217910 - head/sys/dev/mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:07:44 -0000 Author: yongari Date: Wed Jan 26 21:07:44 2011 New Revision: 217910 URL: http://svn.freebsd.org/changeset/base/217910 Log: Add Realtek RTL8201E 10/100 PHY found in RTL8105E controller. The exact model name is not clear yet. All previous RTL8201 10/100 PHYs used 0x8201 in MII_PHYIDR2 which in turn makes model number 0x20 but this PHY used new model number 0x08. Modified: head/sys/dev/mii/miidevs head/sys/dev/mii/rlphy.c Modified: head/sys/dev/mii/miidevs ============================================================================== --- head/sys/dev/mii/miidevs Wed Jan 26 20:36:20 2011 (r217909) +++ head/sys/dev/mii/miidevs Wed Jan 26 21:07:44 2011 (r217910) @@ -220,6 +220,7 @@ model RDC R6040 0x0003 R6040 10/100 me /* RealTek Semiconductor PHYs */ model REALTEK RTL8201L 0x0020 RTL8201L 10/100 media interface model xxREALTEK RTL8305SC 0x0005 RTL8305SC 10/100 802.1q switch +model xxREALTEK RTL8201E 0x0008 RTL8201E 10/100 media interface model xxREALTEK RTL8169S 0x0011 RTL8169S/8110S/8211B media interface /* Seeq PHYs */ Modified: head/sys/dev/mii/rlphy.c ============================================================================== --- head/sys/dev/mii/rlphy.c Wed Jan 26 20:36:20 2011 (r217909) +++ head/sys/dev/mii/rlphy.c Wed Jan 26 21:07:44 2011 (r217910) @@ -98,6 +98,7 @@ static const struct mii_phydesc rlintphy static const struct mii_phydesc rlphys[] = { MII_PHY_DESC(REALTEK, RTL8201L), + MII_PHY_DESC(xxREALTEK, RTL8201E), MII_PHY_DESC(ICPLUS, IP101), MII_PHY_END }; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:10:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 414E3106564A; Wed, 26 Jan 2011 21:10:11 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 176C58FC14; Wed, 26 Jan 2011 21:10:11 +0000 (UTC) Received: from [192.168.2.112] (host86-161-238-243.range86-161.btcentralplus.com [86.161.238.243]) by cyrus.watson.org (Postfix) with ESMTPSA id 8ABEB46B03; Wed, 26 Jan 2011 16:10:09 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Wed, 26 Jan 2011 21:10:07 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:10:11 -0000 On 26 Jan 2011, at 18:29, mdf@FreeBSD.org wrote: >> I suppose an important question is now often we see this actually = failing >=20 > I don't believe we've ever seen a memory failure relating to sysctls > at Isilon and we've been using the equivalent of this code for a few > years. Our machines aren't low memory but they are under memory > pressure sometimes. The kinds of cases I worry about are things like the tcp connection = monitoring sysctls. Most systems have a dozen, hundred, or a thousand = connections. Some have half a million or a million. If we switched to = requiring wiring every page needed to store that list, it would do = terrible things to the system. So really what I have in mind is: either = we handle cases like that well, or we put in a clear warning and have = obvious failure modes to catch the cases where it didn't work out. In = practice, I think we would not want to switch the tcpcb/inpcb sysctl for = this reason, but as people say "ah, this is convenient" we need to make = sure it's handled well, and easy to debug problems when they do arise. Robert= From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:14:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDCE2106567A; Wed, 26 Jan 2011 21:14:16 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 885268FC12; Wed, 26 Jan 2011 21:14:16 +0000 (UTC) Received: by iwn39 with SMTP id 39so1345078iwn.13 for ; Wed, 26 Jan 2011 13:14:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=HCoyLqyf78rIv8Ma4luGZLzFJbW56EGdBUbf+B21NXw=; b=FKJEn9u4MHLOhZCiv/ayVh1Y/6KBeiQDPVxT3w7Z5koambT2ICo6kNuIzVwJ++EkA4 r+gxa6LYJ6lQQxa/GNn91atO/Krtx3/11PMz8qyTnCYnoVnMUW7UH6mdDAT6DOfGzA1+ F8XnYf/kr+QEe3m3x3nWIq76UJddAxmE0mqYs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=cTzrjQ1slk5p8Hjsk44ume/b9LajOs0mAXAp9wBMrL85fiUnQ+DHMfHVbvUESMhKQA hiHTPNSMDlaileJmASQlGC5IF4p3R19muJF/tMfwYfA4Vj73C4IXxo56LcZZoHtCe+Gg nYemf45C5CguwdLnTlHyBDDCs+NanQz3J7IxM= MIME-Version: 1.0 Received: by 10.231.40.3 with SMTP id i3mr8906417ibe.129.1296076455557; Wed, 26 Jan 2011 13:14:15 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Wed, 26 Jan 2011 13:14:15 -0800 (PST) In-Reply-To: <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> Date: Wed, 26 Jan 2011 13:14:15 -0800 X-Google-Sender-Auth: ro2v3qqaOvl2H7gKMMjh9KPcToc Message-ID: From: mdf@FreeBSD.org To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:14:17 -0000 On Wed, Jan 26, 2011 at 1:10 PM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 18:29, mdf@FreeBSD.org wrote: > >>> I suppose an important question is now often we see this actually faili= ng >> >> I don't believe we've ever seen a memory failure relating to sysctls >> at Isilon and we've been using the equivalent of this code for a few >> years. =A0Our machines aren't low memory but they are under memory >> pressure sometimes. > > The kinds of cases I worry about are things like the tcp connection monit= oring sysctls. Most systems have a dozen, hundred, or a thousand connection= s. Some have half a million or a million. If we switched to requiring wirin= g every page needed to store that list, it would do terrible things to the = system. So really what I have in mind is: either we handle cases like that = well, or we put in a clear warning and have obvious failure modes to catch = the cases where it didn't work out. In practice, I think we would not want = to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, th= is is convenient" we need to make sure it's handled well, and easy to debug= problems when they do arise. > But I think that problem exists today using sysctl for output, since it's non-iterative. In fact, it's often worse today, because in addition to the user-space buffer that needs to be large enough to hold the output, the kernel needs to malloc(9) a buffer to hold it before doing the one SYSCTL_OUT at the end that most routines I've seen use. For situations like this where there is a lot of output but it doesn't need to be serialized by a lock held across the whole data fetch, then yes, using sbuf_new_for_sysctl() would wire more memory. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:14:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FCC2106578E; Wed, 26 Jan 2011 21:14:20 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 547678FC0A; Wed, 26 Jan 2011 21:14:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QLEK7V090368; Wed, 26 Jan 2011 21:14:20 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QLEKQR090365; Wed, 26 Jan 2011 21:14:20 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101262114.p0QLEKQR090365@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 26 Jan 2011 21:14:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217911 - in head/sys: dev/re pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:14:20 -0000 Author: yongari Date: Wed Jan 26 21:14:20 2011 New Revision: 217911 URL: http://svn.freebsd.org/changeset/base/217911 Log: Add support for RTL8105E PCIe Fast Ethernet controller. It seems the controller has a kind of embedded controller/memory and vendor applies a large set of magic code via undocumented PHY registers in device initialization stage. I guess it's a firmware image for the embedded controller in RTL8105E since the code is too big compared to other DSP fixups. However I have no idea what that magic code does and what's purpose of the embedded controller. Fortunately driver seems to still work without loading the firmware. While I'm here change device description of RTL810xE controller. H/W donated by: Realtek Semiconductor Corp. Modified: head/sys/dev/re/if_re.c head/sys/pci/if_rlreg.h Modified: head/sys/dev/re/if_re.c ============================================================================== --- head/sys/dev/re/if_re.c Wed Jan 26 21:07:44 2011 (r217910) +++ head/sys/dev/re/if_re.c Wed Jan 26 21:14:20 2011 (r217911) @@ -177,7 +177,7 @@ static struct rl_type re_devs[] = { { RT_VENDORID, RT_DEVICEID_8139, 0, "RealTek 8139C+ 10/100BaseTX" }, { RT_VENDORID, RT_DEVICEID_8101E, 0, - "RealTek 8101E/8102E/8102EL/8103E PCIe 10/100baseTX" }, + "RealTek 810xE PCIe 10/100baseTX" }, { RT_VENDORID, RT_DEVICEID_8168, 0, "RealTek 8168/8111 B/C/CP/D/DP/E PCIe Gigabit Ethernet" }, { RT_VENDORID, RT_DEVICEID_8169, 0, @@ -217,6 +217,7 @@ static struct rl_hwrev re_hwrevs[] = { { RL_HWREV_8102EL, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8102EL_SPIN1, RL_8169, "8102EL", RL_MTU }, { RL_HWREV_8103E, RL_8169, "8103E", RL_MTU }, + { RL_HWREV_8105E, RL_8169, "8105E", RL_MTU }, { RL_HWREV_8168B_SPIN2, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168B_SPIN3, RL_8169, "8168", RL_JUMBO_MTU }, { RL_HWREV_8168C, RL_8169, "8168C/8111C", RL_JUMBO_MTU_6K }, @@ -1376,6 +1377,11 @@ re_attach(device_t dev) RL_FLAG_MACSTAT | RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD | RL_FLAG_MACSLEEP; break; + case RL_HWREV_8105E: + sc->rl_flags |= RL_FLAG_PHYWAKE | RL_FLAG_PHYWAKE_PM | + RL_FLAG_PAR | RL_FLAG_DESCV2 | RL_FLAG_MACSTAT | + RL_FLAG_FASTETHER | RL_FLAG_CMDSTOP | RL_FLAG_AUTOPAD; + break; case RL_HWREV_8168B_SPIN1: case RL_HWREV_8168B_SPIN2: sc->rl_flags |= RL_FLAG_WOLRXENB; Modified: head/sys/pci/if_rlreg.h ============================================================================== --- head/sys/pci/if_rlreg.h Wed Jan 26 21:07:44 2011 (r217910) +++ head/sys/pci/if_rlreg.h Wed Jan 26 21:14:20 2011 (r217911) @@ -176,6 +176,7 @@ #define RL_HWREV_8168C 0x3C000000 #define RL_HWREV_8168C_SPIN2 0x3C400000 #define RL_HWREV_8168CP 0x3C800000 +#define RL_HWREV_8105E 0x40800000 #define RL_HWREV_8139 0x60000000 #define RL_HWREV_8139A 0x70000000 #define RL_HWREV_8139AG 0x70800000 From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:19:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DADE106564A; Wed, 26 Jan 2011 21:19:19 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id E4A428FC1B; Wed, 26 Jan 2011 21:19:18 +0000 (UTC) Received: from [192.168.2.112] (host86-161-238-243.range86-161.btcentralplus.com [86.161.238.243]) by cyrus.watson.org (Postfix) with ESMTPSA id 7B13A46B29; Wed, 26 Jan 2011 16:19:17 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Wed, 26 Jan 2011 21:19:15 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:19:19 -0000 On 26 Jan 2011, at 21:14, mdf@FreeBSD.org wrote: >> The kinds of cases I worry about are things like the tcp connection = monitoring sysctls. Most systems have a dozen, hundred, or a thousand = connections. Some have half a million or a million. If we switched to = requiring wiring every page needed to store that list, it would do = terrible things to the system. So really what I have in mind is: either = we handle cases like that well, or we put in a clear warning and have = obvious failure modes to catch the cases where it didn't work out. In = practice, I think we would not want to switch the tcpcb/inpcb sysctl for = this reason, but as people say "ah, this is convenient" we need to make = sure it's handled well, and easy to debug problems when they do arise. >=20 > But I think that problem exists today using sysctl for output, since > it's non-iterative. In fact, it's often worse today, because in > addition to the user-space buffer that needs to be large enough to > hold the output, the kernel needs to malloc(9) a buffer to hold it > before doing the one SYSCTL_OUT at the end that most routines I've > seen use. >=20 > For situations like this where there is a lot of output but it doesn't > need to be serialized by a lock held across the whole data fetch, then > yes, using sbuf_new_for_sysctl() would wire more memory. Right -- hence my concern about (a) appropriate documentation and (b) = proper error handling. The sbuf routine looks convenient, easy to use, = and exactly the semantic that I want in most cases. However, sometimes, = it may silently break based on something rather abstract getting "too = big". We need users of the KPI to be aware of that limitation and hence = not use it when that could occur, and when it does occur, generate a = clear notice of some sort so that it can be tracked down. Robert= From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 21:38:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8D2C1065674; Wed, 26 Jan 2011 21:38:17 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B86108FC0C; Wed, 26 Jan 2011 21:38:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QLcHog090976; Wed, 26 Jan 2011 21:38:17 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QLcHgq090974; Wed, 26 Jan 2011 21:38:17 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201101262138.p0QLcHgq090974@svn.freebsd.org> From: Michael Tuexen Date: Wed, 26 Jan 2011 21:38:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217913 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 21:38:18 -0000 Author: tuexen Date: Wed Jan 26 21:38:17 2011 New Revision: 217913 URL: http://svn.freebsd.org/changeset/base/217913 Log: * Use 300 ms as the default for RTO_MIN. * Disable burst mitigation by default. * Remove unused constant. Discussed with rrs. MFC after: 3 months. Modified: head/sys/netinet/sctp_constants.h Modified: head/sys/netinet/sctp_constants.h ============================================================================== --- head/sys/netinet/sctp_constants.h Wed Jan 26 21:22:06 2011 (r217912) +++ head/sys/netinet/sctp_constants.h Wed Jan 26 21:38:17 2011 (r217913) @@ -343,8 +343,8 @@ __FBSDID("$FreeBSD$"); */ #define SCTP_NO_FR_UNLESS_SEGMENT_SMALLER 1 -/* default max I can burst out after a fast retransmit */ -#define SCTP_DEF_MAX_BURST 4 +/* default max I can burst out after a fast retransmit, 0 disables it */ +#define SCTP_DEF_MAX_BURST 0 /* IP hdr (20/40) + 12+2+2 (enet) + sctp common 12 */ #define SCTP_FIRST_MBUF_RESV 68 /* Packet transmit states in the sent field */ @@ -642,8 +642,7 @@ __FBSDID("$FreeBSD$"); #define SCTP_DEFAULT_SECRET_LIFE_SEC 3600 #define SCTP_RTO_UPPER_BOUND (60000) /* 60 sec in ms */ -#define SCTP_RTO_UPPER_BOUND_SEC 60 /* for the init timer */ -#define SCTP_RTO_LOWER_BOUND (1000) /* 1 sec in ms */ +#define SCTP_RTO_LOWER_BOUND (300) /* 0.3 sec is ms */ #define SCTP_RTO_INITIAL (3000) /* 3 sec in ms */ From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 22:00:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49FF71065673; Wed, 26 Jan 2011 22:00:00 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 135FA8FC08; Wed, 26 Jan 2011 22:00:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QLxxu5091476; Wed, 26 Jan 2011 21:59:59 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QLxxBw091474; Wed, 26 Jan 2011 21:59:59 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101262159.p0QLxxBw091474@svn.freebsd.org> From: Pyun YongHyeon Date: Wed, 26 Jan 2011 21:59:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217914 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 22:00:00 -0000 Author: yongari Date: Wed Jan 26 21:59:59 2011 New Revision: 217914 URL: http://svn.freebsd.org/changeset/base/217914 Log: Document newly added tunables. hw.re.intr_filter hw.re.msix_disable dev.re.%d.int_rx_mod Modified: head/share/man/man4/re.4 Modified: head/share/man/man4/re.4 ============================================================================== --- head/share/man/man4/re.4 Wed Jan 26 21:38:17 2011 (r217913) +++ head/share/man/man4/re.4 Wed Jan 26 21:59:59 2011 (r217914) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15, 2011 +.Dd January 26, 2011 .Dt RE 4 .Os .Sh NAME @@ -175,15 +175,39 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width "xxxxxx" +.It Va hw.re.intr_filter +This tunable makes driver use interrupt filter handler on +controllers that support MSI/MSI-X capability. +If MSI/MSI-X is disabled by administrator this tunable has no +effect and driver will use interrupt filter handler. +The default value is 0 to use interrupt thread handler. .It Va hw.re.msi_disable This tunable disables MSI support on the Ethernet hardware. The default value is 0. +.It Va hw.re.msix_disable +This tunable disables MSI-X support on the Ethernet hardware. +The default value is 0. .It Va hw.re.prefer_iomap This tunable controls which register mapping should be used on the specified device. A non-zero value enables I/O space register mapping. The default value is 0 to use memory space register mapping. .El +.Sh SYSCTL VARIABLES +The following variables are available as both +.Xr sysctl 8 +variables and +.Xr loader 8 +tunables: +.Bl -tag -width "xxxxxx" +.It Va dev.re.%d.int_rx_mod +Maximum amount of time to delay receive interrupt processing in +units of 1us. +The accepted range is 0 to 65, the default is 65(65us). +Value 0 completely disables the interrupt moderation. +The interface need to be brought down and up again before a change +takes effect. +.El .Sh DIAGNOSTICS .Bl -diag .It "re%d: couldn't map memory" From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 22:05:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 809DE1065670; Wed, 26 Jan 2011 22:05:41 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4DD988FC14; Wed, 26 Jan 2011 22:05:41 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id EE5CB46B2C; Wed, 26 Jan 2011 17:05:40 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1AC608A01D; Wed, 26 Jan 2011 17:05:40 -0500 (EST) From: John Baldwin To: mdf@freebsd.org Date: Wed, 26 Jan 2011 16:56:23 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201101261656.24021.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Wed, 26 Jan 2011 17:05:40 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, "Robert N. M. Watson" Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 22:05:41 -0000 On Wednesday, January 26, 2011 4:14:15 pm mdf@freebsd.org wrote: > On Wed, Jan 26, 2011 at 1:10 PM, Robert N. M. Watson > wrote: > > > > On 26 Jan 2011, at 18:29, mdf@FreeBSD.org wrote: > > > >>> I suppose an important question is now often we see this actually failing > >> > >> I don't believe we've ever seen a memory failure relating to sysctls > >> at Isilon and we've been using the equivalent of this code for a few > >> years. Our machines aren't low memory but they are under memory > >> pressure sometimes. > > > > The kinds of cases I worry about are things like the tcp connection monitoring sysctls. Most systems have a dozen, hundred, or a thousand connections. Some have half a million or a million. If we switched to requiring wiring every page needed to store that list, it would do terrible things to the system. So really what I have in mind is: either we handle cases like that well, or we put in a clear warning and have obvious failure modes to catch the cases where it didn't work out. In practice, I think we would not want to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, this is convenient" we need to make sure it's handled well, and easy to debug problems when they do arise. > > > > But I think that problem exists today using sysctl for output, since > it's non-iterative. In fact, it's often worse today, because in > addition to the user-space buffer that needs to be large enough to > hold the output, the kernel needs to malloc(9) a buffer to hold it > before doing the one SYSCTL_OUT at the end that most routines I've > seen use. Not always. I think in the case of the inpcb's what happens is that we hold enough references on objects that we can drop the locks while calling SYSCTL_OUT() without requiring us to 1) allocate a full duplicate of the buffer in KVM, or 2) wire the entire userland buffer. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 22:16:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED979106564A; Wed, 26 Jan 2011 22:16:19 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3908FC12; Wed, 26 Jan 2011 22:16:18 +0000 (UTC) Received: by wwf26 with SMTP id 26so1386027wwf.31 for ; Wed, 26 Jan 2011 14:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=/KEjwLHP0uUiDPK7uIKO0Q9nF3DX+nXMNDASK4RF17U=; b=gnrx8mGzqdO8APLeIR2sfGE7eAkPLVo6mLbqslpgdifRopDimJ9PEtXW4+EPRuOprs Kf5nxDvW/6+Ewx2GXHFa81hAyzeXpyqfkGF+TRVV0VSJrivuUwmHm9ExF3G/Q8HL1wwX q7MvrN4DilF/RpJI+TRRZFjBzTM5zkHE4L9yo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=SKvdFxvRbjO7+CtDleuwkioEBE8RZTvB09j6NeS96ecFQzvVqk8RKRzSTLsmTRpQis zqRvzjvBr4PDDyiu9ZNmUe0td4cmdAITPINu218DeSdEw6ZCRj0Dmw2U5oRXlX/C6Q4y 1R7b7jZ527Ysqv92/ZISj2RgwZOz0Sbbn4fZQ= MIME-Version: 1.0 Received: by 10.216.30.137 with SMTP id k9mr1042881wea.31.1296080177658; Wed, 26 Jan 2011 14:16:17 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.254.226 with HTTP; Wed, 26 Jan 2011 14:16:17 -0800 (PST) In-Reply-To: <4D408463.4000001@FreeBSD.org> References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> <4D408463.4000001@FreeBSD.org> Date: Wed, 26 Jan 2011 14:16:17 -0800 X-Google-Sender-Auth: RZmgBme1_jfQ4koROqIKLLWQ0AE Message-ID: From: Garrett Cooper To: Doug Barton Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 22:16:20 -0000 On Wed, Jan 26, 2011 at 12:30 PM, Doug Barton wrote: > On 01/25/2011 23:55, Bruce Evans wrote: >> >> On Wed, 26 Jan 2011, Doug Barton wrote: >> >>> Log: >>> Clarify the availability of the noatime option on network file systems >>> >>> Modified: >>> head/sbin/mount/mount.8 >>> >>> Modified: head/sbin/mount/mount.8 >>> >>> ============================================================================== >>> >>> --- head/sbin/mount/mount.8 Wed Jan 26 01:07:56 2011 (r217870) >>> +++ head/sbin/mount/mount.8 Wed Jan 26 05:06:11 2011 (r217871) >>> @@ -28,7 +28,7 @@ >>> .\" @(#)mount.8 8.8 (Berkeley) 6/16/94 >>> .\" $FreeBSD$ >>> .\" >>> -.Dd February 10, 2010 >>> +.Dd January 25, 2011 >>> .Dt MOUNT 8 >>> .Os >>> .Sh NAME >>> @@ -208,7 +208,11 @@ This option >>> is useful on file systems where there are large numbers of files and >>> performance is more critical than updating the file access time (which is >>> rarely ever important). >>> -This option is currently only supported on local file systems. >>> +This option is not supported on network file systems when the >>> +server is FreeBSD. >>> +Support in network files servers on other operating systems >>> +with a FreeBSD client is possible, >>> +but should be tested before it is relied on. >> >> Even atimes are not supported by at least the non-experimental FreeBSD >> client, so attempts to turn them off are nonsense and should have >> always failed at mount time. But such attempts bogusly always succeed >> and have no effect, even if atimes are otherwise supported, since: >> - for mount(2), the nonstandard option MOPT_NOATIME has always been >> bogusly in the standard options list MOPT_STDOPTS. Thus it is was >> never rejected by mount_nfs(8) or for other mount utilities than >> use mount(2), even for file systems for fies that don't even have atimes. >> - for nmount(2) in both the non-experimental and experimental cilent >> the unsupported option "noatime" is bogusly in the supported options >> list together with lots of other unsupported options like "suiddir", >> "nocluster[rw]", "multilabel" and "acls". All of these nonstandard >> options are also bogusly in MOPT_STDOPTS. >> - bogusly setting the MNT_ATIME flag in an attempt to turn off atime has >> no effect in any FreeBSD nfs client, since the MNT_ATIME flag is never >> referenced. And, at least in the non-experimental client, since even >> atimes are not supported, there is nothing useful that references to >> MNT_ATIME could do. >> >> Non-support of atimes by by at least the old FreeBSD client: Most >> reads are from the nfs cache (else most reads would be very slow). >> Since the client doesn't support atimes, it doesn't do the fancy caching >> of them that would be needed to make them sort of work without defeating >> the cache by telling the server about every read. So atimes just get >> updated on the server when the server is asked to fill the cache, and >> then only if the server supports atimes (not counting when an application >> on the client explicitly sets them using utimes(2). Full support for >> noatime/noatime on the client would involve negotating it with the >> server, so that the client's noatime flag has preference over the >> server flag on files read by that client... AFAIK there is no way to >> negotiate this. Client caching of atimes might also need delicate >> negotiation depending on how POSIXly you want atimes to work. >> >> I sometimes think that atimes should be handled mostly in vfs. The >> MNT_ATIME could then have an effect without any references to it in >> file systems that sort of support atimes, but ones that don't even >> have atimes should still make vfs reject attempts to use it. > > I think I understand most, if not all of what you wrote here, but I'm not > nearly smart enough to translate it into something succinct for the man > page. :) > > My concern was that the man page says that we don't support the option at > all, but with a FreeBSD client and a solaris server it has a demonstrable > effect. If someone wants to improve the wording then by all means, either > make a suggestion or just do it. :) Maybe something should just be added to the BUGS section for this item? Thanks, -Garrett From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 22:48:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B028106566B; Wed, 26 Jan 2011 22:48:10 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39DED8FC0C; Wed, 26 Jan 2011 22:48:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0QMmAcx092704; Wed, 26 Jan 2011 22:48:10 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0QMmAJN092700; Wed, 26 Jan 2011 22:48:10 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101262248.p0QMmAJN092700@svn.freebsd.org> From: Matthew D Fleming Date: Wed, 26 Jan 2011 22:48:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217915 - in head/sys: geom kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 22:48:10 -0000 Author: mdf Date: Wed Jan 26 22:48:09 2011 New Revision: 217915 URL: http://svn.freebsd.org/changeset/base/217915 Log: Remove the CTLFLAG_NOLOCK as it seems to be both unused and unfunctional. Wiring the user buffer has only been done explicitly since r101422. Mark the kern.disks sysctl as MPSAFE since it is and it seems to have been mis-using the NOLOCK flag. Partially break the KPI (but not the KBI) for the sysctl_req 'lock' field since this member should be private and the "REQ_LOCKED" state seems meaningless now. Modified: head/sys/geom/geom_disk.c head/sys/kern/kern_sysctl.c head/sys/sys/sysctl.h Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Wed Jan 26 21:59:59 2011 (r217914) +++ head/sys/geom/geom_disk.c Wed Jan 26 22:48:09 2011 (r217915) @@ -527,6 +527,7 @@ sysctl_disks(SYSCTL_HANDLER_ARGS) return error; } -SYSCTL_PROC(_kern, OID_AUTO, disks, CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_NOLOCK, 0, 0, +SYSCTL_PROC(_kern, OID_AUTO, disks, + CTLTYPE_STRING | CTLFLAG_RD | CTLFLAG_MPSAFE, NULL, 0, sysctl_disks, "A", "names of available disks"); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Jan 26 21:59:59 2011 (r217914) +++ head/sys/kern/kern_sysctl.c Wed Jan 26 22:48:09 2011 (r217915) @@ -1206,7 +1206,7 @@ kernel_sysctl(struct thread *td, int *na req.oldfunc = sysctl_old_kernel; req.newfunc = sysctl_new_kernel; - req.lock = REQ_LOCKED; + req.lock = REQ_UNWIRED; SYSCTL_XLOCK(); error = sysctl_root(0, name, namelen, &req); @@ -1314,7 +1314,7 @@ sysctl_wire_old_buffer(struct sysctl_req wiredlen = (len > 0 && len < req->oldlen) ? len : req->oldlen; ret = 0; - if (req->lock == REQ_LOCKED && req->oldptr && + if (req->lock != REQ_WIRED && req->oldptr && req->oldfunc == sysctl_old_user) { if (wiredlen != 0) { ret = vslock(req->oldptr, wiredlen); @@ -1350,8 +1350,6 @@ sysctl_find_oid(int *name, u_int namelen return (ENOENT); indx++; - if (oid->oid_kind & CTLFLAG_NOLOCK) - req->lock = REQ_UNLOCKED; if ((oid->oid_kind & CTLTYPE) == CTLTYPE_NODE) { if (oid->oid_handler != NULL || indx == namelen) { *noid = oid; @@ -1548,7 +1546,7 @@ userland_sysctl(struct thread *td, int * req.oldfunc = sysctl_old_user; req.newfunc = sysctl_new_user; - req.lock = REQ_LOCKED; + req.lock = REQ_UNWIRED; #ifdef KTRACE if (KTRPOINT(curthread, KTR_SYSCTL)) Modified: head/sys/sys/sysctl.h ============================================================================== --- head/sys/sys/sysctl.h Wed Jan 26 21:59:59 2011 (r217914) +++ head/sys/sys/sysctl.h Wed Jan 26 22:48:09 2011 (r217915) @@ -77,7 +77,6 @@ struct ctlname { #define CTLFLAG_RD 0x80000000 /* Allow reads of variable */ #define CTLFLAG_WR 0x40000000 /* Allow writes to the variable */ #define CTLFLAG_RW (CTLFLAG_RD|CTLFLAG_WR) -#define CTLFLAG_NOLOCK 0x20000000 /* XXX Don't Lock */ #define CTLFLAG_ANYBODY 0x10000000 /* All users can set this var */ #define CTLFLAG_SECURE 0x08000000 /* Permit set only if securelevel<=0 */ #define CTLFLAG_PRISON 0x04000000 /* Prisoned roots can fiddle */ @@ -122,9 +121,8 @@ struct ctlname { struct sysctl_req *req /* definitions for sysctl_req 'lock' member */ -#define REQ_UNLOCKED 0 /* not locked and not wired */ -#define REQ_LOCKED 1 /* locked and not wired */ -#define REQ_WIRED 2 /* locked and wired */ +#define REQ_UNWIRED 1 +#define REQ_WIRED 2 /* definitions for sysctl_req 'flags' member */ #if defined(__amd64__) || defined(__ia64__) || defined(__powerpc64__) @@ -137,7 +135,7 @@ struct ctlname { */ struct sysctl_req { struct thread *td; /* used for access checking */ - int lock; /* locking/wiring state */ + int lock; /* wiring state */ void *oldptr; size_t oldlen; size_t oldidx; From owner-svn-src-all@FreeBSD.ORG Wed Jan 26 23:41:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6194B106566B; Wed, 26 Jan 2011 23:41:18 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id EB5358FC15; Wed, 26 Jan 2011 23:41:17 +0000 (UTC) Received: by iyb26 with SMTP id 26so936077iyb.13 for ; Wed, 26 Jan 2011 15:41:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=D37Jt+SkX27bIFkbKT6pt1W05jYEHnAJqz3d/MUIpRk=; b=v5ZGINwTcjP/YrimWN5WM899H35VeN8JmxFGa3pHDFMhW6gVSDC0vgV0wDRz1G4Npr vaml+bQvhe2N900TFncpN0DEBu2R60X/PVjsLSttC+UDpA5qLjv8dY/4UeLe0FkTPre2 KueTA/Fo/G7ue1HLF64unYgfqlTmwaktpIb04= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=TiUnggtdrZYitP8B2wwEXvF72LDT8/zoPDeVf3/Nwl83GOF6XG7v5jHEnJiuA06gDn W+Jaux2MJmaZcu4OnOnDNamRppAM5z3HKWIXYohYtWhNlFOfXlEoP8NAnOeixKtnsYcU gYVMkYP/eYrglpZcZLL8iwuByHOfQ2bExDhng= MIME-Version: 1.0 Received: by 10.231.31.131 with SMTP id y3mr71804ibc.179.1296085276931; Wed, 26 Jan 2011 15:41:16 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.231.160.147 with HTTP; Wed, 26 Jan 2011 15:41:16 -0800 (PST) In-Reply-To: References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> Date: Wed, 26 Jan 2011 15:41:16 -0800 X-Google-Sender-Auth: yTP2uW50pqvslJsIZCkVI04WEPs Message-ID: From: mdf@FreeBSD.org To: "Robert N. M. Watson" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Jan 2011 23:41:18 -0000 On Wed, Jan 26, 2011 at 1:19 PM, Robert N. M. Watson wrote: > > On 26 Jan 2011, at 21:14, mdf@FreeBSD.org wrote: > >>> The kinds of cases I worry about are things like the tcp connection mon= itoring sysctls. Most systems have a dozen, hundred, or a thousand connecti= ons. Some have half a million or a million. If we switched to requiring wir= ing every page needed to store that list, it would do terrible things to th= e system. So really what I have in mind is: either we handle cases like tha= t well, or we put in a clear warning and have obvious failure modes to catc= h the cases where it didn't work out. In practice, I think we would not wan= t to switch the tcpcb/inpcb sysctl for this reason, but as people say "ah, = this is convenient" we need to make sure it's handled well, and easy to deb= ug problems when they do arise. >> >> But I think that problem exists today using sysctl for output, since >> it's non-iterative. =A0In fact, it's often worse today, because in >> addition to the user-space buffer that needs to be large enough to >> hold the output, the kernel needs to malloc(9) a buffer to hold it >> before doing the one SYSCTL_OUT at the end that most routines I've >> seen use. >> >> For situations like this where there is a lot of output but it doesn't >> need to be serialized by a lock held across the whole data fetch, then >> yes, using sbuf_new_for_sysctl() would wire more memory. > > Right -- hence my concern about (a) appropriate documentation and (b) pro= per error handling. The sbuf routine looks convenient, easy to use, and exa= ctly the semantic that I want in most cases. However, sometimes, it may sil= ently break based on something rather abstract getting "too big". We need u= sers of the KPI to be aware of that limitation and hence not use it when th= at could occur, and when it does occur, generate a clear notice of some sor= t so that it can be tracked down. > Upon further consideration, I don't think sbuf_new_for_sysctl() should be doing the wire. Whether the buffer needs to be wired or not is up to the implementation of the individual sysctl; *most* of them will be holding a lock when doing sbuf_print, but there's no guarantee. It's simpler to just leave this in the hands of the implementor, and it also enables better error reporting. Thanks, matthew From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 00:34:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B2A106566B; Thu, 27 Jan 2011 00:34:13 +0000 (UTC) (envelope-from mdf@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2E04A8FC14; Thu, 27 Jan 2011 00:34:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R0YDw0095359; Thu, 27 Jan 2011 00:34:13 GMT (envelope-from mdf@svn.freebsd.org) Received: (from mdf@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R0YCMC095345; Thu, 27 Jan 2011 00:34:12 GMT (envelope-from mdf@svn.freebsd.org) Message-Id: <201101270034.p0R0YCMC095345@svn.freebsd.org> From: Matthew D Fleming Date: Thu, 27 Jan 2011 00:34:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217916 - in head: share/man/man9 sys/dev/cxgb sys/kern sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 00:34:13 -0000 Author: mdf Date: Thu Jan 27 00:34:12 2011 New Revision: 217916 URL: http://svn.freebsd.org/changeset/base/217916 Log: Explicitly wire the user buffer rather than doing it implicitly in sbuf_new_for_sysctl(9). This allows using an sbuf with a SYSCTL_OUT drain for extremely large amounts of data where the caller knows that appropriate references are held, and sleeping is not an issue. Inspired by: rwatson Modified: head/share/man/man9/sbuf.9 head/sys/dev/cxgb/cxgb_sge.c head/sys/kern/kern_malloc.c head/sys/kern/kern_sysctl.c head/sys/kern/subr_lock.c head/sys/kern/subr_sleepqueue.c head/sys/kern/subr_witness.c head/sys/vm/uma_core.c head/sys/vm/vm_phys.c head/sys/vm/vm_reserv.c Modified: head/share/man/man9/sbuf.9 ============================================================================== --- head/share/man/man9/sbuf.9 Wed Jan 26 22:48:09 2011 (r217915) +++ head/share/man/man9/sbuf.9 Thu Jan 27 00:34:12 2011 (r217916) @@ -177,9 +177,9 @@ The function will set up an sbuf with a drain function to use .Fn SYSCTL_OUT when the internal buffer fills. -The sysctl old buffer will be wired, which allows for doing an -.Fn sbuf_printf -while holding a mutex. +Note that if the various functions which append to an sbuf are used while +a non-sleepable lock is held, the user buffer should be wired using +.Fn sysctl_wire_old_buffer . .Pp The .Fn sbuf_delete Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Jan 27 00:34:12 2011 (r217916) @@ -3251,7 +3251,9 @@ t3_dump_rspq(SYSCTL_HANDLER_ARGS) err = t3_sge_read_rspq(qs->port->adapter, rspq->cntxt_id, data); if (err) return (err); - + err = sysctl_wire_old_buffer(req, 0); + if (err) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n index=%u size=%u MSI-X/RspQ=%u intr enable=%u intr armed=%u\n", @@ -3316,7 +3318,9 @@ t3_dump_txq_eth(SYSCTL_HANDLER_ARGS) err = t3_sge_read_ecntxt(qs->port->adapter, qs->rspq.cntxt_id, data); if (err) return (err); - + err = sysctl_wire_old_buffer(req, 0); + if (err) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " \n credits=%u GTS=%u index=%u size=%u rspq#=%u cmdq#=%u\n", @@ -3381,6 +3385,9 @@ t3_dump_txq_ctrl(SYSCTL_HANDLER_ARGS) return (EINVAL); } + err = sysctl_wire_old_buffer(req, 0); + if (err != 0) + return (err); sb = sbuf_new_for_sysctl(NULL, NULL, QDUMP_SBUF_SIZE, req); sbuf_printf(sb, " qid=%d start=%d -> end=%d\n", qs->idx, txq->txq_dump_start, Modified: head/sys/kern/kern_malloc.c ============================================================================== --- head/sys/kern/kern_malloc.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/kern/kern_malloc.c Thu Jan 27 00:34:12 2011 (r217916) @@ -862,6 +862,9 @@ sysctl_kern_malloc_stats(SYSCTL_HANDLER_ int error, i; struct sbuf sbuf; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); mtx_lock(&malloc_mtx); @@ -1019,6 +1022,9 @@ sysctl_kern_mprof(SYSCTL_HANDLER_ARGS) waste = 0; mem = 0; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); sbuf_printf(&sbuf, "\n Size Requests Real Size\n"); Modified: head/sys/kern/kern_sysctl.c ============================================================================== --- head/sys/kern/kern_sysctl.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/kern/kern_sysctl.c Thu Jan 27 00:34:12 2011 (r217916) @@ -1591,7 +1591,8 @@ userland_sysctl(struct thread *td, int * } /* - * Drain into a sysctl struct. The user buffer must be wired. + * Drain into a sysctl struct. The user buffer should be wired if a page + * fault would cause issue. */ static int sbuf_sysctl_drain(void *arg, const char *data, int len) @@ -1609,9 +1610,6 @@ sbuf_new_for_sysctl(struct sbuf *s, char struct sysctl_req *req) { - /* Wire the user buffer, so we can write without blocking. */ - sysctl_wire_old_buffer(req, 0); - s = sbuf_new(s, buf, length, SBUF_FIXEDLEN); sbuf_set_drain(s, sbuf_sysctl_drain, req); return (s); Modified: head/sys/kern/subr_lock.c ============================================================================== --- head/sys/kern/subr_lock.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/kern/subr_lock.c Thu Jan 27 00:34:12 2011 (r217916) @@ -393,6 +393,9 @@ dump_lock_prof_stats(SYSCTL_HANDLER_ARGS int error, cpu, t; int enabled; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sb = sbuf_new_for_sysctl(NULL, NULL, LPROF_SBUF_SIZE, req); sbuf_printf(sb, "\n%8s %9s %11s %11s %11s %6s %6s %2s %6s %s\n", "max", "wait_max", "total", "wait_total", "count", "avg", "wait_avg", "cnt_hold", "cnt_lock", "name"); Modified: head/sys/kern/subr_sleepqueue.c ============================================================================== --- head/sys/kern/subr_sleepqueue.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/kern/subr_sleepqueue.c Thu Jan 27 00:34:12 2011 (r217916) @@ -1130,6 +1130,9 @@ dump_sleepq_prof_stats(SYSCTL_HANDLER_AR int error; int i; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sb = sbuf_new_for_sysctl(NULL, NULL, SLEEPQ_SBUFSIZE, req); sbuf_printf(sb, "\nwmesg\tcount\n"); enabled = prof_enabled; Modified: head/sys/kern/subr_witness.c ============================================================================== --- head/sys/kern/subr_witness.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/kern/subr_witness.c Thu Jan 27 00:34:12 2011 (r217916) @@ -2544,6 +2544,10 @@ sysctl_debug_witness_fullgraph(SYSCTL_HA return (error); } error = 0; + + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sb = sbuf_new_for_sysctl(NULL, NULL, FULLGRAPH_SBUF_SIZE, req); if (sb == NULL) return (ENOMEM); Modified: head/sys/vm/uma_core.c ============================================================================== --- head/sys/vm/uma_core.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/vm/uma_core.c Thu Jan 27 00:34:12 2011 (r217916) @@ -3224,6 +3224,9 @@ sysctl_vm_zone_stats(SYSCTL_HANDLER_ARGS uma_keg_t k; int count, error, i; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); count = 0; Modified: head/sys/vm/vm_phys.c ============================================================================== --- head/sys/vm/vm_phys.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/vm/vm_phys.c Thu Jan 27 00:34:12 2011 (r217916) @@ -125,6 +125,9 @@ sysctl_vm_phys_free(SYSCTL_HANDLER_ARGS) struct vm_freelist *fl; int error, flind, oind, pind; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); for (flind = 0; flind < vm_nfreelists; flind++) { sbuf_printf(&sbuf, "\nFREE LIST %d:\n" @@ -161,6 +164,9 @@ sysctl_vm_phys_segs(SYSCTL_HANDLER_ARGS) struct vm_phys_seg *seg; int error, segind; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); for (segind = 0; segind < vm_phys_nsegs; segind++) { sbuf_printf(&sbuf, "\nSEGMENT %d:\n\n", segind); @@ -187,8 +193,11 @@ sysctl_vm_phys_lookup_lists(SYSCTL_HANDL struct sbuf sbuf; int domain, error, flind, ndomains; - ndomains = vm_nfreelists - VM_NFREELIST + 1; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); + ndomains = vm_nfreelists - VM_NFREELIST + 1; for (domain = 0; domain < ndomains; domain++) { sbuf_printf(&sbuf, "\nDOMAIN %d:\n\n", domain); for (flind = 0; flind < vm_nfreelists; flind++) Modified: head/sys/vm/vm_reserv.c ============================================================================== --- head/sys/vm/vm_reserv.c Wed Jan 26 22:48:09 2011 (r217915) +++ head/sys/vm/vm_reserv.c Thu Jan 27 00:34:12 2011 (r217916) @@ -182,6 +182,9 @@ sysctl_vm_reserv_partpopq(SYSCTL_HANDLER vm_reserv_t rv; int counter, error, level, unused_pages; + error = sysctl_wire_old_buffer(req, 0); + if (error != 0) + return (error); sbuf_new_for_sysctl(&sbuf, NULL, 128, req); sbuf_printf(&sbuf, "\nLEVEL SIZE NUMBER\n\n"); for (level = -1; level <= VM_NRESERVLEVEL - 2; level++) { From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 00:36:55 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 308CC1065670; Thu, 27 Jan 2011 00:36:55 +0000 (UTC) (envelope-from jfv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EC268FC13; Thu, 27 Jan 2011 00:36:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R0atRt095477; Thu, 27 Jan 2011 00:36:55 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R0atQf095472; Thu, 27 Jan 2011 00:36:55 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201101270036.p0R0atQf095472@svn.freebsd.org> From: Jack F Vogel Date: Thu, 27 Jan 2011 00:36:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217917 - releng/8.2/sys/dev/ixgbe X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 00:36:55 -0000 Author: jfv Date: Thu Jan 27 00:36:54 2011 New Revision: 217917 URL: http://svn.freebsd.org/changeset/base/217917 Log: MFC ixgbe cummulative patch from stable/8 217712 Fix a couple of incorrect variable names in the sysctl code. 217713 - Panic on the 82598 adapter due to reading FCOE registers that don't exit - Make phy detection dynamic so adapters that support multiple types of media can be properly identified by the interface layer - Performance patch to the flow director (ixgbe_atr) code - Fix intermittent data corruption on the 82599 - Add missing support code for buffer size and descriptors when doing jumbo frames, also add 16K cluster support. - Release RX lock when calling stack, this removes LOR problems. 217795 Remove TX_UNLOCK from the error path in local_timer, there is no LOCK 217796 Add missing case for Direct Attach 82598 in the dynamic phy detection 217797 Performance: don't run flow control shared code if nothing has changed Approved by: re (bz) Modified: releng/8.2/sys/dev/ixgbe/ixgbe.c releng/8.2/sys/dev/ixgbe/ixgbe.h releng/8.2/sys/dev/ixgbe/ixgbe_82599.c releng/8.2/sys/dev/ixgbe/ixgbe_api.h releng/8.2/sys/dev/ixgbe/ixgbe_common.c releng/8.2/sys/dev/ixgbe/ixgbe_common.h releng/8.2/sys/dev/ixgbe/ixgbe_mbx.c releng/8.2/sys/dev/ixgbe/ixgbe_type.h Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/dev/ixgbe/ixgbe.c ============================================================================== --- releng/8.2/sys/dev/ixgbe/ixgbe.c Thu Jan 27 00:34:12 2011 (r217916) +++ releng/8.2/sys/dev/ixgbe/ixgbe.c Thu Jan 27 00:36:54 2011 (r217917) @@ -46,7 +46,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.3.7"; +char ixgbe_driver_version[] = "2.3.8"; /********************************************************************* * PCI Device ID Table @@ -175,6 +175,7 @@ static __inline void ixgbe_rx_input(stru /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); +static void ixgbe_setup_optics(struct adapter *); /* Legacy (single vector interrupt handler */ static void ixgbe_legacy_irq(void *); @@ -290,13 +291,6 @@ TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; -/* -** The number of scatter-gather segments -** differs for 82598 and 82599, default to -** the former. -*/ -static int ixgbe_num_segs = IXGBE_82598_SCATTER; - #ifdef IXGBE_FDIR /* ** For Flow Director: this is the @@ -386,7 +380,7 @@ ixgbe_attach(device_t dev) struct adapter *adapter; struct ixgbe_hw *hw; int error = 0; - u16 pci_device_id, csum; + u16 csum; u32 ctrl_ext; INIT_DEBUGOUT("ixgbe_attach: begin"); @@ -399,52 +393,6 @@ ixgbe_attach(device_t dev) /* Core Lock Init*/ IXGBE_CORE_LOCK_INIT(adapter, device_get_nameunit(dev)); - /* Keep track of optics */ - pci_device_id = pci_get_device(dev); - switch (pci_device_id) { - case IXGBE_DEV_ID_82598_CX4_DUAL_PORT: - case IXGBE_DEV_ID_82598EB_CX4: - adapter->optics = IFM_10G_CX4; - break; - case IXGBE_DEV_ID_82598: - case IXGBE_DEV_ID_82598AF_DUAL_PORT: - case IXGBE_DEV_ID_82598AF_SINGLE_PORT: - case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM: - case IXGBE_DEV_ID_82598EB_SFP_LOM: - case IXGBE_DEV_ID_82598AT: - adapter->optics = IFM_10G_SR; - break; - case IXGBE_DEV_ID_82598AT2: - adapter->optics = IFM_10G_T; - break; - case IXGBE_DEV_ID_82598EB_XF_LR: - adapter->optics = IFM_10G_LR; - break; - case IXGBE_DEV_ID_82599_SFP: - adapter->optics = IFM_10G_SR; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82598_DA_DUAL_PORT : - adapter->optics = IFM_10G_TWINAX; - break; - case IXGBE_DEV_ID_82599_KX4: - case IXGBE_DEV_ID_82599_KX4_MEZZ: - case IXGBE_DEV_ID_82599_CX4: - adapter->optics = IFM_10G_CX4; - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_XAUI_LOM: - case IXGBE_DEV_ID_82599_COMBO_BACKPLANE: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - case IXGBE_DEV_ID_82599_T3_LOM: - ixgbe_num_segs = IXGBE_82599_SCATTER; - adapter->optics = IFM_10G_T; - default: - ixgbe_num_segs = IXGBE_82599_SCATTER; - break; - } - /* SYSCTL APIs */ SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), @@ -547,10 +495,6 @@ ixgbe_attach(device_t dev) goto err_late; } - /* Pick up the smart speed setting */ - if (hw->mac.type == ixgbe_mac_82599EB) - hw->phy.smart_speed = ixgbe_smart_speed; - /* Get Hardware Flow Control setting */ hw->fc.requested_mode = ixgbe_fc_full; hw->fc.pause_time = IXGBE_FC_PAUSE; @@ -574,6 +518,9 @@ ixgbe_attach(device_t dev) goto err_late; } + /* Detect and set physical type */ + ixgbe_setup_optics(adapter); + if ((adapter->msix > 1) && (ixgbe_enable_msix)) error = ixgbe_allocate_msix(adapter); else @@ -1054,7 +1001,7 @@ ixgbe_init_locked(struct adapter *adapte return; } - ixgbe_reset_hw(hw); + ixgbe_init_hw(hw); ixgbe_initialize_transmit_units(adapter); /* Setup Multicast table */ @@ -1068,8 +1015,10 @@ ixgbe_init_locked(struct adapter *adapte adapter->rx_mbuf_sz = MCLBYTES; else if (adapter->max_frame_size <= 4096) adapter->rx_mbuf_sz = MJUMPAGESIZE; - else + else if (adapter->max_frame_size <= 9216) adapter->rx_mbuf_sz = MJUM9BYTES; + else + adapter->rx_mbuf_sz = MJUM16BYTES; /* Prepare receive descriptors and buffers */ if (ixgbe_setup_receive_structures(adapter)) { @@ -1600,7 +1549,7 @@ ixgbe_xmit(struct tx_ring *txr, struct m int i, j, error, nsegs; int first, last = 0; struct mbuf *m_head; - bus_dma_segment_t segs[ixgbe_num_segs]; + bus_dma_segment_t segs[adapter->num_segs]; bus_dmamap_t map; struct ixgbe_tx_buf *txbuf, *txbuf_mapped; union ixgbe_adv_tx_desc *txd = NULL; @@ -1921,7 +1870,6 @@ hung: txr->me, txr->tx_avail, txr->next_to_clean); adapter->ifp->if_drv_flags &= ~IFF_DRV_RUNNING; adapter->watchdog_events++; - IXGBE_TX_UNLOCK(txr); ixgbe_init_locked(adapter); } @@ -2010,16 +1958,71 @@ static void ixgbe_identify_hardware(struct adapter *adapter) { device_t dev = adapter->dev; + struct ixgbe_hw *hw = &adapter->hw; /* Save off the information about this board */ - adapter->hw.vendor_id = pci_get_vendor(dev); - adapter->hw.device_id = pci_get_device(dev); - adapter->hw.revision_id = pci_read_config(dev, PCIR_REVID, 1); - adapter->hw.subsystem_vendor_id = + hw->vendor_id = pci_get_vendor(dev); + hw->device_id = pci_get_device(dev); + hw->revision_id = pci_read_config(dev, PCIR_REVID, 1); + hw->subsystem_vendor_id = pci_read_config(dev, PCIR_SUBVEND_0, 2); - adapter->hw.subsystem_device_id = + hw->subsystem_device_id = pci_read_config(dev, PCIR_SUBDEV_0, 2); + /* We need this here to set the num_segs below */ + ixgbe_set_mac_type(hw); + + /* Pick up the 82599 and VF settings */ + if (hw->mac.type != ixgbe_mac_82598EB) { + hw->phy.smart_speed = ixgbe_smart_speed; + adapter->num_segs = IXGBE_82599_SCATTER; + } else + adapter->num_segs = IXGBE_82598_SCATTER; + + return; +} + +/********************************************************************* + * + * Determine optic type + * + **********************************************************************/ +static void +ixgbe_setup_optics(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + int layer; + + layer = ixgbe_get_supported_physical_layer(hw); + switch (layer) { + case IXGBE_PHYSICAL_LAYER_10GBASE_T: + adapter->optics = IFM_10G_T; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_T: + adapter->optics = IFM_1000_T; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_LR: + case IXGBE_PHYSICAL_LAYER_10GBASE_LRM: + adapter->optics = IFM_10G_LR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_SR: + adapter->optics = IFM_10G_SR; + break; + case IXGBE_PHYSICAL_LAYER_10GBASE_KX4: + case IXGBE_PHYSICAL_LAYER_10GBASE_CX4: + adapter->optics = IFM_10G_CX4; + break; + case IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU: + adapter->optics = IFM_10G_TWINAX; + break; + case IXGBE_PHYSICAL_LAYER_1000BASE_KX: + case IXGBE_PHYSICAL_LAYER_10GBASE_KR: + case IXGBE_PHYSICAL_LAYER_10GBASE_XAUI: + case IXGBE_PHYSICAL_LAYER_UNKNOWN: + default: + adapter->optics = IFM_ETHER | IFM_AUTO; + break; + } return; } @@ -2216,8 +2219,8 @@ ixgbe_setup_msix(struct adapter *adapter if (ixgbe_num_queues != 0) queues = ixgbe_num_queues; - /* Set max queues to 8 */ - else if (queues > 8) + /* Set max queues to 8 when autoconfiguring */ + else if ((ixgbe_num_queues == 0) && (queues > 8)) queues = 8; /* @@ -2413,8 +2416,8 @@ ixgbe_setup_interface(device_t dev, stru */ ifmedia_init(&adapter->media, IFM_IMASK, ixgbe_media_change, ixgbe_media_status); - ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics | - IFM_FDX, 0, NULL); + ifmedia_add(&adapter->media, IFM_ETHER | adapter->optics, 0, NULL); + ifmedia_set(&adapter->media, IFM_ETHER | adapter->optics); if (hw->device_id == IXGBE_DEV_ID_82598AT) { ifmedia_add(&adapter->media, IFM_ETHER | IFM_1000_T | IFM_FDX, 0, NULL); @@ -2718,7 +2721,7 @@ ixgbe_allocate_transmit_buffers(struct t BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ IXGBE_TSO_SIZE, /* maxsize */ - ixgbe_num_segs, /* nsegments */ + adapter->num_segs, /* nsegments */ PAGE_SIZE, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ @@ -3181,72 +3184,67 @@ ixgbe_atr(struct tx_ring *txr, struct mb { struct adapter *adapter = txr->adapter; struct ix_queue *que; - union ixgbe_atr_input atr_input; struct ip *ip; struct tcphdr *th; struct udphdr *uh; struct ether_vlan_header *eh; + union ixgbe_atr_hash_dword input = {.dword = 0}; + union ixgbe_atr_hash_dword common = {.dword = 0}; int ehdrlen, ip_hlen; - u16 etype, vlan_id, src_port, dst_port, flex_bytes; - u32 src_ipv4_addr, dst_ipv4_addr; - u8 l4type = 0, ipproto = 0; + u16 etype; eh = mtod(mp, struct ether_vlan_header *); - if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) + if (eh->evl_encap_proto == htons(ETHERTYPE_VLAN)) { ehdrlen = ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN; - else + etype = eh->evl_proto; + } else { ehdrlen = ETHER_HDR_LEN; - etype = ntohs(eh->evl_proto); + etype = eh->evl_encap_proto; + } /* Only handling IPv4 */ - if (etype != ETHERTYPE_IP) + if (etype != htons(ETHERTYPE_IP)) return; ip = (struct ip *)(mp->m_data + ehdrlen); - ipproto = ip->ip_p; ip_hlen = ip->ip_hl << 2; - src_port = dst_port = 0; /* check if we're UDP or TCP */ - switch (ipproto) { + switch (ip->ip_p) { case IPPROTO_TCP: th = (struct tcphdr *)((caddr_t)ip + ip_hlen); - src_port = th->th_sport; - dst_port = th->th_dport; - l4type |= IXGBE_ATR_L4TYPE_TCP; + /* src and dst are inverted */ + common.port.dst ^= th->th_sport; + common.port.src ^= th->th_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_TCPV4; break; case IPPROTO_UDP: uh = (struct udphdr *)((caddr_t)ip + ip_hlen); - src_port = uh->uh_sport; - dst_port = uh->uh_dport; - l4type |= IXGBE_ATR_L4TYPE_UDP; + /* src and dst are inverted */ + common.port.dst ^= uh->uh_sport; + common.port.src ^= uh->uh_dport; + input.formatted.flow_type ^= IXGBE_ATR_FLOW_TYPE_UDPV4; break; default: return; } - memset(&atr_input, 0, sizeof(union ixgbe_atr_input)); + input.formatted.vlan_id = htobe16(mp->m_pkthdr.ether_vtag); + if (mp->m_pkthdr.ether_vtag) + common.flex_bytes ^= htons(ETHERTYPE_VLAN); + else + common.flex_bytes ^= etype; + common.ip ^= ip->ip_src.s_addr ^ ip->ip_dst.s_addr; - vlan_id = htole16(mp->m_pkthdr.ether_vtag); - src_ipv4_addr = ip->ip_src.s_addr; - dst_ipv4_addr = ip->ip_dst.s_addr; - flex_bytes = etype; que = &adapter->queues[txr->me]; - - ixgbe_atr_set_vlan_id_82599(&atr_input, vlan_id); - ixgbe_atr_set_src_port_82599(&atr_input, dst_port); - ixgbe_atr_set_dst_port_82599(&atr_input, src_port); - ixgbe_atr_set_flex_byte_82599(&atr_input, flex_bytes); - ixgbe_atr_set_l4type_82599(&atr_input, l4type); - /* src and dst are inverted, think how the receiver sees them */ - ixgbe_atr_set_src_ipv4_82599(&atr_input, dst_ipv4_addr); - ixgbe_atr_set_dst_ipv4_82599(&atr_input, src_ipv4_addr); - - /* This assumes the Rx queue and Tx queue are bound to the same CPU */ + /* + ** This assumes the Rx queue and Tx + ** queue are bound to the same CPU + */ ixgbe_fdir_add_signature_filter_82599(&adapter->hw, - &atr_input, que->msix); + input, common, que->msix); } -#endif +#endif /* IXGBE_FDIR */ /********************************************************************** * @@ -3508,9 +3506,9 @@ ixgbe_allocate_receive_buffers(struct rx BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ - MJUM9BYTES, /* maxsize */ + MJUM16BYTES, /* maxsize */ 1, /* nsegments */ - MJUM9BYTES, /* maxsegsize */ + MJUM16BYTES, /* maxsegsize */ 0, /* flags */ NULL, /* lockfunc */ NULL, /* lockfuncarg */ @@ -3582,8 +3580,13 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) */ if (adapter->rx_mbuf_sz == MCLBYTES) rscctrl |= IXGBE_RSCCTL_MAXDESC_16; - else /* using 4K clusters */ + else if (adapter->rx_mbuf_sz == MJUMPAGESIZE) rscctrl |= IXGBE_RSCCTL_MAXDESC_8; + else if (adapter->rx_mbuf_sz == MJUM9BYTES) + rscctrl |= IXGBE_RSCCTL_MAXDESC_4; + else /* Using 16K cluster */ + rscctrl |= IXGBE_RSCCTL_MAXDESC_1; + IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(rxr->me), rscctrl); /* Enable TCP header recognition */ @@ -3821,15 +3824,14 @@ ixgbe_initialize_receive_units(struct ad /* Set for Jumbo Frames? */ hlreg = IXGBE_READ_REG(hw, IXGBE_HLREG0); - if (ifp->if_mtu > ETHERMTU) { + if (ifp->if_mtu > ETHERMTU) hlreg |= IXGBE_HLREG0_JUMBOEN; - bufsz = 4096 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } else { + else hlreg &= ~IXGBE_HLREG0_JUMBOEN; - bufsz = 2048 >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; - } IXGBE_WRITE_REG(hw, IXGBE_HLREG0, hlreg); + bufsz = adapter->rx_mbuf_sz >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; + for (int i = 0; i < adapter->num_queues; i++, rxr++) { u64 rdba = rxr->rxdma.dma_paddr; @@ -4028,7 +4030,9 @@ ixgbe_rx_input(struct rx_ring *rxr, stru if (tcp_lro_rx(&rxr->lro, m, 0) == 0) return; } + IXGBE_RX_UNLOCK(rxr); (*ifp->if_input)(ifp, m); + IXGBE_RX_LOCK(rxr); } static __inline void @@ -4289,8 +4293,11 @@ next_desc: i = 0; /* Now send to the stack or do LRO */ - if (sendmp != NULL) + if (sendmp != NULL) { + rxr->next_to_check = i; ixgbe_rx_input(rxr, ifp, sendmp, ptype); + i = rxr->next_to_check; + } /* Every 8 descriptors we go to refresh mbufs */ if (processed == 8) { @@ -4654,6 +4661,8 @@ static bool ixgbe_sfp_probe(struct adapt device_printf(dev,"SFP+ module detected!\n"); /* We now have supported optics */ adapter->sfp_probe = FALSE; + /* Set the optics type so system reports correctly */ + ixgbe_setup_optics(adapter); result = TRUE; } out: @@ -4718,10 +4727,6 @@ ixgbe_handle_msf(void *context, int pend hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); if (hw->mac.ops.setup_link) hw->mac.ops.setup_link(hw, autoneg, negotiate, TRUE); -#if 0 - ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); - ixgbe_update_link_status(adapter); -#endif return; } @@ -4830,7 +4835,8 @@ ixgbe_update_stats_counters(struct adapt bprc = IXGBE_READ_REG(hw, IXGBE_BPRC); adapter->stats.bprc += bprc; adapter->stats.mprc += IXGBE_READ_REG(hw, IXGBE_MPRC); - adapter->stats.mprc -= bprc; + if (hw->mac.type == ixgbe_mac_82598EB) + adapter->stats.mprc -= bprc; adapter->stats.prc64 += IXGBE_READ_REG(hw, IXGBE_PRC64); adapter->stats.prc127 += IXGBE_READ_REG(hw, IXGBE_PRC127); @@ -4871,12 +4877,14 @@ ixgbe_update_stats_counters(struct adapt adapter->stats.xec += IXGBE_READ_REG(hw, IXGBE_XEC); adapter->stats.fccrc += IXGBE_READ_REG(hw, IXGBE_FCCRC); adapter->stats.fclast += IXGBE_READ_REG(hw, IXGBE_FCLAST); - adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); - adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); - adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); - adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); - adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); - + /* Only read FCOE on 82599 */ + if (hw->mac.type == ixgbe_mac_82599EB) { + adapter->stats.fcoerpdc += IXGBE_READ_REG(hw, IXGBE_FCOERPDC); + adapter->stats.fcoeprc += IXGBE_READ_REG(hw, IXGBE_FCOEPRC); + adapter->stats.fcoeptc += IXGBE_READ_REG(hw, IXGBE_FCOEPTC); + adapter->stats.fcoedwrc += IXGBE_READ_REG(hw, IXGBE_FCOEDWRC); + adapter->stats.fcoedwtc += IXGBE_READ_REG(hw, IXGBE_FCOEDWTC); + } /* Fill out the OS statistics structure */ ifp->if_ipackets = adapter->stats.gprc; @@ -5012,18 +5020,6 @@ ixgbe_add_hw_stats(struct adapter *adapt SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_defrag_failed", CTLFLAG_RD, &adapter->mbuf_defrag_failed, "m_defrag() failed"); -#if 0 - /* These counters are not updated by the software */ - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_header_failed", - CTLFLAG_RD, &adapter->mbuf_header_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "mbuf_packet_failed", - CTLFLAG_RD, &adapter->mbuf_packet_failed, - "???"); - SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_map_avail", - CTLFLAG_RD, &adapter->no_tx_map_avail, - "???"); -#endif SYSCTL_ADD_ULONG(ctx, child, OID_AUTO, "no_tx_dma_setup", CTLFLAG_RD, &adapter->no_tx_dma_setup, "Driver tx dma failure in xmit"); @@ -5129,13 +5125,13 @@ ixgbe_add_hw_stats(struct adapter *adapt CTLFLAG_RD, &stats->lxontxc, "Link XON Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xon_rcvd", - CTLFLAG_RD, &stats->lxontxc, + CTLFLAG_RD, &stats->lxonrxc, "Link XON Received"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_txd", CTLFLAG_RD, &stats->lxofftxc, "Link XOFF Transmitted"); SYSCTL_ADD_QUAD(ctx, stat_list, OID_AUTO, "link_xoff_rcvd", - CTLFLAG_RD, &stats->lxofftxc, + CTLFLAG_RD, &stats->lxoffrxc, "Link XOFF Received"); /* Packet Reception Stats */ @@ -5271,13 +5267,17 @@ static int ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) { int error; + int last = ixgbe_flow_control; struct adapter *adapter; error = sysctl_handle_int(oidp, &ixgbe_flow_control, 0, req); - if (error) return (error); + /* Don't bother if it's not changed */ + if (ixgbe_flow_control == last) + return (0); + adapter = (struct adapter *) arg1; switch (ixgbe_flow_control) { case ixgbe_fc_rx_pause: Modified: releng/8.2/sys/dev/ixgbe/ixgbe.h ============================================================================== --- releng/8.2/sys/dev/ixgbe/ixgbe.h Thu Jan 27 00:34:12 2011 (r217916) +++ releng/8.2/sys/dev/ixgbe/ixgbe.h Thu Jan 27 00:36:54 2011 (r217917) @@ -385,6 +385,7 @@ struct adapter { int advertise; /* link speeds */ bool link_active; u16 max_frame_size; + u16 num_segs; u32 link_speed; bool link_up; u32 linkvec; Modified: releng/8.2/sys/dev/ixgbe/ixgbe_82599.c ============================================================================== --- releng/8.2/sys/dev/ixgbe/ixgbe_82599.c Thu Jan 27 00:34:12 2011 (r217916) +++ releng/8.2/sys/dev/ixgbe/ixgbe_82599.c Thu Jan 27 00:36:54 2011 (r217917) @@ -67,13 +67,13 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); s32 ixgbe_start_hw_rev_1_82599(struct ixgbe_hw *hw); -void ixgbe_enable_relaxed_ordering_82599(struct ixgbe_hw *hw); s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw); s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw); u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw); s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval); -s32 ixgbe_get_device_caps_82599(struct ixgbe_hw *hw, u16 *device_caps); static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); +bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw); + void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) { @@ -101,7 +101,8 @@ void ixgbe_init_mac_link_ops_82599(struc } else { if ((ixgbe_get_media_type(hw) == ixgbe_media_type_backplane) && (hw->phy.smart_speed == ixgbe_smart_speed_auto || - hw->phy.smart_speed == ixgbe_smart_speed_on)) { + hw->phy.smart_speed == ixgbe_smart_speed_on) && + !ixgbe_verify_lesm_fw_enabled_82599(hw)) { mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed; } else { mac->ops.setup_link = &ixgbe_setup_mac_link_82599; @@ -253,7 +254,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw /* MAC */ mac->ops.reset_hw = &ixgbe_reset_hw_82599; - mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_82599; + mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2; mac->ops.get_media_type = &ixgbe_get_media_type_82599; mac->ops.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599; @@ -263,7 +264,7 @@ s32 ixgbe_init_ops_82599(struct ixgbe_hw mac->ops.start_hw = &ixgbe_start_hw_rev_1_82599; mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic; mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic; - mac->ops.get_device_caps = &ixgbe_get_device_caps_82599; + mac->ops.get_device_caps = &ixgbe_get_device_caps_generic; mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic; mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic; @@ -1375,7 +1376,7 @@ s32 ixgbe_init_fdir_perfect_82599(struct * @stream: input bitstream to compute the hash on * @key: 32-bit hash key **/ -u16 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, +u32 ixgbe_atr_compute_hash_82599(union ixgbe_atr_input *atr_input, u32 key) { /* @@ -1419,54 +1420,45 @@ u16 ixgbe_atr_compute_hash_82599(union i * */ __be32 common_hash_dword = 0; - u32 hi_hash_dword, lo_hash_dword; - u16 hash_result = 0; - u8 i; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 hash_result = 0; + u8 i; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(atr_input->dword_stream[0]); /* generate common hash dword */ - for (i = 1; i < 11; i++) - common_hash_dword ^= (u32)atr_input->dword_stream[i]; - hi_hash_dword ^= IXGBE_NTOHL(common_hash_dword); + for (i = 10; i; i -= 2) + common_hash_dword ^= atr_input->dword_stream[i] ^ + atr_input->dword_stream[i - 1]; - /* low dword is word swapped version of common with vlan added */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + hi_hash_dword = IXGBE_NTOHL(common_hash_dword); - /* hi dword is common dword with l4type and vm_pool shifted */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* low dword is word swapped version of common */ + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); + + /* Process bits 0 and 16 */ + if (key & 0x0001) hash_result ^= lo_hash_dword; + if (key & 0x00010000) hash_result ^= hi_hash_dword; /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. - */ - if (key & 0x0001) { - hash_result ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & - 0x0FFFF; - hash_result ^= lo_hash_dword; - } - if (key & 0x00010000) - hash_result ^= hi_hash_dword; - - /* process the remaining bits in the key */ - for (i = 1; i < 16; i++) { - if (key & (0x0001 << i)) - hash_result ^= lo_hash_dword >> i; - if (key & (0x00010000 << i)) - hash_result ^= hi_hash_dword >> i; + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed + */ + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + + /* process the remaining 30 bits in the key 2 bits at a time */ + for (i = 15; i; i-- ) { + if (key & (0x0001 << i)) hash_result ^= lo_hash_dword >> i; + if (key & (0x00010000 << i)) hash_result ^= hi_hash_dword >> i; } - return hash_result; + return hash_result & IXGBE_ATR_HASH_MASK; } /* @@ -1479,30 +1471,18 @@ u16 ixgbe_atr_compute_hash_82599(union i #define IXGBE_COMPUTE_SIG_HASH_ITERATION(_n) \ do { \ u32 n = (_n); \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - common_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << n)) \ common_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - bucket_hash ^= \ - IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << n)) \ bucket_hash ^= lo_hash_dword >> n; \ - } else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) { \ - if (n == 0) \ - sig_hash ^= IXGBE_NTOHL(atr_input->dword_stream[0]) & \ - 0x0000FFFF; \ - sig_hash ^= lo_hash_dword >> n; \ - } \ - if (IXGBE_ATR_COMMON_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << n)) \ + sig_hash ^= lo_hash_dword << (16 - n); \ + if (IXGBE_ATR_COMMON_HASH_KEY & (0x01 << (n + 16))) \ common_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x010000 << n)) \ + else if (IXGBE_ATR_BUCKET_HASH_KEY & (0x01 << (n + 16))) \ bucket_hash ^= hi_hash_dword >> n; \ - else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x010000 << n)) \ - sig_hash ^= hi_hash_dword >> n; \ + else if (IXGBE_ATR_SIGNATURE_HASH_KEY & (0x01 << (n + 16))) \ + sig_hash ^= hi_hash_dword << (16 - n); \ } while (0); /** @@ -1515,47 +1495,35 @@ do { \ * defines, and computing two keys at once since the hashed dword stream * will be the same for both keys. **/ -static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_input *atr_input) +static u32 ixgbe_atr_compute_sig_hash_82599(union ixgbe_atr_hash_dword input, + union ixgbe_atr_hash_dword common) { - u32 hi_hash_dword, lo_hash_dword; - u16 sig_hash = 0, bucket_hash = 0, common_hash = 0; + u32 hi_hash_dword, lo_hash_dword, flow_vm_vlan; + u32 sig_hash = 0, bucket_hash = 0, common_hash = 0; - /* - * the hi_hash_dword starts with vlan_id, the lo_hash_dword starts - * and ends with it, the vlan at the end is added via the word swapped - * xor with the hi_hash_dword a few lines down. The part masked off - * is the part of the hash reserved to 0. - */ - hi_hash_dword = IXGBE_NTOHL(atr_input->dword_stream[0]) & 0x0000FFFF; - lo_hash_dword = hi_hash_dword; + /* record the flow_vm_vlan bits as they are a key part to the hash */ + flow_vm_vlan = IXGBE_NTOHL(input.dword); /* generate common hash dword */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[1] ^ - atr_input->dword_stream[2] ^ - atr_input->dword_stream[3] ^ - atr_input->dword_stream[4] ^ - atr_input->dword_stream[5] ^ - atr_input->dword_stream[6] ^ - atr_input->dword_stream[7] ^ - atr_input->dword_stream[8] ^ - atr_input->dword_stream[9] ^ - atr_input->dword_stream[10]); + hi_hash_dword = IXGBE_NTOHL(common.dword); /* low dword is word swapped version of common */ - lo_hash_dword ^= (hi_hash_dword >> 16) | (hi_hash_dword << 16); + lo_hash_dword = (hi_hash_dword >> 16) | (hi_hash_dword << 16); + + /* apply flow ID/VM pool/VLAN ID bits to hash words */ + hi_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan >> 16); - /* hi dword is common dword with l4type and vm_pool added */ - hi_hash_dword ^= IXGBE_NTOHL(atr_input->dword_stream[10]) << 16; + /* Process bits 0 and 16 */ + IXGBE_COMPUTE_SIG_HASH_ITERATION(0); /* - * Process all 32 bits of the 2 keys 2 bits at a time - * - * Bit flip vlan from hash result if hash key has bit 0 set, the - * reason for doing this is because the hash generation shouldn't - * start until bit 1 in the stream so we need to cancel out a vlan - * if it was added starting at bit 0. + * apply flow ID/VM pool/VLAN ID bits to lo hash dword, we had to + * delay this because bit 0 of the stream should not be processed + * so we do not add the vlan until after bit 0 was processed */ - IXGBE_COMPUTE_SIG_HASH_ITERATION(0); + lo_hash_dword ^= flow_vm_vlan ^ (flow_vm_vlan << 16); + + /* Process remaining 30 bit of the key */ IXGBE_COMPUTE_SIG_HASH_ITERATION(1); IXGBE_COMPUTE_SIG_HASH_ITERATION(2); IXGBE_COMPUTE_SIG_HASH_ITERATION(3); @@ -1573,339 +1541,14 @@ static u32 ixgbe_atr_compute_sig_hash_82 IXGBE_COMPUTE_SIG_HASH_ITERATION(15); /* combine common_hash result with signature and bucket hashes */ - sig_hash ^= common_hash; bucket_hash ^= common_hash; + bucket_hash &= IXGBE_ATR_HASH_MASK; - /* return completed signature hash */ - return ((u32)sig_hash << 16) | (bucket_hash & IXGBE_ATR_HASH_MASK); -} - -/** - * ixgbe_atr_set_vlan_id_82599 - Sets the VLAN id in the ATR input stream - * @input: input stream to modify - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_set_vlan_id_82599(union ixgbe_atr_input *input, __be16 vlan) -{ - DEBUGFUNC("ixgbe_atr_set_vlan_id_82599"); - - input->formatted.vlan_id = vlan; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv4_82599 - Sets the source IPv4 address - * @input: input stream to modify - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv4_82599(union ixgbe_atr_input *input, __be32 src_addr) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv4_82599"); - - input->formatted.src_ip[0] = src_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv4_82599 - Sets the destination IPv4 address - * @input: input stream to modify - * @dst_addr: the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv4_82599(union ixgbe_atr_input *input, __be32 dst_addr) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv4_82599"); - - input->formatted.dst_ip[0] = dst_addr; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_ipv6_82599 - Sets the source IPv6 address - * @input: input stream to modify - * @src_addr_0: the first 4 bytes of the IP address to load - * @src_addr_1: the second 4 bytes of the IP address to load - * @src_addr_2: the third 4 bytes of the IP address to load - * @src_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_src_ipv6_82599(union ixgbe_atr_input *input, - __be32 src_addr_0, __be32 src_addr_1, - __be32 src_addr_2, __be32 src_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_src_ipv6_82599"); - - input->formatted.src_ip[0] = src_addr_0; - input->formatted.src_ip[1] = src_addr_1; - input->formatted.src_ip[2] = src_addr_2; - input->formatted.src_ip[3] = src_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_ipv6_82599 - Sets the destination IPv6 address - * @input: input stream to modify - * @dst_addr_0: the first 4 bytes of the IP address to load - * @dst_addr_1: the second 4 bytes of the IP address to load - * @dst_addr_2: the third 4 bytes of the IP address to load - * @dst_addr_3: the fourth 4 bytes of the IP address to load - **/ -s32 ixgbe_atr_set_dst_ipv6_82599(union ixgbe_atr_input *input, - __be32 dst_addr_0, __be32 dst_addr_1, - __be32 dst_addr_2, __be32 dst_addr_3) -{ - DEBUGFUNC("ixgbe_atr_set_dst_ipv6_82599"); - - input->formatted.dst_ip[0] = dst_addr_0; - input->formatted.dst_ip[1] = dst_addr_1; - input->formatted.dst_ip[2] = dst_addr_2; - input->formatted.dst_ip[3] = dst_addr_3; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_src_port_82599 - Sets the source port - * @input: input stream to modify - * @src_port: the source port to load - **/ -s32 ixgbe_atr_set_src_port_82599(union ixgbe_atr_input *input, __be16 src_port) -{ - DEBUGFUNC("ixgbe_atr_set_src_port_82599"); - - input->formatted.src_port = src_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_dst_port_82599 - Sets the destination port - * @input: input stream to modify - * @dst_port: the destination port to load - **/ -s32 ixgbe_atr_set_dst_port_82599(union ixgbe_atr_input *input, __be16 dst_port) -{ - DEBUGFUNC("ixgbe_atr_set_dst_port_82599"); - - input->formatted.dst_port = dst_port; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_flex_byte_82599 - Sets the flexible bytes - * @input: input stream to modify - * @flex_bytes: the flexible bytes to load - **/ -s32 ixgbe_atr_set_flex_byte_82599(union ixgbe_atr_input *input, __be16 flex_bytes) -{ - DEBUGFUNC("ixgbe_atr_set_flex_byte_82599"); - - input->formatted.flex_bytes = flex_bytes; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_vm_pool_82599 - Sets the Virtual Machine pool - * @input: input stream to modify - * @vm_pool: the Virtual Machine pool to load - **/ -s32 ixgbe_atr_set_vm_pool_82599(union ixgbe_atr_input *input, u8 vm_pool) -{ - DEBUGFUNC("ixgbe_atr_set_vm_pool_82599"); - - input->formatted.vm_pool = vm_pool; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_set_l4type_82599 - Sets the layer 4 packet type - * @input: input stream to modify - * @l4type: the layer 4 type value to load - * - * This call is deprecated and should be replaced with a direct access to - * input->formatted.flow_type. - **/ -s32 ixgbe_atr_set_l4type_82599(union ixgbe_atr_input *input, u8 l4type) -{ - DEBUGFUNC("ixgbe_atr_set_l4type_82599"); - - input->formatted.flow_type = l4type; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_vlan_id_82599 - Gets the VLAN id from the ATR input stream - * @input: input stream to search - * @vlan: the VLAN id to load - **/ -s32 ixgbe_atr_get_vlan_id_82599(union ixgbe_atr_input *input, __be16 *vlan) -{ - DEBUGFUNC("ixgbe_atr_get_vlan_id_82599"); - - *vlan = input->formatted.vlan_id; - - return IXGBE_SUCCESS; -} + sig_hash ^= common_hash << 16; + sig_hash &= IXGBE_ATR_HASH_MASK << 16; -/** - * ixgbe_atr_get_src_ipv4_82599 - Gets the source IPv4 address - * @input: input stream to search - * @src_addr: the IP address to load - **/ -s32 ixgbe_atr_get_src_ipv4_82599(union ixgbe_atr_input *input, __be32 *src_addr) -{ - DEBUGFUNC("ixgbe_atr_get_src_ipv4_82599"); - - *src_addr = input->formatted.src_ip[0]; - - return IXGBE_SUCCESS; -} - -/** - * ixgbe_atr_get_dst_ipv4_82599 - Gets the destination IPv4 address - * @input: input stream to search *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 01:08:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE7C6106566B; Thu, 27 Jan 2011 01:08:29 +0000 (UTC) (envelope-from weongyo.jeong@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 2BC808FC0C; Thu, 27 Jan 2011 01:08:29 +0000 (UTC) Received: by vws9 with SMTP id 9so642187vws.13 for ; Wed, 26 Jan 2011 17:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:date:to:subject:message-id:reply-to :mail-followup-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:organization :x-operation-sytem; bh=iWEBn15RS4unti+jw16/Ofcbu+eOGvQwCo/0aERtvQY=; b=nDmzrS3DrWgPjcV0cZjntD14rBiUeu3JvV3FM1yvhRkROrCCuJOlMdrkSJ2UaekwkN LF/s3pniZ3bInIPZ/AfujloM5FhWwlN97DQlI/bpRwnFS5Ns6Dv7F2JoSf1A6/kLnX+s XxS+87Z6mvnJ9pxQEy1UX2Ov02ObK5NCS+/Ts= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:subject:message-id:reply-to:mail-followup-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:organization:x-operation-sytem; b=mRgvEDuPvdFC/7VeQzBIAjet0xnDjdoqehr5xItXe8AYZLnZhzBB5zTHaTpi+xtLMf tOlDxbtdw62TwDBsjUyOe7PDapzJM/now71UgM4Pfh0lN+S5jYIYcQUhCQexFa4r94sX ti0T73MBxReyW4M83Tmw0WtvwM5KTPt4mWNk0= Received: by 10.220.176.12 with SMTP id bc12mr76442vcb.55.1296088952466; Wed, 26 Jan 2011 16:42:32 -0800 (PST) Received: from weongyo ([174.35.1.224]) by mx.google.com with ESMTPS id i14sm4601046vcr.35.2011.01.26.16.42.27 (version=SSLv3 cipher=RC4-MD5); Wed, 26 Jan 2011 16:42:29 -0800 (PST) Received: by weongyo (sSMTP sendmail emulation); Wed, 26 Jan 2011 16:43:47 -0800 From: Weongyo Jeong Date: Wed, 26 Jan 2011 16:43:47 -0800 To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: <20110127004347.GP1755@weongyo> Mail-Followup-To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201101131637.p0DGbCkX056616@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201101131637.p0DGbCkX056616@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Organization: CDNetworks. X-Operation-Sytem: FreeBSD Cc: Subject: Re: svn commit: r217358 - head/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Weongyo Jeong List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 01:08:29 -0000 On Thu, Jan 13, 2011 at 04:37:12PM +0000, Weongyo Jeong wrote: > Author: weongyo > Date: Thu Jan 13 16:37:12 2011 > New Revision: 217358 > URL: http://svn.freebsd.org/changeset/base/217358 > > Log: > Documents OUTPUT formats. While I'm here cleans up styles and words. > > Reviewed by: brueffer@ Some corrections that cleaning styles and words were done by brueffer@. regards, Weongyo Jeong From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 02:56:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49A0F106566B; Thu, 27 Jan 2011 02:56:04 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38A158FC0A; Thu, 27 Jan 2011 02:56:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R2u4Zm098728; Thu, 27 Jan 2011 02:56:04 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R2u447098726; Thu, 27 Jan 2011 02:56:04 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101270256.p0R2u447098726@svn.freebsd.org> From: Adrian Chadd Date: Thu, 27 Jan 2011 02:56:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217921 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 02:56:04 -0000 Author: adrian Date: Thu Jan 27 02:56:03 2011 New Revision: 217921 URL: http://svn.freebsd.org/changeset/base/217921 Log: Writing to the analog registers on the AR9220 (Merlin PCI) seems to require a delay. This, along with an initval change which will appear in a subsequent commit, fixes bus panics that I have been seing with the AR9220 on a Routerstation Pro (AR7161 MIPS board.) Obtained from: Linux ath9k PR: kern/154220 Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 02:27:17 2011 (r217920) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 02:56:03 2011 (r217921) @@ -858,6 +858,11 @@ ath_hal_ini_write(struct ath_hal *ah, co for (r = 0; r < ia->rows; r++) { OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), HAL_INI_VAL(ia, r, col)); + + /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) + OS_DELAY(100); + DMA_YIELD(regWr); } return regWr; @@ -881,6 +886,10 @@ ath_hal_ini_bank_write(struct ath_hal *a for (r = 0; r < ia->rows; r++) { OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]); + + /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) + OS_DELAY(100); DMA_YIELD(regWr); } return regWr; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 03:32:17 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 33571106566C; Thu, 27 Jan 2011 03:32:17 +0000 (UTC) (envelope-from gnn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2283B8FC0A; Thu, 27 Jan 2011 03:32:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R3WH4Y099746; Thu, 27 Jan 2011 03:32:17 GMT (envelope-from gnn@svn.freebsd.org) Received: (from gnn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R3WHKb099744; Thu, 27 Jan 2011 03:32:17 GMT (envelope-from gnn@svn.freebsd.org) Message-Id: <201101270332.p0R3WHKb099744@svn.freebsd.org> From: "George V. Neville-Neil" Date: Thu, 27 Jan 2011 03:32:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217922 - head/sys/fs/nfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 03:32:17 -0000 Author: gnn Date: Thu Jan 27 03:32:16 2011 New Revision: 217922 URL: http://svn.freebsd.org/changeset/base/217922 Log: Quick fix to a comment. Modified: head/sys/fs/nfs/nfsport.h Modified: head/sys/fs/nfs/nfsport.h ============================================================================== --- head/sys/fs/nfs/nfsport.h Thu Jan 27 02:56:03 2011 (r217921) +++ head/sys/fs/nfs/nfsport.h Thu Jan 27 03:32:16 2011 (r217922) @@ -639,9 +639,9 @@ int nfsmsleep(void *, void *, int, const #define TAILQ_END(head) NULL /* - * This must be defined to be a global variable the increments once + * This must be defined to be a global variable that increments once * per second, but never stops or goes backwards, even when a "date" - * command changes the tod clock. It is used for delta times for + * command changes the TOD clock. It is used for delta times for * leases, etc. */ #define NFSD_MONOSEC time_uptime From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 05:24:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F086106564A; Thu, 27 Jan 2011 05:24:30 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id ECB428FC12; Thu, 27 Jan 2011 05:24:29 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0R5OQiQ029627 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 27 Jan 2011 16:24:27 +1100 Date: Thu, 27 Jan 2011 16:24:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Barton In-Reply-To: <4D408463.4000001@FreeBSD.org> Message-ID: <20110127153956.J1436@besplex.bde.org> References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> <4D408463.4000001@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 05:24:30 -0000 On Wed, 26 Jan 2011, Doug Barton wrote: > On 01/25/2011 23:55, Bruce Evans wrote: >> ... >> Even atimes are not supported by at least the non-experimental FreeBSD >> client, so attempts to turn them off are nonsense and should have >> always failed at mount time. But such attempts bogusly always succeed > ... > I think I understand most, if not all of what you wrote here, but I'm not > nearly smart enough to translate it into something succinct for the man page. > :) "The noatime option has no effect for nfs... BUGS: the noatime option should cause .Nm to fail, but it is turned into a no-op for bug for bug compatibility with historical behaviour." ? > My concern was that the man page says that we don't support the option at > all, but with a FreeBSD client and a solaris server it has a demonstrable > effect. If someone wants to improve the wording then by all means, either > make a suggestion or just do it. :) What is the effect? I can't see any in the source code. But I found a place where vfs examines the flag. I even wrote half of the original version of this (*). It is for marking atimes on exec and mmap. VOP_MARKATIME() is called if the vnode has a mount point and the flags for the mount point don't indicate noatime or readonly. But VOP_MARKATIME() is only implemented for ffs (even recent changes to reduce bitrot of ext2fs relative to ffs don't have it), and marking atimes on exec and mmap would be especially large foot-shooting for nfs, so this too has no effect for nfs (it just causes a null or bad vop to be called, and the result to be ignored. It is hard to see the exact default behaviour since even vfs_defaults.c doesn't have an explicit entry for vop_markatime). (*) The original version of this checked MNT_NOATIME and MNT_RDONLY in vfs only as an optimization. The rather heavyweight vop VOP_SETATTR() with was (ab)used,. Now there is a separate vop for this, and only 1 file system supports this, checking the MNT_* flags should be left to the file system. In practice, MNT_NOATIME and MNT_RDONLY are rarely set for file systems that support atimes, and MNT_NOATIME should never be set for a file system that doesn't support atimes, so checking them at the vfs level isn't even an optimization. We could use a mount flag that indicates that the file system doesn't support atimes at all, but this amounts to subverting the vop system -- non-support is properly indicated by the vop being null or bad. Or you can consider the flag as making the vop depend on the mount options (the file system instance) instead of only depending on the file system (the file system source code). That might be useful, but use of it should start with more interesting vops than VOP_MARKATIME(). Say VOP_WRITE() on readonly file system instances. Even that is a bit complicated, and vfs_mark_atime()'s check of MNT_RDONLY may have races, since the file system may and does in the case of ffs have a internal readonly flag that doesn't quite track MNT_RDONLY. As it happens, ffs has special, hackish handling of atimes on readonly file systems -- it marks them for update unconditionally, then cancels the marks at update time iff the file system instance is readonly at update time (maybe it now cancels them more correctly when the readonly flag(s) change). Thus it doesn't care about the MNT_RDONLY check that vfs_mark_atimes() does. But this doesn't work for VOP_WRITE(). Bruce From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 07:33:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07916106564A; Thu, 27 Jan 2011 07:33:18 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB03A8FC13; Thu, 27 Jan 2011 07:33:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R7XHXk005360; Thu, 27 Jan 2011 07:33:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R7XHqS005358; Thu, 27 Jan 2011 07:33:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101270733.p0R7XHqS005358@svn.freebsd.org> From: Adrian Chadd Date: Thu, 27 Jan 2011 07:33:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217923 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 07:33:18 -0000 Author: adrian Date: Thu Jan 27 07:33:17 2011 New Revision: 217923 URL: http://svn.freebsd.org/changeset/base/217923 Log: Make a note to re-check whether that particular check is needed. Modified: head/sys/dev/ath/ath_hal/ah.c Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 03:32:16 2011 (r217922) +++ head/sys/dev/ath/ath_hal/ah.c Thu Jan 27 07:33:17 2011 (r217923) @@ -888,6 +888,8 @@ ath_hal_ini_bank_write(struct ath_hal *a OS_REG_WRITE(ah, HAL_INI_VAL(ia, r, 0), data[r]); /* Analog shift register delay seems needed for Merlin - PR kern/154220 */ + /* XXX verify whether any analog radio bank writes will hit up this */ + /* XXX since this is a merlin work-around; and merlin doesn't use radio banks */ if (HAL_INI_VAL(ia, r, 0) >= 0x7800 && HAL_INI_VAL(ia, r, 0) < 0x78a0) OS_DELAY(100); DMA_YIELD(regWr); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 08:02:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 738351065670; Thu, 27 Jan 2011 08:02:26 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 631CD8FC19; Thu, 27 Jan 2011 08:02:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R82QWn005997; Thu, 27 Jan 2011 08:02:26 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R82QU1005995; Thu, 27 Jan 2011 08:02:26 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101270802.p0R82QU1005995@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Thu, 27 Jan 2011 08:02:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217924 - head/sys/geom/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 08:02:26 -0000 Author: ae Date: Thu Jan 27 08:02:26 2011 New Revision: 217924 URL: http://svn.freebsd.org/changeset/base/217924 Log: While inspecting the disklabel check that start offset of partition is within provider's bounds. If not then reject this disklabel. Mark bbarea as NULL to do not free it again in destroy method. MFC after: 1 week Modified: head/sys/geom/part/g_part_bsd.c Modified: head/sys/geom/part/g_part_bsd.c ============================================================================== --- head/sys/geom/part/g_part_bsd.c Thu Jan 27 07:33:17 2011 (r217923) +++ head/sys/geom/part/g_part_bsd.c Thu Jan 27 08:02:26 2011 (r217924) @@ -426,6 +426,8 @@ g_part_bsd_read(struct g_part_table *bas continue; if (part.p_offset < table->offset) continue; + if (part.p_offset - table->offset > basetable->gpt_last) + goto invalid_label; baseentry = g_part_new_entry(basetable, index + 1, part.p_offset - table->offset, part.p_offset - table->offset + part.p_size - 1); @@ -440,6 +442,7 @@ g_part_bsd_read(struct g_part_table *bas invalid_label: printf("GEOM: %s: invalid disklabel.\n", pp->name); g_free(table->bbarea); + table->bbarea = NULL; return (EINVAL); } From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 08:42:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7781106566B; Thu, 27 Jan 2011 08:42:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D65CD8FC19; Thu, 27 Jan 2011 08:42:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R8goAl007029; Thu, 27 Jan 2011 08:42:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R8gopa007027; Thu, 27 Jan 2011 08:42:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101270842.p0R8gopa007027@svn.freebsd.org> From: Adrian Chadd Date: Thu, 27 Jan 2011 08:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217925 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 08:42:51 -0000 Author: adrian Date: Thu Jan 27 08:42:50 2011 New Revision: 217925 URL: http://svn.freebsd.org/changeset/base/217925 Log: Add missing getCapability call for AR5416. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Jan 27 08:02:26 2011 (r217924) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c Thu Jan 27 08:42:50 2011 (r217925) @@ -183,7 +183,7 @@ ar5416AniControl(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_NOISE_IMMUNITY_LEVEL: set level = %d\n", __func__, level); if (level >= params->maxNoiseImmunityLevel) { - HALDEBUG(ah, HAL_DEBUG_ANY, + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: immunity level out of range (%u > %u)\n", __func__, level, params->maxNoiseImmunityLevel); return AH_FALSE; @@ -270,7 +270,7 @@ ar5416AniControl(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_FIRSTEP_LEVEL: level = %d\n", __func__, level); if (level >= params->maxFirstepLevel) { - HALDEBUG(ah, HAL_DEBUG_ANY, + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: firstep level out of range (%u > %u)\n", __func__, level, params->maxFirstepLevel); return AH_FALSE; @@ -289,7 +289,7 @@ ar5416AniControl(struct ath_hal *ah, HAL HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_SPUR_IMMUNITY_LEVEL: level = %d\n", __func__, level); if (level >= params->maxSpurImmunityLevel) { - HALDEBUG(ah, HAL_DEBUG_ANY, + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: spur immunity level out of range (%u > %u)\n", __func__, level, params->maxSpurImmunityLevel); return AH_FALSE; @@ -331,7 +331,7 @@ ar5416AniControl(struct ath_hal *ah, HAL break; #endif /* AH_PRIVATE_DIAG */ default: - HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid cmd %u\n", + HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid cmd %u\n", __func__, cmd); return AH_FALSE; } From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:01:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B471065670; Thu, 27 Jan 2011 09:01:00 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C0118FC19; Thu, 27 Jan 2011 09:01:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R910GR007607; Thu, 27 Jan 2011 09:01:00 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R910xA007604; Thu, 27 Jan 2011 09:01:00 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101270901.p0R910xA007604@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 09:01:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217927 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:01:00 -0000 Author: cperciva Date: Thu Jan 27 09:01:00 2011 New Revision: 217927 URL: http://svn.freebsd.org/changeset/base/217927 Log: MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). k Modified: stable/8/share/man/man4/nfe.4 stable/8/share/man/man4/re.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/nfe.4 ============================================================================== --- stable/8/share/man/man4/nfe.4 Thu Jan 27 08:47:06 2011 (r217926) +++ stable/8/share/man/man4/nfe.4 Thu Jan 27 09:01:00 2011 (r217927) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: stable/8/share/man/man4/re.4 ============================================================================== --- stable/8/share/man/man4/re.4 Thu Jan 27 08:47:06 2011 (r217926) +++ stable/8/share/man/man4/re.4 Thu Jan 27 09:01:00 2011 (r217927) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:01:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 850331065696; Thu, 27 Jan 2011 09:01:44 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BD798FC15; Thu, 27 Jan 2011 09:01:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R91iZL007683; Thu, 27 Jan 2011 09:01:44 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R91it4007680; Thu, 27 Jan 2011 09:01:44 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101270901.p0R91it4007680@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 09:01:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217928 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:01:44 -0000 Author: cperciva Date: Thu Jan 27 09:01:44 2011 New Revision: 217928 URL: http://svn.freebsd.org/changeset/base/217928 Log: MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). Modified: stable/7/share/man/man4/nfe.4 stable/7/share/man/man4/re.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/nfe.4 ============================================================================== --- stable/7/share/man/man4/nfe.4 Thu Jan 27 09:01:00 2011 (r217927) +++ stable/7/share/man/man4/nfe.4 Thu Jan 27 09:01:44 2011 (r217928) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: stable/7/share/man/man4/re.4 ============================================================================== --- stable/7/share/man/man4/re.4 Thu Jan 27 09:01:00 2011 (r217927) +++ stable/7/share/man/man4/re.4 Thu Jan 27 09:01:44 2011 (r217928) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:26:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7720D106566B; Thu, 27 Jan 2011 09:26:37 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4BD008FC12; Thu, 27 Jan 2011 09:26:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R9QbiH008350; Thu, 27 Jan 2011 09:26:37 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R9QbgS008348; Thu, 27 Jan 2011 09:26:37 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101270926.p0R9QbgS008348@svn.freebsd.org> From: Adrian Chadd Date: Thu, 27 Jan 2011 09:26:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217930 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:26:37 -0000 Author: adrian Date: Thu Jan 27 09:26:37 2011 New Revision: 217930 URL: http://svn.freebsd.org/changeset/base/217930 Log: Initialise the chainmask from the EEPROM rather than the hard-coded defaults. The defaults enabled three chains on the AR5416 even if the card has two chains. This restores that and ensures that only the correct TX/RX chainmasks are used. When HT modes are enabled, all TX chains will be correctly enabled. This should now enable analog chain swapping with 2-chain cards. I'm not sure if this is needed for just the AR5416 or whether it also applies to AR9160, AR9280 and AR9287 (later on); I'll have to get clarification. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jan 27 09:04:20 2011 (r217929) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c Thu Jan 27 09:26:37 2011 (r217930) @@ -44,6 +44,7 @@ static void ar5416InitBB(struct ath_hal static void ar5416InitIMR(struct ath_hal *ah, HAL_OPMODE opmode); static void ar5416InitQoS(struct ath_hal *ah); static void ar5416InitUserSettings(struct ath_hal *ah); +static void ar5416UpdateChainMasks(struct ath_hal *ah, HAL_BOOL is_ht); #if 0 static HAL_BOOL ar5416ChannelChange(struct ath_hal *, const struct ieee80211_channel *); @@ -210,6 +211,11 @@ ar5416Reset(struct ath_hal *ah, HAL_OPMO } /* + * Setup ah_tx_chainmask / ah_rx_chainmask before we fiddle + * with enabling the TX/RX radio chains. + */ + ar5416UpdateChainMasks(ah, IEEE80211_IS_CHAN_HT(chan)); + /* * This routine swaps the analog chains - it should be done * before any radio register twiddling is done. */ @@ -1137,6 +1143,30 @@ ar5416RestoreChainMask(struct ath_hal *a } } +/* + * Update the chainmask based on the current channel configuration. + * + * XXX ath9k checks bluetooth co-existence here + * XXX ath9k checks whether the current state is "off-channel". + * XXX ath9k sticks the hardware into 1x1 mode for legacy; + * we're going to leave multi-RX on for multi-path cancellation. + */ +static void +ar5416UpdateChainMasks(struct ath_hal *ah, HAL_BOOL is_ht) +{ + struct ath_hal_private *ahpriv = AH_PRIVATE(ah); + HAL_CAPABILITIES *pCap = &ahpriv->ah_caps; + + if (is_ht) { + AH5416(ah)->ah_tx_chainmask = pCap->halTxChainMask; + } else { + AH5416(ah)->ah_tx_chainmask = 1; + } + AH5416(ah)->ah_rx_chainmask = pCap->halRxChainMask; + HALDEBUG(ah, HAL_DEBUG_ANY, "TX chainmask: 0x%x; RX chainmask: 0x%x\n", + AH5416(ah)->ah_tx_chainmask, + AH5416(ah)->ah_rx_chainmask); +} #ifndef IS_5GHZ_FAST_CLOCK_EN #define IS_5GHZ_FAST_CLOCK_EN(ah, chan) AH_FALSE From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:33:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AEA10106566C; Thu, 27 Jan 2011 09:33:30 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9D2478FC14; Thu, 27 Jan 2011 09:33:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R9XU4W008540; Thu, 27 Jan 2011 09:33:30 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R9XUoi008537; Thu, 27 Jan 2011 09:33:30 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101270933.p0R9XUoi008537@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 09:33:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217931 - releng/7.4/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:33:30 -0000 Author: cperciva Date: Thu Jan 27 09:33:30 2011 New Revision: 217931 URL: http://svn.freebsd.org/changeset/base/217931 Log: MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). Approved by: re (kib) Modified: releng/7.4/share/man/man4/nfe.4 releng/7.4/share/man/man4/re.4 Directory Properties: releng/7.4/share/man/man4/ (props changed) Modified: releng/7.4/share/man/man4/nfe.4 ============================================================================== --- releng/7.4/share/man/man4/nfe.4 Thu Jan 27 09:26:37 2011 (r217930) +++ releng/7.4/share/man/man4/nfe.4 Thu Jan 27 09:33:30 2011 (r217931) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: releng/7.4/share/man/man4/re.4 ============================================================================== --- releng/7.4/share/man/man4/re.4 Thu Jan 27 09:26:37 2011 (r217930) +++ releng/7.4/share/man/man4/re.4 Thu Jan 27 09:33:30 2011 (r217931) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:33:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18CC3106564A; Thu, 27 Jan 2011 09:33:52 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 080388FC1C; Thu, 27 Jan 2011 09:33:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R9XpL9008582; Thu, 27 Jan 2011 09:33:51 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R9Xp0N008579; Thu, 27 Jan 2011 09:33:51 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101270933.p0R9Xp0N008579@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 09:33:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217932 - releng/8.2/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:33:52 -0000 Author: cperciva Date: Thu Jan 27 09:33:51 2011 New Revision: 217932 URL: http://svn.freebsd.org/changeset/base/217932 Log: MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). Approved by: re (kib) Modified: releng/8.2/share/man/man4/nfe.4 releng/8.2/share/man/man4/re.4 Directory Properties: releng/8.2/share/man/man4/ (props changed) Modified: releng/8.2/share/man/man4/nfe.4 ============================================================================== --- releng/8.2/share/man/man4/nfe.4 Thu Jan 27 09:33:30 2011 (r217931) +++ releng/8.2/share/man/man4/nfe.4 Thu Jan 27 09:33:51 2011 (r217932) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt NFE 4 .Os .Sh NAME Modified: releng/8.2/share/man/man4/re.4 ============================================================================== --- releng/8.2/share/man/man4/re.4 Thu Jan 27 09:33:30 2011 (r217931) +++ releng/8.2/share/man/man4/re.4 Thu Jan 27 09:33:51 2011 (r217932) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January, 2011 +.Dd January 15, 2011 .Dt RE 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:47:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C35C6106564A; Thu, 27 Jan 2011 09:47:12 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id 557F98FC24; Thu, 27 Jan 2011 09:47:12 +0000 (UTC) Received: by yxh35 with SMTP id 35so533581yxh.13 for ; Thu, 27 Jan 2011 01:47:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; bh=W7m2vTVNtSWfZY4mJfnPAL9RHpcIxzuteXCdJoHdKKg=; b=KBotQ5Fkp2GKL1IDyZAc7WOjJ4AeBdYf+KbraXLgT+cIILf8q+YyCUlK7P2dAm6ItG GT+EfINqk4Ihhbv4D1Ox0TGeLCpUPF9sCiWOom3Smrgg/t9jy9JOk3F3YsFJU5CvfcRx CSSZETf7HpQGAzoEDDUsr7r6CfubEcUyWs7OE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type :content-transfer-encoding; b=T+uM/v/UTDCjHBDze14kDNH+cUY0U9+Ous/ugR8lKqSOUd05H3tLElGWJTmBN/MdaS aw/1aIKkDJRLCYy+XMH9dmW8vQg4xKPI8or1PWDkqi/IPmt8ZkJ1wlCt7h8SAACEGnj9 /qhhULEQ9sq5rQ3uz7iqnizi1EYQ5IVDR3n/0= MIME-Version: 1.0 Received: by 10.150.203.5 with SMTP id a5mr2424814ybg.323.1296120173875; Thu, 27 Jan 2011 01:22:53 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.150.182.14 with HTTP; Thu, 27 Jan 2011 01:22:53 -0800 (PST) In-Reply-To: <201101270842.p0R8gopa007027@svn.freebsd.org> References: <201101270842.p0R8gopa007027@svn.freebsd.org> Date: Thu, 27 Jan 2011 17:22:53 +0800 X-Google-Sender-Auth: -L_Wj36eXITXaIJRyKTv4xE5nIE Message-ID: From: Adrian Chadd To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: svn commit: r217925 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:47:12 -0000 Somehow subversion got confused; this is a very old commit message. It should read "convert ANI debugging to use HAL_DEBUG_ANI rather than HAL_DEBUG_ANY". Thanks, Adrian On 27 January 2011 16:42, Adrian Chadd wrote: > Author: adrian > Date: Thu Jan 27 08:42:50 2011 > New Revision: 217925 > URL: http://svn.freebsd.org/changeset/base/217925 > > Log: > =A0Add missing getCapability call for AR5416. > > Modified: > =A0head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c > > Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.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/dev/ath/ath_hal/ar5416/ar5416_ani.c =A0 =A0 =A0 =A0Thu Jan 2= 7 08:02:26 2011 =A0 =A0 =A0 =A0(r217924) > +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_ani.c =A0 =A0 =A0 =A0Thu Jan 2= 7 08:42:50 2011 =A0 =A0 =A0 =A0(r217925) > @@ -183,7 +183,7 @@ ar5416AniControl(struct ath_hal *ah, HAL > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_N= OISE_IMMUNITY_LEVEL: set level =3D %d\n", __func__, level); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (level >=3D params->maxNoiseImmunityLev= el) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANY, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANI, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"%s: immunity leve= l out of range (%u > %u)\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__func__, level, p= arams->maxNoiseImmunityLevel); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return AH_FALSE; > @@ -270,7 +270,7 @@ ar5416AniControl(struct ath_hal *ah, HAL > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_F= IRSTEP_LEVEL: level =3D %d\n", __func__, level); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (level >=3D params->maxFirstepLevel) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANY, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANI, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"%s: firstep level= out of range (%u > %u)\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__func__, level, p= arams->maxFirstepLevel); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return AH_FALSE; > @@ -289,7 +289,7 @@ ar5416AniControl(struct ath_hal *ah, HAL > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0HALDEBUG(ah, HAL_DEBUG_ANI, "%s: HAL_ANI_S= PUR_IMMUNITY_LEVEL: level =3D %d\n", __func__, level); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0if (level >=3D params->maxSpurImmunityLeve= l) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANY, > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANI, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"%s: spur immunity= level out of range (%u > %u)\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__func__, level, p= arams->maxSpurImmunityLevel); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return AH_FALSE; > @@ -331,7 +331,7 @@ ar5416AniControl(struct ath_hal *ah, HAL > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0#endif /* AH_PRIVATE_DIAG */ > =A0 =A0 =A0 =A0default: > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid cm= d %u\n", > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 HALDEBUG(ah, HAL_DEBUG_ANI, "%s: invalid cm= d %u\n", > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0__func__, cmd); > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0return AH_FALSE; > =A0 =A0 =A0 =A0} > From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 09:52:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 50E32106564A; Thu, 27 Jan 2011 09:52:32 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3F69A8FC13; Thu, 27 Jan 2011 09:52:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0R9qWur009170; Thu, 27 Jan 2011 09:52:32 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0R9qWop009165; Thu, 27 Jan 2011 09:52:32 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101270952.p0R9qWop009165@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 27 Jan 2011 09:52:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217933 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 09:52:32 -0000 Author: kib Date: Thu Jan 27 09:52:31 2011 New Revision: 217933 URL: http://svn.freebsd.org/changeset/base/217933 Log: MFC r217633: In tmpfs_readdir(), normalize handling of the directory entries that either overflow the supplied buffer, or cause uiomove fail. Do not advance cached de when directory entry was not copied out. Do not return EOF when no entries could be copied due to first entry too large for supplied buffer, signal EINVAL instead. Modified: stable/8/sys/fs/tmpfs/tmpfs_subr.c stable/8/sys/fs/tmpfs/tmpfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/tmpfs/tmpfs_subr.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 27 09:33:51 2011 (r217932) +++ stable/8/sys/fs/tmpfs/tmpfs_subr.c Thu Jan 27 09:52:31 2011 (r217933) @@ -804,9 +804,10 @@ tmpfs_dir_getdents(struct tmpfs_node *no /* Copy the new dirent structure into the output buffer and * advance pointers. */ error = uiomove(&d, d.d_reclen, uio); - - (*cntp)++; - de = TAILQ_NEXT(de, td_entries); + if (error == 0) { + (*cntp)++; + de = TAILQ_NEXT(de, td_entries); + } } while (error == 0 && uio->uio_resid > 0 && de != NULL); /* Update the offset and cache. */ Modified: stable/8/sys/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 27 09:33:51 2011 (r217932) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Thu Jan 27 09:52:31 2011 (r217933) @@ -1277,7 +1277,7 @@ outok: MPASS(error >= -1); if (error == -1) - error = 0; + error = (cnt != 0) ? 0 : EINVAL; if (eofflag != NULL) *eofflag = From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 12:04:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34BB8106566C; Thu, 27 Jan 2011 12:04:12 +0000 (UTC) (envelope-from rwatson@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 087BF8FC16; Thu, 27 Jan 2011 12:04:12 +0000 (UTC) Received: from [192.168.2.112] (host109-157-98-53.range109-157.btcentralplus.com [109.157.98.53]) by cyrus.watson.org (Postfix) with ESMTPSA id 53B3046B3B; Thu, 27 Jan 2011 07:04:10 -0500 (EST) Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: "Robert N. M. Watson" In-Reply-To: Date: Thu, 27 Jan 2011 12:04:08 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4BA17961-83D4-4B91-88CF-82FE5502D8E8@freebsd.org> References: <201101251739.p0PHdqKX044842@svn.freebsd.org> <12EB1BEA-F0AF-4B2A-AFEB-9C38C7994FA8@freebsd.org> <161C86E9-A24C-4E71-90C6-26C3B47ACC1B@freebsd.org> To: mdf@FreeBSD.org X-Mailer: Apple Mail (2.1082) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217830 - head/share/man/man9 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 12:04:12 -0000 On 26 Jan 2011, at 23:41, mdf@FreeBSD.org wrote: > Upon further consideration, I don't think sbuf_new_for_sysctl() should > be doing the wire. Whether the buffer needs to be wired or not is up > to the implementation of the individual sysctl; *most* of them will be > holding a lock when doing sbuf_print, but there's no guarantee. It's > simpler to just leave this in the hands of the implementor, and it > also enables better error reporting. One pondering: normally, it's nice if functions that may sleep = unconditionally trigger a WITNESS sleep warning even if they don't = actually sleep this time (although conditioned on arguments: if you pass = M_WAITOK to malloc, you always get the warning even if malloc doesn't = sleep, whereas if you pass M_NOWAIT it doesn't). I'm wondering how we = could do something similar here -- the problem is that sysctl copy = routines don't currently know if a page is wired or not, and therefore = whether they could sleep or not. I wonder, with a witness kernel, how = expensive it would be to have witness check for each range it was = copying in/out of, whether the page was wired (by asking VM = presumably)... There might also be lock order issues with that query. One way to handle this would be to have the sbuf sysctl setup pass in a = "wired" flag, or some other indication of wiredness, and then that could = be saved with the sbuf -- when sbuf_printf and friends are called, and a = non-wired sysctl has been set up, then the witness warning fires. Robert= From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:37:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9EC21065674; Thu, 27 Jan 2011 13:37:45 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A822E8FC1B; Thu, 27 Jan 2011 13:37:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDbjwK017989; Thu, 27 Jan 2011 13:37:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDbjbb017987; Thu, 27 Jan 2011 13:37:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271337.p0RDbjbb017987@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:37:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217936 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:37:45 -0000 Author: mav Date: Thu Jan 27 13:37:45 2011 New Revision: 217936 URL: http://svn.freebsd.org/changeset/base/217936 Log: MFC r215449: Some VIA SATA controllers provide access to non-standard SATA registers via PCI config space. Use them to implement hot-plug and link speed reporting. Tested on ASRock PV530 board with VX900 chipset. Modified: stable/8/sys/dev/ata/chipsets/ata-via.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-via.c Thu Jan 27 13:16:08 2011 (r217935) +++ stable/8/sys/dev/ata/chipsets/ata-via.c Thu Jan 27 13:37:45 2011 (r217936) @@ -63,6 +63,12 @@ static int ata_via_new_setmode(device_t static int ata_via_sata_ch_attach(device_t dev); static int ata_via_sata_getrev(device_t dev, int target); static int ata_via_sata_setmode(device_t dev, int target, int mode); +static void ata_via_sata_reset(device_t dev); +static int ata_via_sata_scr_read(device_t dev, int port, int reg, + u_int32_t *result); +static int ata_via_sata_scr_write(device_t dev, int port, int reg, + u_int32_t value); +static int ata_via_sata_status(device_t dev); /* misc defines */ #define VIA33 0 @@ -153,11 +159,12 @@ ata_via_chipinit(device_t dev) if (ata_ahci_chipinit(dev) != ENXIO) return (0); } - /* 2 SATA without SATA registers on first channel + 1 PATA on second */ + /* 2 SATA with "SATA registers" at PCI config space + PATA on secondary */ if (ctlr->chip->cfg2 & VIASATA) { ctlr->ch_attach = ata_via_sata_ch_attach; ctlr->setmode = ata_via_sata_setmode; ctlr->getrev = ata_via_sata_getrev; + ctlr->reset = ata_via_sata_reset; return 0; } /* Legacy SATA/SATA+PATA with SATA registers in BAR(5). */ @@ -405,18 +412,30 @@ ata_via_sata_ch_attach(device_t dev) if (ata_pci_ch_attach(dev)) return ENXIO; - if (ch->unit == 0) + if (ch->unit == 0) { + ch->hw.status = ata_via_sata_status; + ch->hw.pm_read = ata_via_sata_scr_read; + ch->hw.pm_write = ata_via_sata_scr_write; + ch->flags |= ATA_PERIODIC_POLL; ch->flags |= ATA_SATA; + ata_sata_scr_write(ch, 0, ATA_SERROR, 0xffffffff); + ata_sata_scr_write(ch, 1, ATA_SERROR, 0xffffffff); + } return (0); } static int ata_via_sata_getrev(device_t dev, int target) { + device_t parent = device_get_parent(dev); struct ata_channel *ch = device_get_softc(dev); - if (ch->unit == 0) - return (1); + if (ch->unit == 0) { + if (pci_read_config(parent, 0xa0 + target, 1) & 0x10) + return (2); + else + return (1); + } return (0); } @@ -430,5 +449,110 @@ ata_via_sata_setmode(device_t dev, int t return (ata_via_old_setmode(dev, target, mode)); } +static void +ata_via_sata_reset(device_t dev) +{ + struct ata_channel *ch = device_get_softc(dev); + int devs; + + if (ch->unit == 0) { + devs = ata_sata_phy_reset(dev, 0, 0); + DELAY(10000); + devs += ata_sata_phy_reset(dev, 1, 0); + } else + devs = 1; + if (devs) + ata_generic_reset(dev); +} + +static int +ata_via_sata_scr_read(device_t dev, int port, int reg, u_int32_t *result) +{ + struct ata_channel *ch; + device_t parent; + uint32_t val; + + parent = device_get_parent(dev); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + switch (reg) { + case ATA_SSTATUS: + val = pci_read_config(parent, 0xa0 + port, 1); + *result = val & 0x03; + if (*result != ATA_SS_DET_NO_DEVICE) { + if (val & 0x04) + *result |= ATA_SS_IPM_PARTIAL; + else if (val & 0x08) + *result |= ATA_SS_IPM_SLUMBER; + else + *result |= ATA_SS_IPM_ACTIVE; + if (val & 0x10) + *result |= ATA_SS_SPD_GEN2; + else + *result |= ATA_SS_SPD_GEN1; + } + break; + case ATA_SERROR: + *result = pci_read_config(parent, 0xa8 + port * 4, 4); + break; + case ATA_SCONTROL: + val = pci_read_config(parent, 0xa4 + port, 1); + *result = 0; + if (val & 0x01) + *result |= ATA_SC_DET_RESET; + if (val & 0x02) + *result |= ATA_SC_DET_DISABLE; + if (val & 0x04) + *result |= ATA_SC_IPM_DIS_PARTIAL; + if (val & 0x08) + *result |= ATA_SC_IPM_DIS_SLUMBER; + break; + default: + return (EINVAL); + } + return (0); +} + +static int +ata_via_sata_scr_write(device_t dev, int port, int reg, u_int32_t value) +{ + struct ata_channel *ch; + device_t parent; + uint32_t val; + + parent = device_get_parent(dev); + ch = device_get_softc(dev); + port = (port == 1) ? 1 : 0; + switch (reg) { + case ATA_SERROR: + pci_write_config(parent, 0xa8 + port * 4, value, 4); + break; + case ATA_SCONTROL: + val = 0; + if (value & ATA_SC_DET_RESET) + val |= 0x01; + if (value & ATA_SC_DET_DISABLE) + val |= 0x02; + if (value & ATA_SC_IPM_DIS_PARTIAL) + val |= 0x04; + if (value & ATA_SC_IPM_DIS_SLUMBER) + val |= 0x08; + pci_write_config(parent, 0xa4 + port, val, 1); + break; + default: + return (EINVAL); + } + return (0); +} + +static int +ata_via_sata_status(device_t dev) +{ + + ata_sata_phy_check_events(dev, 0); + ata_sata_phy_check_events(dev, 1); + return (ata_pci_status(dev)); +} + ATA_DECLARE_DRIVER(ata_via); MODULE_DEPEND(ata_via, ata_ahci, 1, 1, 1); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:38:52 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 90DD5106566B; Thu, 27 Jan 2011 13:38:52 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBBD8FC1D; Thu, 27 Jan 2011 13:38:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDcqlI018056; Thu, 27 Jan 2011 13:38:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDcqrP018054; Thu, 27 Jan 2011 13:38:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271338.p0RDcqrP018054@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:38:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217937 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:38:52 -0000 Author: mav Date: Thu Jan 27 13:38:52 2011 New Revision: 217937 URL: http://svn.freebsd.org/changeset/base/217937 Log: MFC r215451: Record that there is no devices if SATA reset found none. Modified: stable/8/sys/dev/ata/chipsets/ata-via.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-via.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-via.c Thu Jan 27 13:37:45 2011 (r217936) +++ stable/8/sys/dev/ata/chipsets/ata-via.c Thu Jan 27 13:38:52 2011 (r217937) @@ -463,6 +463,8 @@ ata_via_sata_reset(device_t dev) devs = 1; if (devs) ata_generic_reset(dev); + else + ch->devices = 0; } static int From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:40:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CCBEA1065670; Thu, 27 Jan 2011 13:40:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5CBD8FC1C; Thu, 27 Jan 2011 13:40:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDe3UJ018135; Thu, 27 Jan 2011 13:40:03 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDe3rR018133; Thu, 27 Jan 2011 13:40:03 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271340.p0RDe3rR018133@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:40:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217938 - stable/8/sys/dev/ata/chipsets X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:40:04 -0000 Author: mav Date: Thu Jan 27 13:40:03 2011 New Revision: 217938 URL: http://svn.freebsd.org/changeset/base/217938 Log: MFC r215936: Do hard reset before soft reset for SATA channels. Soft reset reported to be not enough to restore device readiness in some situations. Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ata/chipsets/ata-serverworks.c ============================================================================== --- stable/8/sys/dev/ata/chipsets/ata-serverworks.c Thu Jan 27 13:38:52 2011 (r217937) +++ stable/8/sys/dev/ata/chipsets/ata-serverworks.c Thu Jan 27 13:40:03 2011 (r217938) @@ -413,7 +413,7 @@ ata_serverworks_sata_reset(device_t dev) { struct ata_channel *ch = device_get_softc(dev); - if (ata_sata_phy_reset(dev, -1, 1)) + if (ata_sata_phy_reset(dev, -1, 0)) ata_generic_reset(dev); else ch->devices = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:43:33 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6FB61065675; Thu, 27 Jan 2011 13:43:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D5EDC8FC0A; Thu, 27 Jan 2011 13:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDhXpi018310; Thu, 27 Jan 2011 13:43:33 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDhXek018308; Thu, 27 Jan 2011 13:43:33 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271343.p0RDhXek018308@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217939 - stable/8/sys/dev/ahci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:43:34 -0000 Author: mav Date: Thu Jan 27 13:43:33 2011 New Revision: 217939 URL: http://svn.freebsd.org/changeset/base/217939 Log: MFC r215725: Fix small typo. Modified: stable/8/sys/dev/ahci/ahci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ahci/ahci.c ============================================================================== --- stable/8/sys/dev/ahci/ahci.c Thu Jan 27 13:40:03 2011 (r217938) +++ stable/8/sys/dev/ahci/ahci.c Thu Jan 27 13:43:33 2011 (r217939) @@ -858,7 +858,7 @@ ahci_ch_attach(device_t dev) ch->caps = ctlr->caps; ch->caps2 = ctlr->caps2; ch->quirks = ctlr->quirks; - ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1, + ch->numslots = ((ch->caps & AHCI_CAP_NCS) >> AHCI_CAP_NCS_SHIFT) + 1; mtx_init(&ch->mtx, "AHCI channel lock", NULL, MTX_DEF); resource_int_value(device_get_name(dev), device_get_unit(dev), "pm_level", &ch->pm_level); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:52:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDAE81065675; Thu, 27 Jan 2011 13:52:23 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4F38FC18; Thu, 27 Jan 2011 13:52:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDqNVv018656; Thu, 27 Jan 2011 13:52:23 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDqNjt018654; Thu, 27 Jan 2011 13:52:23 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271352.p0RDqNjt018654@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:52:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217940 - stable/8/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:52:23 -0000 Author: mav Date: Thu Jan 27 13:52:23 2011 New Revision: 217940 URL: http://svn.freebsd.org/changeset/base/217940 Log: MFC r208441: Report relative card address to NewBus as location string. Modified: stable/8/sys/dev/mmc/mmc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Thu Jan 27 13:43:33 2011 (r217939) +++ stable/8/sys/dev/mmc/mmc.c Thu Jan 27 13:52:23 2011 (r217940) @@ -1500,6 +1500,15 @@ mmc_delayed_attach(void *xsc) config_intrhook_disestablish(&sc->config_intrhook); } +static int +mmc_child_location_str(device_t dev, device_t child, char *buf, + size_t buflen) +{ + + snprintf(buf, buflen, "rca=0x%04x", mmc_get_rca(child)); + return (0); +} + static device_method_t mmc_methods[] = { /* device_if */ DEVMETHOD(device_probe, mmc_probe), @@ -1511,6 +1520,7 @@ static device_method_t mmc_methods[] = { /* Bus interface */ DEVMETHOD(bus_read_ivar, mmc_read_ivar), DEVMETHOD(bus_write_ivar, mmc_write_ivar), + DEVMETHOD(bus_child_location_str, mmc_child_location_str), /* MMC Bus interface */ DEVMETHOD(mmcbus_wait_for_request, mmc_wait_for_request), From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 13:53:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28D56106566B; Thu, 27 Jan 2011 13:53:22 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17B568FC12; Thu, 27 Jan 2011 13:53:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RDrL6r018727; Thu, 27 Jan 2011 13:53:21 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RDrLnu018725; Thu, 27 Jan 2011 13:53:21 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201101271353.p0RDrLnu018725@svn.freebsd.org> From: Alexander Motin Date: Thu, 27 Jan 2011 13:53:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217941 - stable/8/sys/dev/mmc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 13:53:22 -0000 Author: mav Date: Thu Jan 27 13:53:21 2011 New Revision: 217941 URL: http://svn.freebsd.org/changeset/base/217941 Log: MFC r217509: Fix 32bit bit fields handling. This fixes card serial number fetching. It was just a cosmetic issue, because that number is only reported in logs. Modified: stable/8/sys/dev/mmc/mmc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/mmc/mmc.c ============================================================================== --- stable/8/sys/dev/mmc/mmc.c Thu Jan 27 13:52:23 2011 (r217940) +++ stable/8/sys/dev/mmc/mmc.c Thu Jan 27 13:53:21 2011 (r217941) @@ -749,7 +749,7 @@ mmc_get_bits(uint32_t *bits, int bit_len uint32_t retval = bits[i] >> shift; if (size + shift > 32) retval |= bits[i - 1] << (32 - shift); - return (retval & ((1 << size) - 1)); + return (retval & ((1llu << size) - 1)); } static void From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 14:16:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95244106564A; Thu, 27 Jan 2011 14:16:12 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 830D28FC12; Thu, 27 Jan 2011 14:16:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0REGCXf019560; Thu, 27 Jan 2011 14:16:12 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0REGCHs019554; Thu, 27 Jan 2011 14:16:12 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101271416.p0REGCHs019554@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 27 Jan 2011 14:16:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217942 - in head: gnu/lib/libgcc gnu/lib/libgomp gnu/usr.bin/binutils lib/libc usr.sbin X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 14:16:12 -0000 Author: jchandra Date: Thu Jan 27 14:16:12 2011 New Revision: 217942 URL: http://svn.freebsd.org/changeset/base/217942 Log: Fix n32 compile. These changes are needed to fix n32 compile after the recent change of mips n32 MACHINE_ARCH to mipsn32eb/mipsn32el. Reviewed by: imp, bz (earlier version) Modified: head/gnu/lib/libgcc/Makefile head/gnu/lib/libgomp/Makefile head/gnu/usr.bin/binutils/Makefile.inc0 head/lib/libc/Makefile head/usr.sbin/Makefile.mips Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Thu Jan 27 13:53:21 2011 (r217941) +++ head/gnu/lib/libgcc/Makefile Thu Jan 27 14:16:12 2011 (r217942) @@ -121,8 +121,8 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns .if ${TARGET_CPUARCH} == mips LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c -# XXX do we need n32 here? -.if ${TARGET_ARCH:Mmips64*} != "" +# ABIs other than o32 need this +.if ${TARGET_ARCH:Mmipse[lb]} == "" LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c Modified: head/gnu/lib/libgomp/Makefile ============================================================================== --- head/gnu/lib/libgomp/Makefile Thu Jan 27 13:53:21 2011 (r217941) +++ head/gnu/lib/libgomp/Makefile Thu Jan 27 14:16:12 2011 (r217942) @@ -25,7 +25,7 @@ VERSION_MAP= ${SRCDIR}/libgomp.map # Target-specific OpenMP configuration .if ${MACHINE_CPUARCH} == arm || ${MACHINE_CPUARCH} == i386 || \ ${MACHINE_ARCH} == powerpc || \ - ${MACHINE_ARCH} == mipsel || ${MACHINE_ARCH} == mipseb + (${MACHINE_CPUARCH} == mips && ${MACHINE_ARCH:Mmips64*} == "") OMP_LOCK_ALIGN = 4 OMP_LOCK_KIND= 4 OMP_LOCK_SIZE= 4 Modified: head/gnu/usr.bin/binutils/Makefile.inc0 ============================================================================== --- head/gnu/usr.bin/binutils/Makefile.inc0 Thu Jan 27 13:53:21 2011 (r217941) +++ head/gnu/usr.bin/binutils/Makefile.inc0 Thu Jan 27 14:16:12 2011 (r217942) @@ -28,7 +28,7 @@ SRCDIR= ${.CURDIR}/${RELSRC} .if ${TARGET_CPUARCH} == "arm" || ${TARGET_CPUARCH} == "i386" || \ ${TARGET_ARCH} == "powerpc" || \ - ${TARGET_ARCH} == "mipsel" || ${TARGET_ARCH} == "mipseb" + (${TARGET_CPUARCH} == "mips" && ${TARGET_ARCH:Mmips64*} == "") CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=32 .else CFLAGS+= -DBFD_DEFAULT_TARGET_SIZE=64 Modified: head/lib/libc/Makefile ============================================================================== --- head/lib/libc/Makefile Thu Jan 27 13:53:21 2011 (r217941) +++ head/lib/libc/Makefile Thu Jan 27 14:16:12 2011 (r217942) @@ -68,6 +68,7 @@ NOASM= ${LIBC_ARCH} != "ia64" && \ ${LIBC_ARCH} != "powerpc64" && \ ${LIBC_ARCH} != "sparc64" && \ + ${MACHINE_ARCH:Mmipsn32*} == "" && \ ${MACHINE_ARCH:Mmips64*} == "" .include "${.CURDIR}/quad/Makefile.inc" .endif Modified: head/usr.sbin/Makefile.mips ============================================================================== --- head/usr.sbin/Makefile.mips Thu Jan 27 13:53:21 2011 (r217941) +++ head/usr.sbin/Makefile.mips Thu Jan 27 14:16:12 2011 (r217942) @@ -1,6 +1,7 @@ # $FreeBSD$ SUBDIR:= ${SUBDIR:Nsysinstall} -.if ${MACHINE_ARCH:Mmips64*} != "" +# uathload broken for n32 and n64 due to toolchain issues +.if ${MACHINE_ARCH:Mmipse[lb]} == "" SUBDIR:= ${SUBDIR:Nuathload} .endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 14:49:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68EED1065693; Thu, 27 Jan 2011 14:49:22 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 579B78FC14; Thu, 27 Jan 2011 14:49:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0REnM4r020517; Thu, 27 Jan 2011 14:49:22 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0REnMWV020513; Thu, 27 Jan 2011 14:49:22 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101271449.p0REnMWV020513@svn.freebsd.org> From: "Jayachandran C." Date: Thu, 27 Jan 2011 14:49:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217944 - in head/sys/mips: include mips X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 14:49:22 -0000 Author: jchandra Date: Thu Jan 27 14:49:22 2011 New Revision: 217944 URL: http://svn.freebsd.org/changeset/base/217944 Log: Implement sf_buf using direct map (XKPHYS) in MIPS n64. - Provide trivial implementation of sf_buf_alloc(), sf_buf_free(), sf_buf_kva() and sf_buf_page() using direct map for n64. - uio_machdep.c - use macros so that the direct map will be used in case of n64. Reviewed by: imp (earlier version) Obtained from: jmallett (user/jmallett/octeon) Modified: head/sys/mips/include/sf_buf.h head/sys/mips/mips/uio_machdep.c head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/include/sf_buf.h ============================================================================== --- head/sys/mips/include/sf_buf.h Thu Jan 27 14:46:01 2011 (r217943) +++ head/sys/mips/include/sf_buf.h Thu Jan 27 14:49:22 2011 (r217944) @@ -29,8 +29,35 @@ #ifndef _MACHINE_SF_BUF_H_ #define _MACHINE_SF_BUF_H_ +#ifdef __mips_n64 +#include +#include +#include +#else #include +#endif +#ifdef __mips_n64 +/* In 64 bit the whole memory is directly mapped */ +struct sf_buf; + +static __inline vm_offset_t +sf_buf_kva(struct sf_buf *sf) +{ + vm_page_t m; + + m = (vm_page_t)sf; + return (MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(m))); +} + +static __inline struct vm_page * +sf_buf_page(struct sf_buf *sf) +{ + + return ((vm_page_t)sf); +} + +#else /* ! __mips_n64 */ struct vm_page; struct sf_buf { @@ -52,5 +79,6 @@ sf_buf_page(struct sf_buf *sf) return (sf->m); } +#endif /* __mips_n64 */ #endif /* !_MACHINE_SF_BUF_H_ */ Modified: head/sys/mips/mips/uio_machdep.c ============================================================================== --- head/sys/mips/mips/uio_machdep.c Thu Jan 27 14:46:01 2011 (r217943) +++ head/sys/mips/mips/uio_machdep.c Thu Jan 27 14:49:22 2011 (r217944) @@ -92,9 +92,9 @@ uiomove_fromphys(vm_page_t ma[], vm_offs cnt = ulmin(cnt, PAGE_SIZE - page_offset); m = ma[offset >> PAGE_SHIFT]; pa = VM_PAGE_TO_PHYS(m); - if (pa < MIPS_KSEG0_LARGEST_PHYS) { + if (MIPS_DIRECT_MAPPABLE(pa)) { sf = NULL; - cp = (char *)MIPS_PHYS_TO_KSEG0(pa) + page_offset; + cp = (char *)MIPS_PHYS_TO_DIRECT(pa) + page_offset; /* * flush all mappings to this page, KSEG0 address first * in order to get it overwritten by correct data Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Thu Jan 27 14:46:01 2011 (r217943) +++ head/sys/mips/mips/vm_machdep.c Thu Jan 27 14:49:22 2011 (r217944) @@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$"); #define NSFBUFS (512 + maxusers * 16) #endif +#ifndef __mips_n64 static void sf_buf_init(void *arg); SYSINIT(sock_sf, SI_SUB_MBUF, SI_ORDER_ANY, sf_buf_init, NULL); @@ -95,6 +96,7 @@ static struct { } sf_freelist; static u_int sf_buf_alloc_want; +#endif /* * Finish a fork operation, with process p2 nearly set up. @@ -458,6 +460,7 @@ kvtop(void *addr) /* * Allocate a pool of sf_bufs (sendfile(2) or "super-fast" if you prefer. :-)) */ +#ifndef __mips_n64 static void sf_buf_init(void *arg) { @@ -479,6 +482,7 @@ sf_buf_init(void *arg) } sf_buf_alloc_want = 0; } +#endif /* * Get an sf_buf from the freelist. Will block if none are available. @@ -486,6 +490,7 @@ sf_buf_init(void *arg) struct sf_buf * sf_buf_alloc(struct vm_page *m, int flags) { +#ifndef __mips_n64 struct sf_buf *sf; int error; @@ -514,6 +519,9 @@ sf_buf_alloc(struct vm_page *m, int flag } mtx_unlock(&sf_freelist.sf_lock); return (sf); +#else + return ((struct sf_buf *)m); +#endif } /* @@ -522,7 +530,7 @@ sf_buf_alloc(struct vm_page *m, int flag void sf_buf_free(struct sf_buf *sf) { - +#ifndef __mips_n64 pmap_qremove(sf->kva, 1); mtx_lock(&sf_freelist.sf_lock); SLIST_INSERT_HEAD(&sf_freelist.sf_head, sf, free_list); @@ -530,6 +538,7 @@ sf_buf_free(struct sf_buf *sf) if (sf_buf_alloc_want > 0) wakeup(&sf_freelist); mtx_unlock(&sf_freelist.sf_lock); +#endif } /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 16:10:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B09021065696; Thu, 27 Jan 2011 16:10:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 855BF8FC14; Thu, 27 Jan 2011 16:10:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RGAPDd022604; Thu, 27 Jan 2011 16:10:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RGAPPC022602; Thu, 27 Jan 2011 16:10:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101271610.p0RGAPPC022602@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 27 Jan 2011 16:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217946 - head/sys/dev/md X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 16:10:25 -0000 Author: kib Date: Thu Jan 27 16:10:25 2011 New Revision: 217946 URL: http://svn.freebsd.org/changeset/base/217946 Log: Add support for BIO_DELETE on swap-backed md(4). In the case of BIO_DELETE covering the whole page, free the page. Otherwise, clear the region and mark it clean. Not marking the page dirty could reinstantiate cleared data, but it is allowed by BIO_DELETE specification and saves unneeded write to swap. Reviewed by: alc Tested by: pho MFC after: 2 weeks Modified: head/sys/dev/md/md.c Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Thu Jan 27 15:27:07 2011 (r217945) +++ head/sys/dev/md/md.c Thu Jan 27 16:10:25 2011 (r217946) @@ -649,7 +649,6 @@ mdstart_swap(struct md_s *sc, struct bio } bcopy(p, (void *)(sf_buf_kva(sf) + offs), len); m->valid = VM_PAGE_BITS_ALL; -#if 0 } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); @@ -659,16 +658,21 @@ mdstart_swap(struct md_s *sc, struct bio vm_page_wakeup(m); break; } - bzero((void *)(sf_buf_kva(sf) + offs), len); - vm_page_dirty(m); - m->valid = VM_PAGE_BITS_ALL; -#endif + if (len != PAGE_SIZE) { + bzero((void *)(sf_buf_kva(sf) + offs), len); + vm_page_clear_dirty(m, offs, len); + m->valid = VM_PAGE_BITS_ALL; + } else + vm_pager_page_unswapped(m); } sf_buf_free(sf); sched_unpin(); vm_page_wakeup(m); vm_page_lock(m); - vm_page_activate(m); + if (bp->bio_cmd == BIO_DELETE && len == PAGE_SIZE) + vm_page_free(m); + else + vm_page_activate(m); vm_page_unlock(m); if (bp->bio_cmd == BIO_WRITE) vm_page_dirty(m); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:31:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B7C106566B; Thu, 27 Jan 2011 18:31:07 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 756228FC12; Thu, 27 Jan 2011 18:31:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIV7T4028218; Thu, 27 Jan 2011 18:31:07 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIV7It028215; Thu, 27 Jan 2011 18:31:07 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271831.p0RIV7It028215@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:31:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217948 - in stable/8/sys/dev: alc jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:31:07 -0000 Author: yongari Date: Thu Jan 27 18:31:07 2011 New Revision: 217948 URL: http://svn.freebsd.org/changeset/base/217948 Log: MFC r216362: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/8/sys/dev/alc/if_alc.c stable/8/sys/dev/jme/if_jme.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/alc/if_alc.c ============================================================================== --- stable/8/sys/dev/alc/if_alc.c Thu Jan 27 16:47:33 2011 (r217947) +++ stable/8/sys/dev/alc/if_alc.c Thu Jan 27 18:31:07 2011 (r217948) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2668,9 +2667,10 @@ alc_int_task(void *arg, int pending) ifp = sc->alc_ifp; status = CSR_READ_4(sc, ALC_INTR_STATUS); - more = atomic_readandclear_int(&sc->alc_morework); - if (more != 0) + if (sc->alc_morework != 0) { + sc->alc_morework = 0; status |= INTR_RX_PKT; + } if ((status & ALC_INTRS) == 0) goto done; @@ -2682,7 +2682,7 @@ alc_int_task(void *arg, int pending) if ((status & INTR_RX_PKT) != 0) { more = alc_rxintr(sc, sc->alc_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->alc_morework, 1); + sc->alc_morework = 1; else if (more == EIO) { ALC_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Thu Jan 27 16:47:33 2011 (r217947) +++ stable/8/sys/dev/jme/if_jme.c Thu Jan 27 18:31:07 2011 (r217948) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2189,7 +2188,7 @@ jme_link_task(void *arg, int pending) * procuder/consumer index. */ sc->jme_cdata.jme_rx_cons = 0; - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; jme_init_tx_ring(sc); /* Initialize shadow status block. */ jme_init_ssb(sc); @@ -2259,10 +2258,9 @@ jme_int_task(void *arg, int pending) ifp = sc->jme_ifp; status = CSR_READ_4(sc, JME_INTR_STATUS); - more = atomic_readandclear_int(&sc->jme_morework); - if (more != 0) { + if (sc->jme_morework != 0) { + sc->jme_morework = 0; status |= INTR_RXQ_COAL | INTR_RXQ_COAL_TO; - more = 0; } if ((status & JME_INTRS) == 0 || status == 0xFFFFFFFF) goto done; @@ -2278,7 +2276,7 @@ jme_int_task(void *arg, int pending) if ((status & (INTR_RXQ_COAL | INTR_RXQ_COAL_TO)) != 0) { more = jme_rxintr(sc, sc->jme_process_limit); if (more != 0) - atomic_set_int(&sc->jme_morework, 1); + sc->jme_morework = 1; } if ((status & INTR_RXQ_DESC_EMPTY) != 0) { /* @@ -2988,7 +2986,7 @@ jme_init_rx_ring(struct jme_softc *sc) sc->jme_cdata.jme_rx_cons = 0; JME_RXCHAIN_RESET(sc); - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; rd = &sc->jme_rdata; bzero(rd->jme_rx_ring, JME_RX_RING_SIZE); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:34:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43C6E1065697; Thu, 27 Jan 2011 18:34:06 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2966E8FC22; Thu, 27 Jan 2011 18:34:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIY6nR028395; Thu, 27 Jan 2011 18:34:06 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIY6Ui028392; Thu, 27 Jan 2011 18:34:06 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271834.p0RIY6Ui028392@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:34:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217949 - in stable/7/sys/dev: alc jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:34:06 -0000 Author: yongari Date: Thu Jan 27 18:34:05 2011 New Revision: 217949 URL: http://svn.freebsd.org/changeset/base/217949 Log: MFC r216362: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/7/sys/dev/alc/if_alc.c stable/7/sys/dev/jme/if_jme.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/alc/if_alc.c ============================================================================== --- stable/7/sys/dev/alc/if_alc.c Thu Jan 27 18:31:07 2011 (r217948) +++ stable/7/sys/dev/alc/if_alc.c Thu Jan 27 18:34:05 2011 (r217949) @@ -68,7 +68,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2668,9 +2667,10 @@ alc_int_task(void *arg, int pending) ifp = sc->alc_ifp; status = CSR_READ_4(sc, ALC_INTR_STATUS); - more = atomic_readandclear_int(&sc->alc_morework); - if (more != 0) + if (sc->alc_morework != 0) { + sc->alc_morework = 0; status |= INTR_RX_PKT; + } if ((status & ALC_INTRS) == 0) goto done; @@ -2682,7 +2682,7 @@ alc_int_task(void *arg, int pending) if ((status & INTR_RX_PKT) != 0) { more = alc_rxintr(sc, sc->alc_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->alc_morework, 1); + sc->alc_morework = 1; else if (more == EIO) { ALC_LOCK(sc); ifp->if_drv_flags &= ~IFF_DRV_RUNNING; Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:31:07 2011 (r217948) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:34:05 2011 (r217949) @@ -64,7 +64,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2189,7 +2188,7 @@ jme_link_task(void *arg, int pending) * procuder/consumer index. */ sc->jme_cdata.jme_rx_cons = 0; - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; jme_init_tx_ring(sc); /* Initialize shadow status block. */ jme_init_ssb(sc); @@ -2259,10 +2258,9 @@ jme_int_task(void *arg, int pending) ifp = sc->jme_ifp; status = CSR_READ_4(sc, JME_INTR_STATUS); - more = atomic_readandclear_int(&sc->jme_morework); - if (more != 0) { + if (sc->jme_morework != 0) { + sc->jme_morework = 0; status |= INTR_RXQ_COAL | INTR_RXQ_COAL_TO; - more = 0; } if ((status & JME_INTRS) == 0 || status == 0xFFFFFFFF) goto done; @@ -2278,7 +2276,7 @@ jme_int_task(void *arg, int pending) if ((status & (INTR_RXQ_COAL | INTR_RXQ_COAL_TO)) != 0) { more = jme_rxintr(sc, sc->jme_process_limit); if (more != 0) - atomic_set_int(&sc->jme_morework, 1); + sc->jme_morework = 1; } if ((status & INTR_RXQ_DESC_EMPTY) != 0) { /* @@ -2988,7 +2986,7 @@ jme_init_rx_ring(struct jme_softc *sc) sc->jme_cdata.jme_rx_cons = 0; JME_RXCHAIN_RESET(sc); - atomic_set_int(&sc->jme_morework, 0); + sc->jme_morework = 0; rd = &sc->jme_rdata; bzero(rd->jme_rx_ring, JME_RX_RING_SIZE); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:37:10 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E62E91065670; Thu, 27 Jan 2011 18:37:10 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D4FED8FC1A; Thu, 27 Jan 2011 18:37:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIbA5H028597; Thu, 27 Jan 2011 18:37:10 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIbARJ028595; Thu, 27 Jan 2011 18:37:10 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271837.p0RIbARJ028595@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:37:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217950 - stable/8/sys/dev/ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:37:11 -0000 Author: yongari Date: Thu Jan 27 18:37:10 2011 New Revision: 217950 URL: http://svn.freebsd.org/changeset/base/217950 Log: MFC r216438: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/8/sys/dev/ale/if_ale.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/ale/if_ale.c ============================================================================== --- stable/8/sys/dev/ale/if_ale.c Thu Jan 27 18:34:05 2011 (r217949) +++ stable/8/sys/dev/ale/if_ale.c Thu Jan 27 18:37:10 2011 (r217950) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2284,8 +2283,7 @@ ale_int_task(void *arg, int pending) sc = (struct ale_softc *)arg; status = CSR_READ_4(sc, ALE_INTR_STATUS); - more = atomic_readandclear_int(&sc->ale_morework); - if (more != 0) + if (sc->ale_morework != 0) status |= INTR_RX_PKT; if ((status & ALE_INTRS) == 0) goto done; @@ -2298,7 +2296,7 @@ ale_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { more = ale_rxeof(sc, sc->ale_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->ale_morework, 1); + sc->ale_morework = 1; else if (more == EIO) { ALE_LOCK(sc); sc->ale_stats.reset_brk_seq++; @@ -3002,7 +3000,7 @@ ale_init_rx_pages(struct ale_softc *sc) ALE_LOCK_ASSERT(sc); - atomic_set_int(&sc->ale_morework, 0); + sc->ale_morework = 0; sc->ale_cdata.ale_rx_seqno = 0; sc->ale_cdata.ale_rx_curp = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:38:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C7B7106566B; Thu, 27 Jan 2011 18:38:48 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5B4B28FC1B; Thu, 27 Jan 2011 18:38:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIcmJH028727; Thu, 27 Jan 2011 18:38:48 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIcm9l028725; Thu, 27 Jan 2011 18:38:48 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271838.p0RIcm9l028725@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:38:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217951 - stable/7/sys/dev/ale X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:38:48 -0000 Author: yongari Date: Thu Jan 27 18:38:48 2011 New Revision: 217951 URL: http://svn.freebsd.org/changeset/base/217951 Log: MFC r216438: Remove unecessary and clearly wrong usage of atomic(9). Modified: stable/7/sys/dev/ale/if_ale.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/ale/if_ale.c ============================================================================== --- stable/7/sys/dev/ale/if_ale.c Thu Jan 27 18:37:10 2011 (r217950) +++ stable/7/sys/dev/ale/if_ale.c Thu Jan 27 18:38:48 2011 (r217951) @@ -66,7 +66,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -2284,8 +2283,7 @@ ale_int_task(void *arg, int pending) sc = (struct ale_softc *)arg; status = CSR_READ_4(sc, ALE_INTR_STATUS); - more = atomic_readandclear_int(&sc->ale_morework); - if (more != 0) + if (sc->ale_morework != 0) status |= INTR_RX_PKT; if ((status & ALE_INTRS) == 0) goto done; @@ -2298,7 +2296,7 @@ ale_int_task(void *arg, int pending) if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) { more = ale_rxeof(sc, sc->ale_process_limit); if (more == EAGAIN) - atomic_set_int(&sc->ale_morework, 1); + sc->ale_morework = 1; else if (more == EIO) { ALE_LOCK(sc); sc->ale_stats.reset_brk_seq++; @@ -3002,7 +3000,7 @@ ale_init_rx_pages(struct ale_softc *sc) ALE_LOCK_ASSERT(sc); - atomic_set_int(&sc->ale_morework, 0); + sc->ale_morework = 0; sc->ale_cdata.ale_rx_seqno = 0; sc->ale_cdata.ale_rx_curp = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:44:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6484F106564A; Thu, 27 Jan 2011 18:44:05 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 530E68FC1D; Thu, 27 Jan 2011 18:44:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIi5dr029082; Thu, 27 Jan 2011 18:44:05 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIi5KK029079; Thu, 27 Jan 2011 18:44:05 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271844.p0RIi5KK029079@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217952 - stable/8/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:44:05 -0000 Author: yongari Date: Thu Jan 27 18:44:05 2011 New Revision: 217952 URL: http://svn.freebsd.org/changeset/base/217952 Log: MFC r216546,216548-216550: r216546: Consistently put a tab character between #define and the macro name. r216548: Fix a regression introduced in r213893. FPGA version requires PHY probing so allow PHY probing on all possible addresses. r216549: Make sure whether driver allocated resource before releasing it. r216550: Use system defined PCIR_EXPRESS_DEVICE_CTL instead of using magic number. Modified: stable/8/sys/dev/jme/if_jme.c stable/8/sys/dev/jme/if_jmevar.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Thu Jan 27 18:38:48 2011 (r217951) +++ stable/8/sys/dev/jme/if_jme.c Thu Jan 27 18:44:05 2011 (r217952) @@ -683,7 +683,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + 0x08, 2); + burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); @@ -738,8 +738,9 @@ jme_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, - jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, - MIIF_DOPAUSE); + jme_mediastatus, BMSR_DEFCAPMASK, + sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, + MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -861,10 +862,12 @@ jme_detach(device_t dev) } } - bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); + if (sc->jme_irq[0] != NULL) + bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); if ((sc->jme_flags & (JME_FLAG_MSIX | JME_FLAG_MSI)) != 0) pci_release_msi(dev); - bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); + if (sc->jme_res[0] != NULL) + bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); mtx_destroy(&sc->jme_mtx); return (0); Modified: stable/8/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/8/sys/dev/jme/if_jmevar.h Thu Jan 27 18:38:48 2011 (r217951) +++ stable/8/sys/dev/jme/if_jmevar.h Thu Jan 27 18:44:05 2011 (r217952) @@ -66,8 +66,8 @@ * JMC250 can send 9K jumbo frame on Tx path and can receive * 65535 bytes. */ -#define JME_JUMBO_FRAMELEN 9216 -#define JME_JUMBO_MTU \ +#define JME_JUMBO_FRAMELEN 9216 +#define JME_JUMBO_MTU \ (JME_JUMBO_FRAMELEN - sizeof(struct ether_vlan_header) - \ ETHER_HDR_LEN - ETHER_CRC_LEN) #define JME_MAX_MTU \ @@ -143,14 +143,14 @@ struct jme_ring_data { bus_addr_t jme_ssb_block_paddr; }; -#define JME_TX_RING_ADDR(sc, i) \ +#define JME_TX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_tx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_RX_RING_ADDR(sc, i) \ +#define JME_RX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_rx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_TX_RING_SIZE \ +#define JME_TX_RING_SIZE \ (sizeof(struct jme_desc) * JME_TX_RING_CNT) -#define JME_RX_RING_SIZE \ +#define JME_RX_RING_SIZE \ (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) @@ -223,14 +223,14 @@ struct jme_softc { }; /* Register access macros. */ -#define CSR_WRITE_4(_sc, reg, val) \ +#define CSR_WRITE_4(_sc, reg, val) \ bus_write_4((_sc)->jme_res[0], (reg), (val)) -#define CSR_READ_4(_sc, reg) \ +#define CSR_READ_4(_sc, reg) \ bus_read_4((_sc)->jme_res[0], (reg)) -#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) -#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) -#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) +#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) +#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) +#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) #define JME_MAXERR 5 @@ -242,8 +242,8 @@ do { \ } while (0) #define JME_TX_TIMEOUT 5 -#define JME_TIMEOUT 1000 -#define JME_PHY_TIMEOUT 1000 -#define JME_EEPROM_TIMEOUT 1000 +#define JME_TIMEOUT 1000 +#define JME_PHY_TIMEOUT 1000 +#define JME_EEPROM_TIMEOUT 1000 #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 18:46:26 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76317106566B; Thu, 27 Jan 2011 18:46:26 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 648888FC19; Thu, 27 Jan 2011 18:46:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RIkQd3029278; Thu, 27 Jan 2011 18:46:26 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RIkQf9029275; Thu, 27 Jan 2011 18:46:26 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271846.p0RIkQf9029275@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 18:46:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217953 - stable/7/sys/dev/jme X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 18:46:26 -0000 Author: yongari Date: Thu Jan 27 18:46:26 2011 New Revision: 217953 URL: http://svn.freebsd.org/changeset/base/217953 Log: MFC r216546,216548-216550: r216546: Consistently put a tab character between #define and the macro name. r216548: Fix a regression introduced in r213893. FPGA version requires PHY probing so allow PHY probing on all possible addresses. r216549: Make sure whether driver allocated resource before releasing it. r216550: Use system defined PCIR_EXPRESS_DEVICE_CTL instead of using magic number. Modified: stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmevar.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:44:05 2011 (r217952) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 18:46:26 2011 (r217953) @@ -683,7 +683,7 @@ jme_attach(device_t dev) /* Set max allowable DMA size. */ if (pci_find_extcap(dev, PCIY_EXPRESS, &i) == 0) { sc->jme_flags |= JME_FLAG_PCIE; - burst = pci_read_config(dev, i + 0x08, 2); + burst = pci_read_config(dev, i + PCIR_EXPRESS_DEVICE_CTL, 2); if (bootverbose) { device_printf(dev, "Read request size : %d bytes.\n", 128 << ((burst >> 12) & 0x07)); @@ -738,8 +738,9 @@ jme_attach(device_t dev) /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, - jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_phyaddr, MII_OFFSET_ANY, - MIIF_DOPAUSE); + jme_mediastatus, BMSR_DEFCAPMASK, + sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, + MII_OFFSET_ANY, MIIF_DOPAUSE); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -861,10 +862,12 @@ jme_detach(device_t dev) } } - bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); + if (sc->jme_irq[0] != NULL) + bus_release_resources(dev, sc->jme_irq_spec, sc->jme_irq); if ((sc->jme_flags & (JME_FLAG_MSIX | JME_FLAG_MSI)) != 0) pci_release_msi(dev); - bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); + if (sc->jme_res[0] != NULL) + bus_release_resources(dev, sc->jme_res_spec, sc->jme_res); mtx_destroy(&sc->jme_mtx); return (0); Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 18:44:05 2011 (r217952) +++ stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 18:46:26 2011 (r217953) @@ -66,8 +66,8 @@ * JMC250 can send 9K jumbo frame on Tx path and can receive * 65535 bytes. */ -#define JME_JUMBO_FRAMELEN 9216 -#define JME_JUMBO_MTU \ +#define JME_JUMBO_FRAMELEN 9216 +#define JME_JUMBO_MTU \ (JME_JUMBO_FRAMELEN - sizeof(struct ether_vlan_header) - \ ETHER_HDR_LEN - ETHER_CRC_LEN) #define JME_MAX_MTU \ @@ -143,14 +143,14 @@ struct jme_ring_data { bus_addr_t jme_ssb_block_paddr; }; -#define JME_TX_RING_ADDR(sc, i) \ +#define JME_TX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_tx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_RX_RING_ADDR(sc, i) \ +#define JME_RX_RING_ADDR(sc, i) \ ((sc)->jme_rdata.jme_rx_ring_paddr + sizeof(struct jme_desc) * (i)) -#define JME_TX_RING_SIZE \ +#define JME_TX_RING_SIZE \ (sizeof(struct jme_desc) * JME_TX_RING_CNT) -#define JME_RX_RING_SIZE \ +#define JME_RX_RING_SIZE \ (sizeof(struct jme_desc) * JME_RX_RING_CNT) #define JME_SSB_SIZE sizeof(struct jme_ssb) @@ -223,14 +223,14 @@ struct jme_softc { }; /* Register access macros. */ -#define CSR_WRITE_4(_sc, reg, val) \ +#define CSR_WRITE_4(_sc, reg, val) \ bus_write_4((_sc)->jme_res[0], (reg), (val)) -#define CSR_READ_4(_sc, reg) \ +#define CSR_READ_4(_sc, reg) \ bus_read_4((_sc)->jme_res[0], (reg)) -#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) -#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) -#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) +#define JME_LOCK(_sc) mtx_lock(&(_sc)->jme_mtx) +#define JME_UNLOCK(_sc) mtx_unlock(&(_sc)->jme_mtx) +#define JME_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->jme_mtx, MA_OWNED) #define JME_MAXERR 5 @@ -242,8 +242,8 @@ do { \ } while (0) #define JME_TX_TIMEOUT 5 -#define JME_TIMEOUT 1000 -#define JME_PHY_TIMEOUT 1000 -#define JME_EEPROM_TIMEOUT 1000 +#define JME_TIMEOUT 1000 +#define JME_PHY_TIMEOUT 1000 +#define JME_EEPROM_TIMEOUT 1000 #endif From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:02:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F28C1065670; Thu, 27 Jan 2011 19:02:28 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4C8568FC0C; Thu, 27 Jan 2011 19:02:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ2Sbw030104; Thu, 27 Jan 2011 19:02:28 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ2StF030098; Thu, 27 Jan 2011 19:02:28 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271902.p0RJ2StF030098@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:02:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217954 - in stable/8/sys/dev: jme mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:02:28 -0000 Author: yongari Date: Thu Jan 27 19:02:28 2011 New Revision: 217954 URL: http://svn.freebsd.org/changeset/base/217954 Log: MFC r216551: Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet controller with Card Read Host Controller. These controllers are multi-function devices and have the same ethernet core of JMC250/JMC260. Starting from REVFM 5(chip full mask revision) controllers have the following features. o eFuse support o PCD(Packet Completion Deferring) o More advanced PHY power saving Because these controllers started to use eFuse, station address modified by driver is permanent as if it was written to EEPROM. If you have to change station address please save your controller default address to safe place before reprogramming it. There is no way to restore factory default station address. Many thanks to JMicron for continuing to support FreeBSD. HW donated by: JMicron Modified: stable/8/sys/dev/jme/if_jme.c stable/8/sys/dev/jme/if_jmereg.h stable/8/sys/dev/jme/if_jmevar.h stable/8/sys/dev/mii/jmphy.c stable/8/sys/dev/mii/jmphyreg.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/jme/if_jme.c ============================================================================== --- stable/8/sys/dev/jme/if_jme.c Thu Jan 27 18:46:26 2011 (r217953) +++ stable/8/sys/dev/jme/if_jme.c Thu Jan 27 19:02:28 2011 (r217954) @@ -97,9 +97,9 @@ static struct jme_dev { const char *jme_name; } jme_devs[] = { { VENDORID_JMICRON, DEVICEID_JMC250, - "JMicron Inc, JMC250 Gigabit Ethernet" }, + "JMicron Inc, JMC25x Gigabit Ethernet" }, { VENDORID_JMICRON, DEVICEID_JMC260, - "JMicron Inc, JMC260 Fast Ethernet" }, + "JMicron Inc, JMC26x Fast Ethernet" }, }; static int jme_miibus_readreg(device_t, int, int); @@ -110,7 +110,9 @@ static int jme_mediachange(struct ifnet static int jme_probe(device_t); static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *); static int jme_eeprom_macaddr(struct jme_softc *); +static int jme_efuse_macaddr(struct jme_softc *); static void jme_reg_macaddr(struct jme_softc *); +static void jme_set_macaddr(struct jme_softc *, uint8_t *); static void jme_map_intr_vector(struct jme_softc *); static int jme_attach(device_t); static int jme_detach(device_t); @@ -152,6 +154,8 @@ static void jme_set_filter(struct jme_so static void jme_stats_clear(struct jme_softc *); static void jme_stats_save(struct jme_softc *); static void jme_stats_update(struct jme_softc *); +static void jme_phy_down(struct jme_softc *); +static void jme_phy_up(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -432,6 +436,55 @@ jme_eeprom_macaddr(struct jme_softc *sc) return (ENOENT); } +static int +jme_efuse_macaddr(struct jme_softc *sc) +{ + uint32_t reg; + int i; + + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | EFUSE_CTL1_AUTOLAOD_DONE)) != + EFUSE_CTL1_AUTOLAOD_DONE) + return (ENOENT); + /* Reset eFuse controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg |= EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg &= ~EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + + /* Have eFuse reload station address to MAC controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + reg &= ~EFUSE_CTL1_CMD_MASK; + reg |= EFUSE_CTL1_CMD_AUTOLOAD | EFUSE_CTL1_EXECUTE; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL1, reg, 4); + + /* + * Verify completion of eFuse autload command. It should be + * completed within 108us. + */ + DELAY(110); + for (i = 10; i > 0; i--) { + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | + EFUSE_CTL1_AUTOLAOD_DONE)) != EFUSE_CTL1_AUTOLAOD_DONE) { + DELAY(20); + continue; + } + if ((reg & EFUSE_CTL1_EXECUTE) == 0) + break; + /* Station address loading is still in progress. */ + DELAY(20); + } + if (i == 0) { + device_printf(sc->jme_dev, "eFuse autoload timed out.\n"); + return (ETIMEDOUT); + } + + return (0); +} + static void jme_reg_macaddr(struct jme_softc *sc) { @@ -454,6 +507,13 @@ jme_reg_macaddr(struct jme_softc *sc) sc->jme_eaddr[4] = (par0 >> 8) & 0xff; sc->jme_eaddr[5] = par0 & 0xff; } else { + /* + * For controllers that use eFuse, the station address + * could also be extracted from JME_PCI_PAR0 and + * JME_PCI_PAR1 registers in PCI configuration space. + * Each register holds exactly half of station address(24bits) + * so use JME_PAR0, JME_PAR1 registers instead. + */ sc->jme_eaddr[0] = (par0 >> 0) & 0xFF; sc->jme_eaddr[1] = (par0 >> 8) & 0xFF; sc->jme_eaddr[2] = (par0 >> 16) & 0xFF; @@ -464,6 +524,42 @@ jme_reg_macaddr(struct jme_softc *sc) } static void +jme_set_macaddr(struct jme_softc *sc, uint8_t *eaddr) +{ + uint32_t val; + int i; + + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + /* + * Avoid reprogramming station address if the address + * is the same as previous one. Note, reprogrammed + * station address is permanent as if it was written + * to EEPROM. So if station address was changed by + * admistrator it's possible to lose factory configured + * address when driver fails to restore its address. + * (e.g. reboot or system crash) + */ + if (bcmp(eaddr, sc->jme_eaddr, ETHER_ADDR_LEN) != 0) { + for (i = 0; i < ETHER_ADDR_LEN; i++) { + val = JME_EFUSE_EEPROM_FUNC0 << + JME_EFUSE_EEPROM_FUNC_SHIFT; + val |= JME_EFUSE_EEPROM_PAGE_BAR1 << + JME_EFUSE_EEPROM_PAGE_SHIFT; + val |= (JME_PAR0 + i) << + JME_EFUSE_EEPROM_ADDR_SHIFT; + val |= eaddr[i] << JME_EFUSE_EEPROM_DATA_SHIFT; + pci_write_config(sc->jme_dev, JME_EFUSE_EEPROM, + val | JME_EFUSE_EEPROM_WRITE, 4); + } + } + } else { + CSR_WRITE_4(sc, JME_PAR0, + eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); + CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + } +} + +static void jme_map_intr_vector(struct jme_softc *sc) { uint32_t map[MSINUM_NUM_INTR_SOURCE / JME_MSI_MESSAGES]; @@ -542,7 +638,7 @@ jme_attach(device_t dev) struct mii_data *mii; uint32_t reg; uint16_t burst; - int error, i, msic, msixc, pmc; + int error, i, mii_flags, msic, msixc, pmc; error = 0; sc = device_get_softc(dev); @@ -644,11 +740,14 @@ jme_attach(device_t dev) goto fail; } + /* Identify controller features and bugs. */ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; - sc->jme_flags |= JME_FLAG_TXCLK; + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + sc->jme_flags |= JME_FLAG_EFUSE | JME_FLAG_PCCPCD; + sc->jme_flags |= JME_FLAG_TXCLK | JME_FLAG_RXCLK; sc->jme_flags |= JME_FLAG_HWMIB; } @@ -656,14 +755,20 @@ jme_attach(device_t dev) jme_reset(sc); /* Get station address. */ - reg = CSR_READ_4(sc, JME_SMBCSR); - if ((reg & SMBCSR_EEPROM_PRESENT) != 0) - error = jme_eeprom_macaddr(sc); - if (error != 0 || (reg & SMBCSR_EEPROM_PRESENT) == 0) { - if (error != 0 && (bootverbose)) + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + error = jme_efuse_macaddr(sc); + if (error == 0) + jme_reg_macaddr(sc); + } else { + error = ENOENT; + reg = CSR_READ_4(sc, JME_SMBCSR); + if ((reg & SMBCSR_EEPROM_PRESENT) != 0) + error = jme_eeprom_macaddr(sc); + if (error != 0 && bootverbose) device_printf(sc->jme_dev, "ethernet hardware address not found in EEPROM.\n"); - jme_reg_macaddr(sc); + if (error != 0) + jme_reg_macaddr(sc); } /* @@ -736,11 +841,17 @@ jme_attach(device_t dev) } ifp->if_capenable = ifp->if_capabilities; + /* Wakeup PHY. */ + jme_phy_up(sc); + mii_flags = MIIF_DOPAUSE; + /* Ask PHY calibration to PHY driver. */ + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + mii_flags |= MIIF_MACPRIV0; /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, - MII_OFFSET_ANY, MIIF_DOPAUSE); + MII_OFFSET_ANY, mii_flags); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -833,6 +944,9 @@ jme_detach(device_t dev) taskqueue_drain(sc->jme_tq, &sc->jme_int_task); taskqueue_drain(sc->jme_tq, &sc->jme_tx_task); taskqueue_drain(taskqueue_swi, &sc->jme_link_task); + /* Restore possibly modified station address. */ + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) + jme_set_macaddr(sc, sc->jme_eaddr); ether_ifdetach(ifp); } @@ -1493,9 +1607,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) | GPREG1_RX_MAC_CLK_DIS); /* No PME capability, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); return; } @@ -1527,8 +1643,7 @@ jme_setwol(struct jme_softc *sc) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); if ((ifp->if_capenable & IFCAP_WOL) == 0) { /* No WOL, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); } } @@ -1566,6 +1681,8 @@ jme_resume(device_t dev) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } + /* Wakeup PHY. */ + jme_phy_up(sc); ifp = sc->jme_ifp; if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -2218,6 +2335,13 @@ jme_link_task(void *arg, int pending) CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr | RXCSR_RX_ENB | RXCSR_RXQ_START); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr | TXCSR_TX_ENB); + /* Lastly enable TX/RX clock. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, + CSR_READ_4(sc, JME_GHC) & ~GHC_TX_MAC_CLK_DIS); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) & ~GPREG1_RX_MAC_CLK_DIS); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2596,13 +2720,45 @@ jme_tick(void *arg) static void jme_reset(struct jme_softc *sc) { + uint32_t ghc, gpreg; /* Stop receiver, transmitter. */ jme_stop_rx(sc); jme_stop_tx(sc); + + /* Reset controller. */ CSR_WRITE_4(sc, JME_GHC, GHC_RESET); + CSR_READ_4(sc, JME_GHC); + DELAY(10); + /* + * Workaround Rx FIFO overruns seen under certain conditions. + * Explicitly synchorize TX/RX clock. TX/RX clock should be + * enabled only after enabling TX/RX MACs. + */ + if ((sc->jme_flags & (JME_FLAG_TXCLK | JME_FLAG_RXCLK)) != 0) { + /* Disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_RESET | GHC_TX_MAC_CLK_DIS); + /* Disable RX clock. */ + gpreg = CSR_READ_4(sc, JME_GPREG1); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + gpreg = CSR_READ_4(sc, JME_GPREG1); + /* De-assert RESET but still disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + ghc = CSR_READ_4(sc, JME_GHC); + + /* Enable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, ghc & ~GHC_TX_MAC_CLK_DIS); + /* Enable RX clock. */ + CSR_WRITE_4(sc, JME_GPREG1, gpreg & ~GPREG1_RX_MAC_CLK_DIS); + CSR_READ_4(sc, JME_GPREG1); + + /* Disable TX/RX clock again. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + } else + CSR_WRITE_4(sc, JME_GHC, 0); + CSR_READ_4(sc, JME_GHC); DELAY(10); - CSR_WRITE_4(sc, JME_GHC, 0); } static void @@ -2621,7 +2777,6 @@ jme_init_locked(struct jme_softc *sc) { struct ifnet *ifp; struct mii_data *mii; - uint8_t eaddr[ETHER_ADDR_LEN]; bus_addr_t paddr; uint32_t reg; int error; @@ -2657,10 +2812,7 @@ jme_init_locked(struct jme_softc *sc) jme_init_ssb(sc); /* Reprogram the station address. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); - CSR_WRITE_4(sc, JME_PAR0, - eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); - CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + jme_set_macaddr(sc, IF_LLADDR(sc->jme_ifp)); /* * Configure Tx queue. @@ -2798,6 +2950,30 @@ jme_init_locked(struct jme_softc *sc) PCCRX_COAL_PKT_MASK; CSR_WRITE_4(sc, JME_PCCRX0, reg); + /* + * Configure PCD(Packet Completion Deferring). It seems PCD + * generates an interrupt when the time interval between two + * back-to-back incoming/outgoing packet is long enough for + * it to reach its timer value 0. The arrival of new packets + * after timer has started causes the PCD timer to restart. + * Unfortunately, it's not clear how PCD is useful at this + * moment, so just use the same of PCC parameters. + */ + if ((sc->jme_flags & JME_FLAG_PCCPCD) != 0) { + sc->jme_rx_pcd_to = sc->jme_rx_coal_to; + if (sc->jme_rx_coal_to > PCDRX_TO_MAX) + sc->jme_rx_pcd_to = PCDRX_TO_MAX; + sc->jme_tx_pcd_to = sc->jme_tx_coal_to; + if (sc->jme_tx_coal_to > PCDTX_TO_MAX) + sc->jme_tx_pcd_to = PCDTX_TO_MAX; + reg = sc->jme_rx_pcd_to << PCDRX0_TO_THROTTLE_SHIFT; + reg |= sc->jme_rx_pcd_to << PCDRX0_TO_SHIFT; + CSR_WRITE_4(sc, PCDRX_REG(0), reg); + reg = sc->jme_tx_pcd_to << PCDTX_TO_THROTTLE_SHIFT; + reg |= sc->jme_tx_pcd_to << PCDTX_TO_SHIFT; + CSR_WRITE_4(sc, JME_PCDTX, reg); + } + /* Configure shadow status block but don't enable posting. */ paddr = sc->jme_rdata.jme_ssb_block_paddr; CSR_WRITE_4(sc, JME_SHBASE_ADDR_HI, JME_ADDR_HI(paddr)); @@ -3203,6 +3379,43 @@ jme_stats_update(struct jme_softc *sc) stat->tx_bad_frames += ostat->tx_bad_frames; } +static void +jme_phy_down(struct jme_softc *sc) +{ + uint32_t reg; + + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg |= 0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_D3; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + +static void +jme_phy_up(struct jme_softc *sc) +{ + uint32_t reg; + uint16_t bmcr; + + bmcr = jme_miibus_readreg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR); + bmcr &= ~BMCR_PDOWN; + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, bmcr); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg &= ~0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_DIS; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/8/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/8/sys/dev/jme/if_jmereg.h Thu Jan 27 18:46:26 2011 (r217953) +++ stable/8/sys/dev/jme/if_jmereg.h Thu Jan 27 19:02:28 2011 (r217954) @@ -63,6 +63,10 @@ #define JME_PCI_DBG 0x9C +#define JME_PCI_PAR0 0xA4 /* JMC25x/JMC26x REVFM >= 5 */ + +#define JME_PCI_PAR1 0xA8 /* JMC25x/JMC26x REVFM >= 5 */ + #define JME_PCI_SPI 0xB0 #define SPI_ENB 0x00000010 @@ -71,6 +75,21 @@ #define SPI_SCK_CTRL 0x00000002 #define SPI_CS_N_CTRL 0x00000001 +#define JME_EFUSE_CTL1 0xB8 +#define EFUSE_CTL1_DATA_MASK 0xF0000000 +#define EFUSE_CTL1_EXECUTE 0x08000000 +#define EFUSE_CTL1_CMD_AUTOLOAD 0x02000000 +#define EFUSE_CTL1_CMD_READ 0x04000000 +#define EFUSE_CTL1_CMD_BLOW 0x06000000 +#define EFUSE_CTL1_CMD_MASK 0x06000000 +#define EFUSE_CTL1_AUTOLOAD_ERR 0x00010000 +#define EFUSE_CTL1_BYTE_SEL_MASK 0x0000FF00 +#define EFUSE_CTL1_BIT_SEL_MASK 0x00000070 +#define EFUSE_CTL1_AUTOLAOD_DONE 0x00000001 + +#define JME_EFUSE_CTL2 0xBC +#define EFUSE_CTL2_RESET 0x00008000 + #define JME_PCI_PHYCFG0 0xC0 #define JME_PCI_PHYCFG1 0xC4 @@ -86,7 +105,7 @@ /* PCIe link error/status. */ #define JME_PCI_LES 0xD8 -/* propeietary register 0. */ +/* Proprietary register 0. */ #define JME_PCI_PE0 0xE0 #define PE0_SPI_EXIST 0x00200000 #define PE0_PME_D0 0x00100000 @@ -115,7 +134,31 @@ #define PE0_PM_AUXC_MASK 0x00000007 #define PE0_PM_AUXC_DEF 0x00000007 +/* Proprietary register 1. */ #define JME_PCI_PE1 0xE4 +#define PE1_GIGA_PDOWN_MASK 0x0000C000 +#define PE1_GIGA_PDOWN_DIS 0x00000000 +#define PE1_GIGA_PDOWN_D3 0x00004000 +#define PE1_GIGA_PDOWN_PCIE_SHUTDOWN 0x00008000 +#define PE1_GIGA_PDOWN_PCIE_IDDQ 0x0000C000 + +#define JME_EFUSE_EEPROM 0xE8 +#define JME_EFUSE_EEPROM_WRITE 0x80000000 +#define JME_EFUSE_EEPROM_FUNC_MASK 0x70000000 +#define JME_EFUSE_EEPROM_PAGE_MASK 0x0F000000 +#define JME_EFUSE_EEPROM_ADDR_MASK 0x00FF0000 +#define JME_EFUSE_EEPROM_DATA_MASK 0x0000FF00 +#define JME_EFUSE_EEPROM_SMBSTAT_MASK 0x000000FF +#define JME_EFUSE_EEPROM_FUNC_SHIFT 28 +#define JME_EFUSE_EEPROM_PAGE_SHIFT 24 +#define JME_EFUSE_EEPROM_ADDR_SHIFT 16 +#define JME_EFUSE_EEPROM_DATA_SHIFT 8 +#define JME_EFUSE_EEPROM_SMBSTAT_SHIFT 0 + +#define JME_EFUSE_EEPROM_FUNC0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR1 1 +#define JME_EFUSE_EEPROM_PAGE_BAR2 2 #define JME_PCI_PHYTEST 0xF8 @@ -312,7 +355,7 @@ #define RXMAC_PAD_10BYTES 0x00000002 #define RXMAC_CSUM_ENB 0x00000001 -/* Rx unicast MAC address. */ +/* Rx unicast MAC address. Read-only on JMC25x/JMC26x REVFM >= 5 */ #define JME_PAR0 0x0038 #define JME_PAR1 0x003C @@ -455,6 +498,7 @@ #define JME_GIGARCHI 0x041C #define JME_GIGARDLO 0x0420 #define JME_GIGARDHI 0x0424 +#define JME_PHYPOWDN 0x0424 /* JMC250/JMC260 REVFM >= 5 */ /* BIST status and control. */ #define JME_GIGACSR 0x0428 @@ -627,6 +671,7 @@ /* General purpose register 1. */ #define JME_GPREG1 0x080C +#define GPREG1_RX_MAC_CLK_DIS 0x04000000 /* JMC250/JMC260 REVFM >= 2 */ #define GPREG1_RSS_IPV6_10_100 0x00000040 /* JMC250 A2 */ #define GPREG1_HDPX_FIX 0x00000020 /* JMC250 A2 */ #define GPREG1_INTDLY_UNIT_16US 0x00000018 /* JMC250 A1, A2 */ @@ -816,6 +861,53 @@ #define SHBASE_POST_FORCE 0x00000002 #define SHBASE_POST_ENB 0x00000001 +#define JME_PCDRX_BASE 0x0850 +#define JME_PCDRX_END 0x0857 +#define PCDRX_REG(x) (JME_PCDRX_BASE + (((x) / 2) * 4)) +#define PCDRX1_TO_THROTTLE_MASK 0xFF000000 +#define PCDRX1_TO_MASK 0x00FF0000 +#define PCDRX0_TO_THROTTLE_MASK 0x0000FF00 +#define PCDRX0_TO_MASK 0x000000FF +#define PCDRX1_TO_THROTTLE_SHIFT 24 +#define PCDRX1_TO_SHIFT 16 +#define PCDRX0_TO_THROTTLE_SHIFT 8 +#define PCDRX0_TO_SHIFT 0 +#define PCDRX_TO_MIN 1 +#define PCDRX_TO_MAX 255 + +#define JME_PCDTX 0x0858 +#define PCDTX_TO_THROTTLE_MASK 0x0000FF00 +#define PCDTX_TO_MASK 0x000000FF +#define PCDTX_TO_THROTTLE_SHIFT 8 +#define PCDTX_TO_SHIFT 0 +#define PCDTX_TO_MIN 1 +#define PCDTX_TO_MAX 255 + +#define JME_PCCPCD_STAT 0x085C +#define PCCPCD_STAT_RX3_MASK 0xFF000000 +#define PCCPCD_STAT_RX2_MASK 0x00FF0000 +#define PCCPCD_STAT_RX1_MASK 0x0000FF00 +#define PCCPCD_STAT_RX0_MASK 0x000000FF +#define PCCPCD_STAT_RX3_SHIFT 24 +#define PCCPCD_STAT_RX2_SHIFT 16 +#define PCCPCD_STAT_RX1_SHIFT 8 +#define PCCPCD_STAT_RX0_SHIFT 0 + +/* TX data throughput in KB. */ +#define JME_TX_THROUGHPUT 0x0860 +#define TX_THROUGHPUT_MASK 0x000FFFFF + +/* RX data throughput in KB. */ +#define JME_RX_THROUGHPUT 0x0864 +#define RX_THROUGHPUT_MASK 0x000FFFFF + +#define JME_LPI_CTL 0x086C +#define LPI_STAT_ANC_ANF 0x00000010 +#define LPI_STAT_AN_TIMEOUT 0x00000008 +#define LPI_STAT_RX_LPI 0x00000004 +#define LPI_INT_ENB 0x00000002 +#define LPI_REQ 0x00000001 + /* Timer 1 and 2. */ #define JME_TIMER1 0x0870 #define JME_TIMER2 0x0874 @@ -824,6 +916,15 @@ #define TIMER_CNT_SHIFT 0 #define TIMER_UNIT 1024 /* 1024us */ +/* Timer 3. */ +#define JME_TIMER3 0x0878 +#define TIMER3_TIMEOUT 0x00010000 +#define TIMER3_TIMEOUT_COUNT_MASK 0x0000FF00 /* 130ms unit */ +#define TIMER3_TIMEOUT_VAL_MASK 0x000000E0 +#define TIMER3_ENB 0x00000001 +#define TIMER3_TIMEOUT_COUNT_SHIFT 8 +#define TIMER3_TIMEOUT_VALUE_SHIFT 1 + /* Aggresive power mode control. */ #define JME_APMC 0x087C #define APMC_PCIE_SDOWN_STAT 0x80000000 Modified: stable/8/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/8/sys/dev/jme/if_jmevar.h Thu Jan 27 18:46:26 2011 (r217953) +++ stable/8/sys/dev/jme/if_jmevar.h Thu Jan 27 19:02:28 2011 (r217954) @@ -185,19 +185,22 @@ struct jme_softc { uint32_t jme_tx_dma_size; uint32_t jme_rx_dma_size; int jme_flags; -#define JME_FLAG_FPGA 0x0001 -#define JME_FLAG_PCIE 0x0002 -#define JME_FLAG_PCIX 0x0003 -#define JME_FLAG_MSI 0x0004 -#define JME_FLAG_MSIX 0x0010 -#define JME_FLAG_PMCAP 0x0020 -#define JME_FLAG_FASTETH 0x0040 -#define JME_FLAG_NOJUMBO 0x0080 -#define JME_FLAG_TXCLK 0x0100 -#define JME_FLAG_DMA32BIT 0x0200 -#define JME_FLAG_HWMIB 0x0400 -#define JME_FLAG_DETACH 0x4000 -#define JME_FLAG_LINK 0x8000 +#define JME_FLAG_FPGA 0x00000001 +#define JME_FLAG_PCIE 0x00000002 +#define JME_FLAG_PCIX 0x00000004 +#define JME_FLAG_MSI 0x00000008 +#define JME_FLAG_MSIX 0x00000010 +#define JME_FLAG_PMCAP 0x00000020 +#define JME_FLAG_FASTETH 0x00000040 +#define JME_FLAG_NOJUMBO 0x00000080 +#define JME_FLAG_RXCLK 0x00000100 +#define JME_FLAG_TXCLK 0x00000200 +#define JME_FLAG_DMA32BIT 0x00000400 +#define JME_FLAG_HWMIB 0x00000800 +#define JME_FLAG_EFUSE 0x00001000 +#define JME_FLAG_PCCPCD 0x00002000 +#define JME_FLAG_DETACH 0x40000000 +#define JME_FLAG_LINK 0x80000000 struct jme_hw_stats jme_ostats; struct jme_hw_stats jme_stats; @@ -210,8 +213,10 @@ struct jme_softc { uint32_t jme_rxcsr; int jme_process_limit; int jme_tx_coal_to; + int jme_tx_pcd_to; int jme_tx_coal_pkt; int jme_rx_coal_to; + int jme_rx_pcd_to; int jme_rx_coal_pkt; volatile int jme_morework; Modified: stable/8/sys/dev/mii/jmphy.c ============================================================================== --- stable/8/sys/dev/mii/jmphy.c Thu Jan 27 18:46:26 2011 (r217953) +++ stable/8/sys/dev/mii/jmphy.c Thu Jan 27 19:02:28 2011 (r217954) @@ -104,6 +104,7 @@ jmphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; jsc = device_get_softc(dev); sc = &jsc->mii_sc; @@ -118,6 +119,10 @@ jmphy_attach(device_t dev) sc->mii_service = jmphy_service; sc->mii_pdata = mii; + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "jme") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -265,6 +270,7 @@ static void jmphy_reset(struct mii_softc *sc) { struct jmphy_softc *jsc; + uint16_t t2cr, val; int i; jsc = (struct jmphy_softc *)sc; @@ -279,6 +285,39 @@ jmphy_reset(struct mii_softc *sc) if ((PHY_READ(sc, MII_BMCR) & BMCR_RESET) == 0) break; } + /* Perform vendor recommended PHY calibration. */ + if ((sc->mii_flags & MIIF_PHYPRIV0) != 0) { + /* Select PHY test mode 1. */ + t2cr = PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + t2cr |= 0x2000; + PHY_WRITE(sc, MII_100T2CR, t2cr); + /* Apply calibration patch. */ + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~0x0002; + val |= 0x0010 | 0x0001; + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + + /* XXX 20ms to complete recalibration. */ + DELAY(20 * 1000); + + PHY_READ(sc, MII_100T2CR); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~(0x0001 | 0x0002 | 0x0010); + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + /* Disable PHY test mode. */ + PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + PHY_WRITE(sc, MII_100T2CR, t2cr); + } } static uint16_t Modified: stable/8/sys/dev/mii/jmphyreg.h ============================================================================== --- stable/8/sys/dev/mii/jmphyreg.h Thu Jan 27 18:46:26 2011 (r217953) +++ stable/8/sys/dev/mii/jmphyreg.h Thu Jan 27 19:02:28 2011 (r217954) @@ -105,4 +105,13 @@ #define JMPHY_TMCTL 0x1A #define JMPHY_TMCTL_SLEEP_ENB 0x1000 +/* PHY specific configuration register. */ +#define JMPHY_SPEC_ADDR 0x1E +#define JMPHY_SPEC_ADDR_READ 0x4000 +#define JMPHY_SPEC_ADDR_WRITE 0x8000 + +#define JMPHY_SPEC_DATA 0x1F + +#define JMPHY_EXT_COMM_2 0x32 + #endif /* _DEV_MII_JMPHYREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:04:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37173106566B; Thu, 27 Jan 2011 19:04:18 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 247948FC22; Thu, 27 Jan 2011 19:04:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ4Ioe030199; Thu, 27 Jan 2011 19:04:18 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ4IlZ030193; Thu, 27 Jan 2011 19:04:18 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271904.p0RJ4IlZ030193@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:04:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217955 - in stable/7/sys/dev: jme mii X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:04:18 -0000 Author: yongari Date: Thu Jan 27 19:04:17 2011 New Revision: 217955 URL: http://svn.freebsd.org/changeset/base/217955 Log: MFC r216551: Add support for JMicron JMC251/JMC261 Gigabit/Fast ethernet controller with Card Read Host Controller. These controllers are multi-function devices and have the same ethernet core of JMC250/JMC260. Starting from REVFM 5(chip full mask revision) controllers have the following features. o eFuse support o PCD(Packet Completion Deferring) o More advanced PHY power saving Because these controllers started to use eFuse, station address modified by driver is permanent as if it was written to EEPROM. If you have to change station address please save your controller default address to safe place before reprogramming it. There is no way to restore factory default station address. Many thanks to JMicron for continuing to support FreeBSD. HW donated by: JMicron Modified: stable/7/sys/dev/jme/if_jme.c stable/7/sys/dev/jme/if_jmereg.h stable/7/sys/dev/jme/if_jmevar.h stable/7/sys/dev/mii/jmphy.c stable/7/sys/dev/mii/jmphyreg.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/jme/if_jme.c ============================================================================== --- stable/7/sys/dev/jme/if_jme.c Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jme.c Thu Jan 27 19:04:17 2011 (r217955) @@ -97,9 +97,9 @@ static struct jme_dev { const char *jme_name; } jme_devs[] = { { VENDORID_JMICRON, DEVICEID_JMC250, - "JMicron Inc, JMC250 Gigabit Ethernet" }, + "JMicron Inc, JMC25x Gigabit Ethernet" }, { VENDORID_JMICRON, DEVICEID_JMC260, - "JMicron Inc, JMC260 Fast Ethernet" }, + "JMicron Inc, JMC26x Fast Ethernet" }, }; static int jme_miibus_readreg(device_t, int, int); @@ -110,7 +110,9 @@ static int jme_mediachange(struct ifnet static int jme_probe(device_t); static int jme_eeprom_read_byte(struct jme_softc *, uint8_t, uint8_t *); static int jme_eeprom_macaddr(struct jme_softc *); +static int jme_efuse_macaddr(struct jme_softc *); static void jme_reg_macaddr(struct jme_softc *); +static void jme_set_macaddr(struct jme_softc *, uint8_t *); static void jme_map_intr_vector(struct jme_softc *); static int jme_attach(device_t); static int jme_detach(device_t); @@ -152,6 +154,8 @@ static void jme_set_filter(struct jme_so static void jme_stats_clear(struct jme_softc *); static void jme_stats_save(struct jme_softc *); static void jme_stats_update(struct jme_softc *); +static void jme_phy_down(struct jme_softc *); +static void jme_phy_up(struct jme_softc *); static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int, int); static int sysctl_hw_jme_tx_coal_to(SYSCTL_HANDLER_ARGS); static int sysctl_hw_jme_tx_coal_pkt(SYSCTL_HANDLER_ARGS); @@ -432,6 +436,55 @@ jme_eeprom_macaddr(struct jme_softc *sc) return (ENOENT); } +static int +jme_efuse_macaddr(struct jme_softc *sc) +{ + uint32_t reg; + int i; + + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | EFUSE_CTL1_AUTOLAOD_DONE)) != + EFUSE_CTL1_AUTOLAOD_DONE) + return (ENOENT); + /* Reset eFuse controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg |= EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL2, 4); + reg &= ~EFUSE_CTL2_RESET; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL2, reg, 4); + + /* Have eFuse reload station address to MAC controller. */ + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + reg &= ~EFUSE_CTL1_CMD_MASK; + reg |= EFUSE_CTL1_CMD_AUTOLOAD | EFUSE_CTL1_EXECUTE; + pci_write_config(sc->jme_dev, JME_EFUSE_CTL1, reg, 4); + + /* + * Verify completion of eFuse autload command. It should be + * completed within 108us. + */ + DELAY(110); + for (i = 10; i > 0; i--) { + reg = pci_read_config(sc->jme_dev, JME_EFUSE_CTL1, 4); + if ((reg & (EFUSE_CTL1_AUTOLOAD_ERR | + EFUSE_CTL1_AUTOLAOD_DONE)) != EFUSE_CTL1_AUTOLAOD_DONE) { + DELAY(20); + continue; + } + if ((reg & EFUSE_CTL1_EXECUTE) == 0) + break; + /* Station address loading is still in progress. */ + DELAY(20); + } + if (i == 0) { + device_printf(sc->jme_dev, "eFuse autoload timed out.\n"); + return (ETIMEDOUT); + } + + return (0); +} + static void jme_reg_macaddr(struct jme_softc *sc) { @@ -454,6 +507,13 @@ jme_reg_macaddr(struct jme_softc *sc) sc->jme_eaddr[4] = (par0 >> 8) & 0xff; sc->jme_eaddr[5] = par0 & 0xff; } else { + /* + * For controllers that use eFuse, the station address + * could also be extracted from JME_PCI_PAR0 and + * JME_PCI_PAR1 registers in PCI configuration space. + * Each register holds exactly half of station address(24bits) + * so use JME_PAR0, JME_PAR1 registers instead. + */ sc->jme_eaddr[0] = (par0 >> 0) & 0xFF; sc->jme_eaddr[1] = (par0 >> 8) & 0xFF; sc->jme_eaddr[2] = (par0 >> 16) & 0xFF; @@ -464,6 +524,42 @@ jme_reg_macaddr(struct jme_softc *sc) } static void +jme_set_macaddr(struct jme_softc *sc, uint8_t *eaddr) +{ + uint32_t val; + int i; + + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + /* + * Avoid reprogramming station address if the address + * is the same as previous one. Note, reprogrammed + * station address is permanent as if it was written + * to EEPROM. So if station address was changed by + * admistrator it's possible to lose factory configured + * address when driver fails to restore its address. + * (e.g. reboot or system crash) + */ + if (bcmp(eaddr, sc->jme_eaddr, ETHER_ADDR_LEN) != 0) { + for (i = 0; i < ETHER_ADDR_LEN; i++) { + val = JME_EFUSE_EEPROM_FUNC0 << + JME_EFUSE_EEPROM_FUNC_SHIFT; + val |= JME_EFUSE_EEPROM_PAGE_BAR1 << + JME_EFUSE_EEPROM_PAGE_SHIFT; + val |= (JME_PAR0 + i) << + JME_EFUSE_EEPROM_ADDR_SHIFT; + val |= eaddr[i] << JME_EFUSE_EEPROM_DATA_SHIFT; + pci_write_config(sc->jme_dev, JME_EFUSE_EEPROM, + val | JME_EFUSE_EEPROM_WRITE, 4); + } + } + } else { + CSR_WRITE_4(sc, JME_PAR0, + eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); + CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + } +} + +static void jme_map_intr_vector(struct jme_softc *sc) { uint32_t map[MSINUM_NUM_INTR_SOURCE / JME_MSI_MESSAGES]; @@ -542,7 +638,7 @@ jme_attach(device_t dev) struct mii_data *mii; uint32_t reg; uint16_t burst; - int error, i, msic, msixc, pmc; + int error, i, mii_flags, msic, msixc, pmc; error = 0; sc = device_get_softc(dev); @@ -644,11 +740,14 @@ jme_attach(device_t dev) goto fail; } + /* Identify controller features and bugs. */ if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 2) { if ((sc->jme_rev & DEVICEID_JMC2XX_MASK) == DEVICEID_JMC260 && CHIPMODE_REVFM(sc->jme_chip_rev) == 2) sc->jme_flags |= JME_FLAG_DMA32BIT; - sc->jme_flags |= JME_FLAG_TXCLK; + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + sc->jme_flags |= JME_FLAG_EFUSE | JME_FLAG_PCCPCD; + sc->jme_flags |= JME_FLAG_TXCLK | JME_FLAG_RXCLK; sc->jme_flags |= JME_FLAG_HWMIB; } @@ -656,14 +755,20 @@ jme_attach(device_t dev) jme_reset(sc); /* Get station address. */ - reg = CSR_READ_4(sc, JME_SMBCSR); - if ((reg & SMBCSR_EEPROM_PRESENT) != 0) - error = jme_eeprom_macaddr(sc); - if (error != 0 || (reg & SMBCSR_EEPROM_PRESENT) == 0) { - if (error != 0 && (bootverbose)) + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) { + error = jme_efuse_macaddr(sc); + if (error == 0) + jme_reg_macaddr(sc); + } else { + error = ENOENT; + reg = CSR_READ_4(sc, JME_SMBCSR); + if ((reg & SMBCSR_EEPROM_PRESENT) != 0) + error = jme_eeprom_macaddr(sc); + if (error != 0 && bootverbose) device_printf(sc->jme_dev, "ethernet hardware address not found in EEPROM.\n"); - jme_reg_macaddr(sc); + if (error != 0) + jme_reg_macaddr(sc); } /* @@ -736,11 +841,17 @@ jme_attach(device_t dev) } ifp->if_capenable = ifp->if_capabilities; + /* Wakeup PHY. */ + jme_phy_up(sc); + mii_flags = MIIF_DOPAUSE; + /* Ask PHY calibration to PHY driver. */ + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) + mii_flags |= MIIF_MACPRIV0; /* Set up MII bus. */ error = mii_attach(dev, &sc->jme_miibus, ifp, jme_mediachange, jme_mediastatus, BMSR_DEFCAPMASK, sc->jme_flags & JME_FLAG_FPGA ? MII_PHY_ANY : sc->jme_phyaddr, - MII_OFFSET_ANY, MIIF_DOPAUSE); + MII_OFFSET_ANY, mii_flags); if (error != 0) { device_printf(dev, "attaching PHYs failed\n"); goto fail; @@ -833,6 +944,9 @@ jme_detach(device_t dev) taskqueue_drain(sc->jme_tq, &sc->jme_int_task); taskqueue_drain(sc->jme_tq, &sc->jme_tx_task); taskqueue_drain(taskqueue_swi, &sc->jme_link_task); + /* Restore possibly modified station address. */ + if ((sc->jme_flags & JME_FLAG_EFUSE) != 0) + jme_set_macaddr(sc, sc->jme_eaddr); ether_ifdetach(ifp); } @@ -1493,9 +1607,11 @@ jme_setwol(struct jme_softc *sc) CSR_WRITE_4(sc, JME_GHC, CSR_READ_4(sc, JME_GHC) & ~(GHC_TX_OFFLD_CLK_100 | GHC_TX_MAC_CLK_100 | GHC_TX_OFFLD_CLK_1000 | GHC_TX_MAC_CLK_1000)); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) | GPREG1_RX_MAC_CLK_DIS); /* No PME capability, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); return; } @@ -1527,8 +1643,7 @@ jme_setwol(struct jme_softc *sc) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); if ((ifp->if_capenable & IFCAP_WOL) == 0) { /* No WOL, PHY power down. */ - jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, - MII_BMCR, BMCR_PDOWN); + jme_phy_down(sc); } } @@ -1566,6 +1681,8 @@ jme_resume(device_t dev) pci_write_config(sc->jme_dev, pmc + PCIR_POWER_STATUS, pmstat, 2); } + /* Wakeup PHY. */ + jme_phy_up(sc); ifp = sc->jme_ifp; if ((ifp->if_flags & IFF_UP) != 0) { ifp->if_drv_flags &= ~IFF_DRV_RUNNING; @@ -2218,6 +2335,13 @@ jme_link_task(void *arg, int pending) CSR_WRITE_4(sc, JME_RXCSR, sc->jme_rxcsr | RXCSR_RX_ENB | RXCSR_RXQ_START); CSR_WRITE_4(sc, JME_TXCSR, sc->jme_txcsr | TXCSR_TX_ENB); + /* Lastly enable TX/RX clock. */ + if ((sc->jme_flags & JME_FLAG_TXCLK) != 0) + CSR_WRITE_4(sc, JME_GHC, + CSR_READ_4(sc, JME_GHC) & ~GHC_TX_MAC_CLK_DIS); + if ((sc->jme_flags & JME_FLAG_RXCLK) != 0) + CSR_WRITE_4(sc, JME_GPREG1, + CSR_READ_4(sc, JME_GPREG1) & ~GPREG1_RX_MAC_CLK_DIS); } ifp->if_drv_flags |= IFF_DRV_RUNNING; @@ -2596,13 +2720,45 @@ jme_tick(void *arg) static void jme_reset(struct jme_softc *sc) { + uint32_t ghc, gpreg; /* Stop receiver, transmitter. */ jme_stop_rx(sc); jme_stop_tx(sc); + + /* Reset controller. */ CSR_WRITE_4(sc, JME_GHC, GHC_RESET); + CSR_READ_4(sc, JME_GHC); + DELAY(10); + /* + * Workaround Rx FIFO overruns seen under certain conditions. + * Explicitly synchorize TX/RX clock. TX/RX clock should be + * enabled only after enabling TX/RX MACs. + */ + if ((sc->jme_flags & (JME_FLAG_TXCLK | JME_FLAG_RXCLK)) != 0) { + /* Disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_RESET | GHC_TX_MAC_CLK_DIS); + /* Disable RX clock. */ + gpreg = CSR_READ_4(sc, JME_GPREG1); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + gpreg = CSR_READ_4(sc, JME_GPREG1); + /* De-assert RESET but still disable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + ghc = CSR_READ_4(sc, JME_GHC); + + /* Enable TX clock. */ + CSR_WRITE_4(sc, JME_GHC, ghc & ~GHC_TX_MAC_CLK_DIS); + /* Enable RX clock. */ + CSR_WRITE_4(sc, JME_GPREG1, gpreg & ~GPREG1_RX_MAC_CLK_DIS); + CSR_READ_4(sc, JME_GPREG1); + + /* Disable TX/RX clock again. */ + CSR_WRITE_4(sc, JME_GHC, GHC_TX_MAC_CLK_DIS); + CSR_WRITE_4(sc, JME_GPREG1, gpreg | GPREG1_RX_MAC_CLK_DIS); + } else + CSR_WRITE_4(sc, JME_GHC, 0); + CSR_READ_4(sc, JME_GHC); DELAY(10); - CSR_WRITE_4(sc, JME_GHC, 0); } static void @@ -2621,7 +2777,6 @@ jme_init_locked(struct jme_softc *sc) { struct ifnet *ifp; struct mii_data *mii; - uint8_t eaddr[ETHER_ADDR_LEN]; bus_addr_t paddr; uint32_t reg; int error; @@ -2657,10 +2812,7 @@ jme_init_locked(struct jme_softc *sc) jme_init_ssb(sc); /* Reprogram the station address. */ - bcopy(IF_LLADDR(ifp), eaddr, ETHER_ADDR_LEN); - CSR_WRITE_4(sc, JME_PAR0, - eaddr[3] << 24 | eaddr[2] << 16 | eaddr[1] << 8 | eaddr[0]); - CSR_WRITE_4(sc, JME_PAR1, eaddr[5] << 8 | eaddr[4]); + jme_set_macaddr(sc, IF_LLADDR(sc->jme_ifp)); /* * Configure Tx queue. @@ -2798,6 +2950,30 @@ jme_init_locked(struct jme_softc *sc) PCCRX_COAL_PKT_MASK; CSR_WRITE_4(sc, JME_PCCRX0, reg); + /* + * Configure PCD(Packet Completion Deferring). It seems PCD + * generates an interrupt when the time interval between two + * back-to-back incoming/outgoing packet is long enough for + * it to reach its timer value 0. The arrival of new packets + * after timer has started causes the PCD timer to restart. + * Unfortunately, it's not clear how PCD is useful at this + * moment, so just use the same of PCC parameters. + */ + if ((sc->jme_flags & JME_FLAG_PCCPCD) != 0) { + sc->jme_rx_pcd_to = sc->jme_rx_coal_to; + if (sc->jme_rx_coal_to > PCDRX_TO_MAX) + sc->jme_rx_pcd_to = PCDRX_TO_MAX; + sc->jme_tx_pcd_to = sc->jme_tx_coal_to; + if (sc->jme_tx_coal_to > PCDTX_TO_MAX) + sc->jme_tx_pcd_to = PCDTX_TO_MAX; + reg = sc->jme_rx_pcd_to << PCDRX0_TO_THROTTLE_SHIFT; + reg |= sc->jme_rx_pcd_to << PCDRX0_TO_SHIFT; + CSR_WRITE_4(sc, PCDRX_REG(0), reg); + reg = sc->jme_tx_pcd_to << PCDTX_TO_THROTTLE_SHIFT; + reg |= sc->jme_tx_pcd_to << PCDTX_TO_SHIFT; + CSR_WRITE_4(sc, JME_PCDTX, reg); + } + /* Configure shadow status block but don't enable posting. */ paddr = sc->jme_rdata.jme_ssb_block_paddr; CSR_WRITE_4(sc, JME_SHBASE_ADDR_HI, JME_ADDR_HI(paddr)); @@ -3203,6 +3379,43 @@ jme_stats_update(struct jme_softc *sc) stat->tx_bad_frames += ostat->tx_bad_frames; } +static void +jme_phy_down(struct jme_softc *sc) +{ + uint32_t reg; + + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, BMCR_PDOWN); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg |= 0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_D3; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + +static void +jme_phy_up(struct jme_softc *sc) +{ + uint32_t reg; + uint16_t bmcr; + + bmcr = jme_miibus_readreg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR); + bmcr &= ~BMCR_PDOWN; + jme_miibus_writereg(sc->jme_dev, sc->jme_phyaddr, MII_BMCR, bmcr); + if (CHIPMODE_REVFM(sc->jme_chip_rev) >= 5) { + reg = CSR_READ_4(sc, JME_PHYPOWDN); + reg &= ~0x0000000F; + CSR_WRITE_4(sc, JME_PHYPOWDN, reg); + reg = pci_read_config(sc->jme_dev, JME_PCI_PE1, 4); + reg &= ~PE1_GIGA_PDOWN_MASK; + reg |= PE1_GIGA_PDOWN_DIS; + pci_write_config(sc->jme_dev, JME_PCI_PE1, reg, 4); + } +} + static int sysctl_int_range(SYSCTL_HANDLER_ARGS, int low, int high) { Modified: stable/7/sys/dev/jme/if_jmereg.h ============================================================================== --- stable/7/sys/dev/jme/if_jmereg.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jmereg.h Thu Jan 27 19:04:17 2011 (r217955) @@ -63,6 +63,10 @@ #define JME_PCI_DBG 0x9C +#define JME_PCI_PAR0 0xA4 /* JMC25x/JMC26x REVFM >= 5 */ + +#define JME_PCI_PAR1 0xA8 /* JMC25x/JMC26x REVFM >= 5 */ + #define JME_PCI_SPI 0xB0 #define SPI_ENB 0x00000010 @@ -71,6 +75,21 @@ #define SPI_SCK_CTRL 0x00000002 #define SPI_CS_N_CTRL 0x00000001 +#define JME_EFUSE_CTL1 0xB8 +#define EFUSE_CTL1_DATA_MASK 0xF0000000 +#define EFUSE_CTL1_EXECUTE 0x08000000 +#define EFUSE_CTL1_CMD_AUTOLOAD 0x02000000 +#define EFUSE_CTL1_CMD_READ 0x04000000 +#define EFUSE_CTL1_CMD_BLOW 0x06000000 +#define EFUSE_CTL1_CMD_MASK 0x06000000 +#define EFUSE_CTL1_AUTOLOAD_ERR 0x00010000 +#define EFUSE_CTL1_BYTE_SEL_MASK 0x0000FF00 +#define EFUSE_CTL1_BIT_SEL_MASK 0x00000070 +#define EFUSE_CTL1_AUTOLAOD_DONE 0x00000001 + +#define JME_EFUSE_CTL2 0xBC +#define EFUSE_CTL2_RESET 0x00008000 + #define JME_PCI_PHYCFG0 0xC0 #define JME_PCI_PHYCFG1 0xC4 @@ -86,7 +105,7 @@ /* PCIe link error/status. */ #define JME_PCI_LES 0xD8 -/* propeietary register 0. */ +/* Proprietary register 0. */ #define JME_PCI_PE0 0xE0 #define PE0_SPI_EXIST 0x00200000 #define PE0_PME_D0 0x00100000 @@ -115,7 +134,31 @@ #define PE0_PM_AUXC_MASK 0x00000007 #define PE0_PM_AUXC_DEF 0x00000007 +/* Proprietary register 1. */ #define JME_PCI_PE1 0xE4 +#define PE1_GIGA_PDOWN_MASK 0x0000C000 +#define PE1_GIGA_PDOWN_DIS 0x00000000 +#define PE1_GIGA_PDOWN_D3 0x00004000 +#define PE1_GIGA_PDOWN_PCIE_SHUTDOWN 0x00008000 +#define PE1_GIGA_PDOWN_PCIE_IDDQ 0x0000C000 + +#define JME_EFUSE_EEPROM 0xE8 +#define JME_EFUSE_EEPROM_WRITE 0x80000000 +#define JME_EFUSE_EEPROM_FUNC_MASK 0x70000000 +#define JME_EFUSE_EEPROM_PAGE_MASK 0x0F000000 +#define JME_EFUSE_EEPROM_ADDR_MASK 0x00FF0000 +#define JME_EFUSE_EEPROM_DATA_MASK 0x0000FF00 +#define JME_EFUSE_EEPROM_SMBSTAT_MASK 0x000000FF +#define JME_EFUSE_EEPROM_FUNC_SHIFT 28 +#define JME_EFUSE_EEPROM_PAGE_SHIFT 24 +#define JME_EFUSE_EEPROM_ADDR_SHIFT 16 +#define JME_EFUSE_EEPROM_DATA_SHIFT 8 +#define JME_EFUSE_EEPROM_SMBSTAT_SHIFT 0 + +#define JME_EFUSE_EEPROM_FUNC0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR0 0 +#define JME_EFUSE_EEPROM_PAGE_BAR1 1 +#define JME_EFUSE_EEPROM_PAGE_BAR2 2 #define JME_PCI_PHYTEST 0xF8 @@ -312,7 +355,7 @@ #define RXMAC_PAD_10BYTES 0x00000002 #define RXMAC_CSUM_ENB 0x00000001 -/* Rx unicast MAC address. */ +/* Rx unicast MAC address. Read-only on JMC25x/JMC26x REVFM >= 5 */ #define JME_PAR0 0x0038 #define JME_PAR1 0x003C @@ -455,6 +498,7 @@ #define JME_GIGARCHI 0x041C #define JME_GIGARDLO 0x0420 #define JME_GIGARDHI 0x0424 +#define JME_PHYPOWDN 0x0424 /* JMC250/JMC260 REVFM >= 5 */ /* BIST status and control. */ #define JME_GIGACSR 0x0428 @@ -627,6 +671,7 @@ /* General purpose register 1. */ #define JME_GPREG1 0x080C +#define GPREG1_RX_MAC_CLK_DIS 0x04000000 /* JMC250/JMC260 REVFM >= 2 */ #define GPREG1_RSS_IPV6_10_100 0x00000040 /* JMC250 A2 */ #define GPREG1_HDPX_FIX 0x00000020 /* JMC250 A2 */ #define GPREG1_INTDLY_UNIT_16US 0x00000018 /* JMC250 A1, A2 */ @@ -816,6 +861,53 @@ #define SHBASE_POST_FORCE 0x00000002 #define SHBASE_POST_ENB 0x00000001 +#define JME_PCDRX_BASE 0x0850 +#define JME_PCDRX_END 0x0857 +#define PCDRX_REG(x) (JME_PCDRX_BASE + (((x) / 2) * 4)) +#define PCDRX1_TO_THROTTLE_MASK 0xFF000000 +#define PCDRX1_TO_MASK 0x00FF0000 +#define PCDRX0_TO_THROTTLE_MASK 0x0000FF00 +#define PCDRX0_TO_MASK 0x000000FF +#define PCDRX1_TO_THROTTLE_SHIFT 24 +#define PCDRX1_TO_SHIFT 16 +#define PCDRX0_TO_THROTTLE_SHIFT 8 +#define PCDRX0_TO_SHIFT 0 +#define PCDRX_TO_MIN 1 +#define PCDRX_TO_MAX 255 + +#define JME_PCDTX 0x0858 +#define PCDTX_TO_THROTTLE_MASK 0x0000FF00 +#define PCDTX_TO_MASK 0x000000FF +#define PCDTX_TO_THROTTLE_SHIFT 8 +#define PCDTX_TO_SHIFT 0 +#define PCDTX_TO_MIN 1 +#define PCDTX_TO_MAX 255 + +#define JME_PCCPCD_STAT 0x085C +#define PCCPCD_STAT_RX3_MASK 0xFF000000 +#define PCCPCD_STAT_RX2_MASK 0x00FF0000 +#define PCCPCD_STAT_RX1_MASK 0x0000FF00 +#define PCCPCD_STAT_RX0_MASK 0x000000FF +#define PCCPCD_STAT_RX3_SHIFT 24 +#define PCCPCD_STAT_RX2_SHIFT 16 +#define PCCPCD_STAT_RX1_SHIFT 8 +#define PCCPCD_STAT_RX0_SHIFT 0 + +/* TX data throughput in KB. */ +#define JME_TX_THROUGHPUT 0x0860 +#define TX_THROUGHPUT_MASK 0x000FFFFF + +/* RX data throughput in KB. */ +#define JME_RX_THROUGHPUT 0x0864 +#define RX_THROUGHPUT_MASK 0x000FFFFF + +#define JME_LPI_CTL 0x086C +#define LPI_STAT_ANC_ANF 0x00000010 +#define LPI_STAT_AN_TIMEOUT 0x00000008 +#define LPI_STAT_RX_LPI 0x00000004 +#define LPI_INT_ENB 0x00000002 +#define LPI_REQ 0x00000001 + /* Timer 1 and 2. */ #define JME_TIMER1 0x0870 #define JME_TIMER2 0x0874 @@ -824,6 +916,15 @@ #define TIMER_CNT_SHIFT 0 #define TIMER_UNIT 1024 /* 1024us */ +/* Timer 3. */ +#define JME_TIMER3 0x0878 +#define TIMER3_TIMEOUT 0x00010000 +#define TIMER3_TIMEOUT_COUNT_MASK 0x0000FF00 /* 130ms unit */ +#define TIMER3_TIMEOUT_VAL_MASK 0x000000E0 +#define TIMER3_ENB 0x00000001 +#define TIMER3_TIMEOUT_COUNT_SHIFT 8 +#define TIMER3_TIMEOUT_VALUE_SHIFT 1 + /* Aggresive power mode control. */ #define JME_APMC 0x087C #define APMC_PCIE_SDOWN_STAT 0x80000000 Modified: stable/7/sys/dev/jme/if_jmevar.h ============================================================================== --- stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/jme/if_jmevar.h Thu Jan 27 19:04:17 2011 (r217955) @@ -185,19 +185,22 @@ struct jme_softc { uint32_t jme_tx_dma_size; uint32_t jme_rx_dma_size; int jme_flags; -#define JME_FLAG_FPGA 0x0001 -#define JME_FLAG_PCIE 0x0002 -#define JME_FLAG_PCIX 0x0003 -#define JME_FLAG_MSI 0x0004 -#define JME_FLAG_MSIX 0x0010 -#define JME_FLAG_PMCAP 0x0020 -#define JME_FLAG_FASTETH 0x0040 -#define JME_FLAG_NOJUMBO 0x0080 -#define JME_FLAG_TXCLK 0x0100 -#define JME_FLAG_DMA32BIT 0x0200 -#define JME_FLAG_HWMIB 0x0400 -#define JME_FLAG_DETACH 0x4000 -#define JME_FLAG_LINK 0x8000 +#define JME_FLAG_FPGA 0x00000001 +#define JME_FLAG_PCIE 0x00000002 +#define JME_FLAG_PCIX 0x00000004 +#define JME_FLAG_MSI 0x00000008 +#define JME_FLAG_MSIX 0x00000010 +#define JME_FLAG_PMCAP 0x00000020 +#define JME_FLAG_FASTETH 0x00000040 +#define JME_FLAG_NOJUMBO 0x00000080 +#define JME_FLAG_RXCLK 0x00000100 +#define JME_FLAG_TXCLK 0x00000200 +#define JME_FLAG_DMA32BIT 0x00000400 +#define JME_FLAG_HWMIB 0x00000800 +#define JME_FLAG_EFUSE 0x00001000 +#define JME_FLAG_PCCPCD 0x00002000 +#define JME_FLAG_DETACH 0x40000000 +#define JME_FLAG_LINK 0x80000000 struct jme_hw_stats jme_ostats; struct jme_hw_stats jme_stats; @@ -210,8 +213,10 @@ struct jme_softc { uint32_t jme_rxcsr; int jme_process_limit; int jme_tx_coal_to; + int jme_tx_pcd_to; int jme_tx_coal_pkt; int jme_rx_coal_to; + int jme_rx_pcd_to; int jme_rx_coal_pkt; volatile int jme_morework; Modified: stable/7/sys/dev/mii/jmphy.c ============================================================================== --- stable/7/sys/dev/mii/jmphy.c Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/mii/jmphy.c Thu Jan 27 19:04:17 2011 (r217955) @@ -104,6 +104,7 @@ jmphy_attach(device_t dev) struct mii_softc *sc; struct mii_attach_args *ma; struct mii_data *mii; + struct ifnet *ifp; jsc = device_get_softc(dev); sc = &jsc->mii_sc; @@ -118,6 +119,10 @@ jmphy_attach(device_t dev) sc->mii_service = jmphy_service; sc->mii_pdata = mii; + ifp = sc->mii_pdata->mii_ifp; + if (strcmp(ifp->if_dname, "jme") == 0 && + (sc->mii_flags & MIIF_MACPRIV0) != 0) + sc->mii_flags |= MIIF_PHYPRIV0; jsc->mii_oui = MII_OUI(ma->mii_id1, ma->mii_id2); jsc->mii_model = MII_MODEL(ma->mii_id2); jsc->mii_rev = MII_REV(ma->mii_id2); @@ -265,6 +270,7 @@ static void jmphy_reset(struct mii_softc *sc) { struct jmphy_softc *jsc; + uint16_t t2cr, val; int i; jsc = (struct jmphy_softc *)sc; @@ -279,6 +285,39 @@ jmphy_reset(struct mii_softc *sc) if ((PHY_READ(sc, MII_BMCR) & BMCR_RESET) == 0) break; } + /* Perform vendor recommended PHY calibration. */ + if ((sc->mii_flags & MIIF_PHYPRIV0) != 0) { + /* Select PHY test mode 1. */ + t2cr = PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + t2cr |= 0x2000; + PHY_WRITE(sc, MII_100T2CR, t2cr); + /* Apply calibration patch. */ + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~0x0002; + val |= 0x0010 | 0x0001; + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + + /* XXX 20ms to complete recalibration. */ + DELAY(20 * 1000); + + PHY_READ(sc, MII_100T2CR); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_READ | + JMPHY_EXT_COMM_2); + val = PHY_READ(sc, JMPHY_SPEC_DATA); + val &= ~(0x0001 | 0x0002 | 0x0010); + PHY_WRITE(sc, JMPHY_SPEC_DATA, val); + PHY_WRITE(sc, JMPHY_SPEC_ADDR, JMPHY_SPEC_ADDR_WRITE | + JMPHY_EXT_COMM_2); + /* Disable PHY test mode. */ + PHY_READ(sc, MII_100T2CR); + t2cr &= ~GTCR_TEST_MASK; + PHY_WRITE(sc, MII_100T2CR, t2cr); + } } static uint16_t Modified: stable/7/sys/dev/mii/jmphyreg.h ============================================================================== --- stable/7/sys/dev/mii/jmphyreg.h Thu Jan 27 19:02:28 2011 (r217954) +++ stable/7/sys/dev/mii/jmphyreg.h Thu Jan 27 19:04:17 2011 (r217955) @@ -105,4 +105,13 @@ #define JMPHY_TMCTL 0x1A #define JMPHY_TMCTL_SLEEP_ENB 0x1000 +/* PHY specific configuration register. */ +#define JMPHY_SPEC_ADDR 0x1E +#define JMPHY_SPEC_ADDR_READ 0x4000 +#define JMPHY_SPEC_ADDR_WRITE 0x8000 + +#define JMPHY_SPEC_DATA 0x1F + +#define JMPHY_EXT_COMM_2 0x32 + #endif /* _DEV_MII_JMPHYREG_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:05:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B07D106564A; Thu, 27 Jan 2011 19:05:43 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59AF78FC19; Thu, 27 Jan 2011 19:05:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ5hFk030299; Thu, 27 Jan 2011 19:05:43 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ5hR8030297; Thu, 27 Jan 2011 19:05:43 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271905.p0RJ5hR8030297@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:05:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217956 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:05:43 -0000 Author: yongari Date: Thu Jan 27 19:05:43 2011 New Revision: 217956 URL: http://svn.freebsd.org/changeset/base/217956 Log: MFC r216552: Document JMC251/JMC261 support. Modified: stable/8/share/man/man4/jme.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/jme.4 ============================================================================== --- stable/8/share/man/man4/jme.4 Thu Jan 27 19:04:17 2011 (r217955) +++ stable/8/share/man/man4/jme.4 Thu Jan 27 19:05:43 2011 (r217956) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 6, 2008 +.Dd December 18, 2010 .Dt JME 4 .Os .Sh NAME @@ -48,8 +48,8 @@ if_jme_load="YES" .Sh DESCRIPTION The .Nm -device driver provides support for JMicron JMC250 PCI Express -Gigabit Ethernet controllers and JMicron JMC260 PCI Express Fast +device driver provides support for JMicron JMC25x PCI Express +Gigabit Ethernet controllers and JMicron JMC26x PCI Express Fast Ethernet controllers. .Pp All LOMs supported by the @@ -59,7 +59,7 @@ TCP segmentation offload (TSO), hardware features, Wake On Lan (WOL) and an interrupt coalescing/moderation mechanism as well as a 64-bit multicast hash filter. .Pp -The JMC250 also supports Jumbo Frames (up to 9216 bytes), which can be +The JMC25x also supports Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 @@ -103,7 +103,11 @@ device driver provides support for the f .It JMicron JMC250 PCI Express Gigabit Ethernet controller .It +JMicron JMC251 PCI Express Gigabit Ethernet with Card Read Host controller +.It JMicron JMC260 PCI Express Fast Ethernet controller +.It +JMicron JMC261 PCI Express Gigabit Ethernet with Card Read Host controller .El .Sh LOADER TUNABLES Tunables can be set at the From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:08:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03AB3106564A; Thu, 27 Jan 2011 19:08:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E6ABE8FC13; Thu, 27 Jan 2011 19:08:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJ81eH030419; Thu, 27 Jan 2011 19:08:01 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJ81X8030417; Thu, 27 Jan 2011 19:08:01 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271908.p0RJ81X8030417@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:08:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217957 - stable/7/usr.sbin/pstat X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:08:02 -0000 Author: remko Date: Thu Jan 27 19:08:01 2011 New Revision: 217957 URL: http://svn.freebsd.org/changeset/base/217957 Log: MFC r178987 Fix pstat behaviour when using coredumps. The reference to tp was incorrect and should have been poining to &tty, tp is a virtual address from the coredump, while we should obtain the address through the tty struct. Approved by: imp (mentor, implicit trivial changes) MFC after: 1 week Submitted by: Ed Schouten (ed at 80836 dot nl) PR: 138131 Modified: stable/7/usr.sbin/pstat/pstat.c Directory Properties: stable/7/usr.sbin/pstat/ (props changed) Modified: stable/7/usr.sbin/pstat/pstat.c ============================================================================== --- stable/7/usr.sbin/pstat/pstat.c Thu Jan 27 19:05:43 2011 (r217956) +++ stable/7/usr.sbin/pstat/pstat.c Thu Jan 27 19:08:01 2011 (r217957) @@ -246,7 +246,7 @@ ttymode_kvm(void) XT_COPY(olowat); #undef XT_COPY ttyprt(&xt); - tp = TAILQ_NEXT(tp, t_list); + tp = TAILQ_NEXT(&tty, t_list); } } From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:10:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A1411065679; Thu, 27 Jan 2011 19:10:24 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89EC88FC1C; Thu, 27 Jan 2011 19:10:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJAOBs030555; Thu, 27 Jan 2011 19:10:24 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJAOVi030553; Thu, 27 Jan 2011 19:10:24 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271910.p0RJAOVi030553@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:10:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217958 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:10:24 -0000 Author: pjd Date: Thu Jan 27 19:10:24 2011 New Revision: 217958 URL: http://svn.freebsd.org/changeset/base/217958 Log: Remove __dead2 from pjdlog_verify() prototype, it does return sometimes. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.h Modified: head/sbin/hastd/pjdlog.h ============================================================================== --- head/sbin/hastd/pjdlog.h Thu Jan 27 19:08:01 2011 (r217957) +++ head/sbin/hastd/pjdlog.h Thu Jan 27 19:10:24 2011 (r217958) @@ -86,7 +86,7 @@ void pjdlog_exitx(int exitcode, const ch void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2; void pjdlog_verify(const char *func, const char *file, int line, - const char *failedexpr) __dead2; + const char *failedexpr); #define PJDLOG_VERIFY(expr) do { \ if (!(expr)) \ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:11:11 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 718CD106564A; Thu, 27 Jan 2011 19:11:11 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6091E8FC20; Thu, 27 Jan 2011 19:11:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJBBbG030661; Thu, 27 Jan 2011 19:11:11 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJBB05030658; Thu, 27 Jan 2011 19:11:11 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271911.p0RJBB05030658@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:11:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217959 - stable/8/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:11:11 -0000 Author: remko Date: Thu Jan 27 19:11:11 2011 New Revision: 217959 URL: http://svn.freebsd.org/changeset/base/217959 Log: MFC r198787 Document the WWWSUPFILE variable. PR: 137723 Submitted by: Sofian Brabez Approved by: imp (mentor, implicit) MFC after: 3 days Facilitated by: Snow B.V. PR: 137723 Modified: stable/8/share/man/man5/make.conf.5 Directory Properties: stable/8/share/man/man5/ (props changed) Modified: stable/8/share/man/man5/make.conf.5 ============================================================================== --- stable/8/share/man/man5/make.conf.5 Thu Jan 27 19:10:24 2011 (r217958) +++ stable/8/share/man/man5/make.conf.5 Thu Jan 27 19:11:11 2011 (r217959) @@ -318,6 +318,14 @@ Set this to use .Xr cvsup 1 to update your ports with .Dq Li "make update" . +.It Va WWWSUPFILE +.Pq Vt str +The www +.Ar supfile +to use when doing a +.Dq Li "make update" +This defaults to +.Pa /usr/share/examples/cvsup/www\-supfile . .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:12:05 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01BFB1065670; Thu, 27 Jan 2011 19:12:05 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4B438FC1D; Thu, 27 Jan 2011 19:12:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJC4AR030756; Thu, 27 Jan 2011 19:12:04 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJC40l030754; Thu, 27 Jan 2011 19:12:04 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271912.p0RJC40l030754@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:12:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217960 - stable/7/share/man/man5 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:12:05 -0000 Author: remko Date: Thu Jan 27 19:12:04 2011 New Revision: 217960 URL: http://svn.freebsd.org/changeset/base/217960 Log: MFC r198787 Document the WWWSUPFILE variable. PR: 137723 Submitted by: Sofian Brabez Approved by: imp (mentor, implicit) MFC after: 3 days Facilitated by: Snow B.V. PR: 137723 Modified: stable/7/share/man/man5/make.conf.5 Directory Properties: stable/7/share/man/man5/ (props changed) Modified: stable/7/share/man/man5/make.conf.5 ============================================================================== --- stable/7/share/man/man5/make.conf.5 Thu Jan 27 19:11:11 2011 (r217959) +++ stable/7/share/man/man5/make.conf.5 Thu Jan 27 19:12:04 2011 (r217960) @@ -318,6 +318,14 @@ Set this to use .Xr cvsup 1 to update your ports with .Dq Li "make update" . +.It Va WWWSUPFILE +.Pq Vt str +The www +.Ar supfile +to use when doing a +.Dq Li "make update" +This defaults to +.Pa /usr/share/examples/cvsup/www\-supfile . .El .Ss "BUILDING THE KERNEL" The following list provides a name and short description for variables From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:12:44 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADFB4106566B; Thu, 27 Jan 2011 19:12:44 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9DB7A8FC19; Thu, 27 Jan 2011 19:12:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJCi2I030834; Thu, 27 Jan 2011 19:12:44 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJCiDc030832; Thu, 27 Jan 2011 19:12:44 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271912.p0RJCiDc030832@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:12:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217961 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:12:44 -0000 Author: pjd Date: Thu Jan 27 19:12:44 2011 New Revision: 217961 URL: http://svn.freebsd.org/changeset/base/217961 Log: - Remove obvious NOTREACHED comment after abort() call. - Remove redundant newline at the end of the file. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Thu Jan 27 19:12:04 2011 (r217960) +++ head/sbin/hastd/pjdlog.c Thu Jan 27 19:12:44 2011 (r217961) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2009-2011 The FreeBSD Foundation * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -385,6 +385,4 @@ pjdlog_verify(const char *func, const ch failedexpr, func, file, line); } abort(); - /* NOTREACHED */ } - From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:15:25 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79F3C1065693; Thu, 27 Jan 2011 19:15:25 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 69EED8FC13; Thu, 27 Jan 2011 19:15:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJFPiH031028; Thu, 27 Jan 2011 19:15:25 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJFP69031026; Thu, 27 Jan 2011 19:15:25 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271915.p0RJFP69031026@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:15:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217962 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:15:25 -0000 Author: pjd Date: Thu Jan 27 19:15:25 2011 New Revision: 217962 URL: http://svn.freebsd.org/changeset/base/217962 Log: Add LOG_NDELAY flag to openlog(3) - we want descriptor to be immediately open so there are no surprises once we start chrooting or using capsicum. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Thu Jan 27 19:12:44 2011 (r217961) +++ head/sbin/hastd/pjdlog.c Thu Jan 27 19:15:25 2011 (r217962) @@ -59,7 +59,7 @@ pjdlog_mode_set(int mode) pjdlog_mode = mode; if (mode == PJDLOG_MODE_SYSLOG) - openlog(NULL, LOG_PID, LOG_DAEMON); + openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); } /* From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:17:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AE131065670; Thu, 27 Jan 2011 19:17:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F1AF8FC19; Thu, 27 Jan 2011 19:17:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJHVrC031215; Thu, 27 Jan 2011 19:17:31 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJHVMM031213; Thu, 27 Jan 2011 19:17:31 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271917.p0RJHVMM031213@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:17:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217963 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:17:32 -0000 Author: yongari Date: Thu Jan 27 19:17:31 2011 New Revision: 217963 URL: http://svn.freebsd.org/changeset/base/217963 Log: MFC r183646,216552: r183646: Add a HARDWARE section. It doesn't contain any information not already in the DESCRIPTION section, but this allows for the manual page to be used in the automatic hardware notes generation. r216552: Document JMC251/JMC261 support. Modified: stable/7/share/man/man4/jme.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/jme.4 ============================================================================== --- stable/7/share/man/man4/jme.4 Thu Jan 27 19:15:25 2011 (r217962) +++ stable/7/share/man/man4/jme.4 Thu Jan 27 19:17:31 2011 (r217963) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 27, 2008 +.Dd December 18, 2010 .Dt JME 4 .Os .Sh NAME @@ -48,8 +48,8 @@ if_jme_load="YES" .Sh DESCRIPTION The .Nm -device driver provides support for JMicron JMC250 PCI Express -Gigabit Ethernet controllers and JMicron JMC260 PCI Express Fast +device driver provides support for JMicron JMC25x PCI Express +Gigabit Ethernet controllers and JMicron JMC26x PCI Express Fast Ethernet controllers. .Pp All LOMs supported by the @@ -59,7 +59,7 @@ TCP segmentation offload (TSO), hardware features, Wake On Lan (WOL) and an interrupt coalescing/moderation mechanism as well as a 64-bit multicast hash filter. .Pp -The JMC250 also supports Jumbo Frames (up to 9216 bytes), which can be +The JMC25x also supports Jumbo Frames (up to 9216 bytes), which can be configured via the interface MTU setting. Selecting an MTU larger than 1500 bytes with the .Xr ifconfig 8 @@ -94,6 +94,21 @@ Force half duplex operation. .Pp For more information on configuring this device, see .Xr ifconfig 8 . +.Sh HARDWARE +The +.Nm +device driver provides support for the following Ethernet controllers: +.Pp +.Bl -bullet -compact +.It +JMicron JMC250 PCI Express Gigabit Ethernet controller +.It +JMicron JMC251 PCI Express Gigabit Ethernet with Card Read Host controller +.It +JMicron JMC260 PCI Express Fast Ethernet controller +.It +JMicron JMC261 PCI Express Gigabit Ethernet with Card Read Host controller +.El .Sh LOADER TUNABLES Tunables can be set at the .Xr loader 8 From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:18:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 116F2106566B; Thu, 27 Jan 2011 19:18:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 015428FC17; Thu, 27 Jan 2011 19:18:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJIgq4031316; Thu, 27 Jan 2011 19:18:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJIgXY031314; Thu, 27 Jan 2011 19:18:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271918.p0RJIgXY031314@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:18:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217964 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:18:43 -0000 Author: pjd Date: Thu Jan 27 19:18:42 2011 New Revision: 217964 URL: http://svn.freebsd.org/changeset/base/217964 Log: Use my copyright for 2011 work. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Thu Jan 27 19:17:31 2011 (r217963) +++ head/sbin/hastd/pjdlog.c Thu Jan 27 19:18:42 2011 (r217964) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2009-2011 The FreeBSD Foundation + * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:24:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A1AE10656A3; Thu, 27 Jan 2011 19:24:07 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 685478FC0C; Thu, 27 Jan 2011 19:24:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJO7IO031753; Thu, 27 Jan 2011 19:24:07 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJO7GU031748; Thu, 27 Jan 2011 19:24:07 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271924.p0RJO7GU031748@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:24:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217965 - in head/sbin: hastctl hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:24:07 -0000 Author: pjd Date: Thu Jan 27 19:24:07 2011 New Revision: 217965 URL: http://svn.freebsd.org/changeset/base/217965 Log: Add functions to initialize/finalize pjdlog. This allows to open/close log file at will. MFC after: 1 week Modified: head/sbin/hastctl/hastctl.c head/sbin/hastd/hastd.c head/sbin/hastd/pjdlog.c head/sbin/hastd/pjdlog.h Modified: head/sbin/hastctl/hastctl.c ============================================================================== --- head/sbin/hastctl/hastctl.c Thu Jan 27 19:18:42 2011 (r217964) +++ head/sbin/hastctl/hastctl.c Thu Jan 27 19:24:07 2011 (r217965) @@ -430,6 +430,7 @@ main(int argc, char *argv[]) break; } + pjdlog_init(PJDLOG_MODE_STD); pjdlog_debug_set(debug); cfg = yy_config_parse(cfgpath, true); Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Jan 27 19:18:42 2011 (r217964) +++ head/sbin/hastd/hastd.c Thu Jan 27 19:24:07 2011 (r217965) @@ -772,6 +772,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + pjdlog_init(PJDLOG_MODE_STD); pjdlog_debug_set(debuglevel); g_gate_load(); Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Thu Jan 27 19:18:42 2011 (r217964) +++ head/sbin/hastd/pjdlog.c Thu Jan 27 19:24:07 2011 (r217965) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -41,10 +42,37 @@ __FBSDID("$FreeBSD$"); #include "pjdlog.h" +static bool pjdlog_initialized = false; static int pjdlog_mode = PJDLOG_MODE_STD; static int pjdlog_debug_level = 0; static char pjdlog_prefix[128]; +void +pjdlog_init(int mode) +{ + + assert(!pjdlog_initialized); + assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); + + if (mode == PJDLOG_MODE_SYSLOG) + openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); + pjdlog_mode = mode; + + pjdlog_initialized = true; +} + +void +pjdlog_fini(void) +{ + + assert(pjdlog_initialized); + + if (pjdlog_mode == PJDLOG_MODE_SYSLOG) + closelog(); + + pjdlog_initialized = false; +} + /* * Configure where the logs should go. * By default they are send to stdout/stderr, but after going into background @@ -55,12 +83,18 @@ void pjdlog_mode_set(int mode) { + assert(pjdlog_initialized); assert(mode == PJDLOG_MODE_STD || mode == PJDLOG_MODE_SYSLOG); - pjdlog_mode = mode; + if (pjdlog_mode == mode) + return; if (mode == PJDLOG_MODE_SYSLOG) openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); + else /* if (mode == PJDLOG_MODE_STD) */ + closelog(); + + pjdlog_mode = mode; } /* @@ -70,6 +104,8 @@ int pjdlog_mode_get(void) { + assert(pjdlog_initialized); + return (pjdlog_mode); } @@ -81,6 +117,7 @@ void pjdlog_debug_set(int level) { + assert(pjdlog_initialized); assert(level >= 0); pjdlog_debug_level = level; @@ -93,6 +130,8 @@ int pjdlog_debug_get(void) { + assert(pjdlog_initialized); + return (pjdlog_debug_level); } @@ -105,6 +144,8 @@ pjdlog_prefix_set(const char *fmt, ...) { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_prefix_set(fmt, ap); va_end(ap); @@ -118,6 +159,7 @@ void pjdlogv_prefix_set(const char *fmt, va_list ap) { + assert(pjdlog_initialized); assert(fmt != NULL); vsnprintf(pjdlog_prefix, sizeof(pjdlog_prefix), fmt, ap); @@ -160,6 +202,8 @@ pjdlog_common(int loglevel, int debuglev { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_common(loglevel, debuglevel, error, fmt, ap); va_end(ap); @@ -174,6 +218,7 @@ pjdlogv_common(int loglevel, int debugle va_list ap) { + assert(pjdlog_initialized); assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || loglevel == LOG_CRIT || loglevel == LOG_ERR || loglevel == LOG_WARNING || loglevel == LOG_NOTICE || @@ -250,6 +295,8 @@ void pjdlogv(int loglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + /* LOG_DEBUG is invalid here, pjdlogv?_debug() should be used. */ assert(loglevel == LOG_EMERG || loglevel == LOG_ALERT || loglevel == LOG_CRIT || loglevel == LOG_ERR || @@ -267,6 +314,8 @@ pjdlog(int loglevel, const char *fmt, .. { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv(loglevel, fmt, ap); va_end(ap); @@ -279,6 +328,8 @@ void pjdlogv_debug(int debuglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_common(LOG_DEBUG, debuglevel, -1, fmt, ap); } @@ -290,6 +341,8 @@ pjdlog_debug(int debuglevel, const char { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_debug(debuglevel, fmt, ap); va_end(ap); @@ -302,6 +355,8 @@ void pjdlogv_errno(int loglevel, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_common(loglevel, 0, errno, fmt, ap); } @@ -313,6 +368,8 @@ pjdlog_errno(int loglevel, const char *f { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_errno(loglevel, fmt, ap); va_end(ap); @@ -325,6 +382,8 @@ void pjdlogv_exit(int exitcode, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv_errno(LOG_ERR, fmt, ap); exit(exitcode); /* NOTREACHED */ @@ -338,6 +397,8 @@ pjdlog_exit(int exitcode, const char *fm { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_exit(exitcode, fmt, ap); /* NOTREACHED */ @@ -351,6 +412,8 @@ void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) { + assert(pjdlog_initialized); + pjdlogv(LOG_ERR, fmt, ap); exit(exitcode); /* NOTREACHED */ @@ -364,6 +427,8 @@ pjdlog_exitx(int exitcode, const char *f { va_list ap; + assert(pjdlog_initialized); + va_start(ap, fmt); pjdlogv_exitx(exitcode, fmt, ap); /* NOTREACHED */ Modified: head/sbin/hastd/pjdlog.h ============================================================================== --- head/sbin/hastd/pjdlog.h Thu Jan 27 19:18:42 2011 (r217964) +++ head/sbin/hastd/pjdlog.h Thu Jan 27 19:24:07 2011 (r217965) @@ -1,5 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation + * Copyright (c) 2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -41,6 +42,9 @@ #define PJDLOG_MODE_STD 0 #define PJDLOG_MODE_SYSLOG 1 +void pjdlog_init(int mode); +void pjdlog_fini(void); + void pjdlog_mode_set(int mode); int pjdlog_mode_get(void); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:28:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 619F91065679; Thu, 27 Jan 2011 19:28:30 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C178FC1B; Thu, 27 Jan 2011 19:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJSUVf032069; Thu, 27 Jan 2011 19:28:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJSU01032066; Thu, 27 Jan 2011 19:28:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271928.p0RJSU01032066@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217966 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:28:30 -0000 Author: pjd Date: Thu Jan 27 19:28:29 2011 New Revision: 217966 URL: http://svn.freebsd.org/changeset/base/217966 Log: Extend pjdlog_verify() to support the following additional macros: PJDLOG_RVERIFY() - always check expression and on false log the given message and exit. PJDLOG_RASSERT() - check expression when NDEBUG is not defined and on false log given message and exit. PJDLOG_ABORT() - log the given message and exit. MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c head/sbin/hastd/pjdlog.h Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Thu Jan 27 19:24:07 2011 (r217965) +++ head/sbin/hastd/pjdlog.c Thu Jan 27 19:28:29 2011 (r217966) @@ -440,15 +440,38 @@ pjdlog_exitx(int exitcode, const char *f */ void pjdlog_verify(const char *func, const char *file, int line, - const char *failedexpr) + const char *failedexpr, const char *fmt, ...) { + va_list ap; - if (func == NULL) { - pjdlog_critical("Assertion failed: (%s), file %s, line %d.", - failedexpr, file, line); + assert(pjdlog_initialized); + + /* + * When there is no message we pass __func__ as 'fmt'. + * It would be cleaner to pass NULL or "", but gcc generates a warning + * for both of those. + */ + if (fmt != func) { + va_start(ap, fmt); + pjdlogv_critical(fmt, ap); + va_end(ap); + } + if (failedexpr == NULL) { + if (func == NULL) { + pjdlog_critical("Aborted at file %s, line %d.", file, + line); + } else { + pjdlog_critical("Aborted at function %s, file %s, line %d.", + func, file, line); + } } else { - pjdlog_critical("Assertion failed: (%s), function %s, file %s, line %d.", - failedexpr, func, file, line); + if (func == NULL) { + pjdlog_critical("Assertion failed: (%s), file %s, line %d.", + failedexpr, file, line); + } else { + pjdlog_critical("Assertion failed: (%s), function %s, file %s, line %d.", + failedexpr, func, file, line); + } } abort(); } Modified: head/sbin/hastd/pjdlog.h ============================================================================== --- head/sbin/hastd/pjdlog.h Thu Jan 27 19:24:07 2011 (r217965) +++ head/sbin/hastd/pjdlog.h Thu Jan 27 19:28:29 2011 (r217966) @@ -90,16 +90,28 @@ void pjdlog_exitx(int exitcode, const ch void pjdlogv_exitx(int exitcode, const char *fmt, va_list ap) __printflike(2, 0) __dead2; void pjdlog_verify(const char *func, const char *file, int line, - const char *failedexpr); + const char *failedexpr, const char *fmt, ...) __printflike(5, 6); #define PJDLOG_VERIFY(expr) do { \ - if (!(expr)) \ - pjdlog_verify(__func__, __FILE__, __LINE__, #expr); \ + if (!(expr)) { \ + pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \ + __func__); \ + } \ } while (0) +#define PJDLOG_RVERIFY(expr, ...) do { \ + if (!(expr)) { \ + pjdlog_verify(__func__, __FILE__, __LINE__, #expr, \ + __VA_ARGS__); \ + } \ +} while (0) +#define PJDLOG_ABORT(...) pjdlog_verify(__func__, __FILE__, \ + __LINE__, NULL, __VA_ARGS__) #ifdef NDEBUG #define PJDLOG_ASSERT(expr) do { } while (0) +#define PJDLOG_RASSERT(...) do { } while (0) #else #define PJDLOG_ASSERT(expr) PJDLOG_VERIFY(expr) +#define PJDLOG_RASSERT(...) PJDLOG_RVERIFY(__VA_ARGS__) #endif #endif /* !_PJDLOG_H_ */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:31:35 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A7E80106564A; Thu, 27 Jan 2011 19:31:35 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 97BD78FC1F; Thu, 27 Jan 2011 19:31:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJVZaG032231; Thu, 27 Jan 2011 19:31:35 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJVZMn032229; Thu, 27 Jan 2011 19:31:35 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271931.p0RJVZMn032229@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217967 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:31:35 -0000 Author: pjd Date: Thu Jan 27 19:31:35 2011 New Revision: 217967 URL: http://svn.freebsd.org/changeset/base/217967 Log: Close the control socket before exiting, so it will be unlinked. MFC after: 1 week Modified: head/sbin/hastd/hastd.c Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Thu Jan 27 19:28:29 2011 (r217966) +++ head/sbin/hastd/hastd.c Thu Jan 27 19:31:35 2011 (r217967) @@ -666,6 +666,7 @@ main_loop(void) case SIGTERM: sigexit_received = true; terminate_workers(); + proto_close(cfg->hc_controlconn); exit(EX_OK); break; case SIGCHLD: From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:32:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6F406106566B; Thu, 27 Jan 2011 19:32:54 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 437B38FC1A; Thu, 27 Jan 2011 19:32:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJWspY032309; Thu, 27 Jan 2011 19:32:54 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJWs6n032307; Thu, 27 Jan 2011 19:32:54 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271932.p0RJWs6n032307@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:32:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217968 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:32:54 -0000 Author: yongari Date: Thu Jan 27 19:32:53 2011 New Revision: 217968 URL: http://svn.freebsd.org/changeset/base/217968 Log: MFC r179724,179852: r179724: Add man page for ixgbe driver r179852: Bring this up to date with regard to our other section 4 and Intel manpages, also fixes a few mdoc bugs. Added: stable/7/share/man/man4/ixgbe.4 - copied, changed from r179724, head/share/man/man4/ixgbe.4 Modified: Directory Properties: stable/7/share/man/man4/ (props changed) Copied and modified: stable/7/share/man/man4/ixgbe.4 (from r179724, head/share/man/man4/ixgbe.4) ============================================================================== --- head/share/man/man4/ixgbe.4 Wed Jun 11 18:49:55 2008 (r179724, copy source) +++ stable/7/share/man/man4/ixgbe.4 Thu Jan 27 19:32:53 2011 (r217968) @@ -31,23 +31,32 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd June 11, 2008 .Dt IXGBE 4 .Os .Sh NAME .Nm ixgbe -.Nd "10 Gigabit Ethernet driver for the FreeBSD operating system" +.Nd "Intel(R) 10Gb Ethernet driver for the FreeBSD operating system" .Sh SYNOPSIS +To compile this driver into the kernel, +place the following line in your +kernel configuration file: +.Bd -ragged -offset indent .Cd "device ixgbe" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +if_ixgbe_load="YES" +.Ed .Sh DESCRIPTION The .Nm driver provides support for PCI 10Gb Ethernet adapters based on the Intel 82598EB Intel(R) Network Connections. The driver supports Jumbo Frames, MSIX, TSO, and RSS. -For a list of supported adapters, see the -.Pa README -included with the driver. .Pp For questions related to hardware requirements, refer to the documentation supplied with your Intel 10GbE adapter. @@ -61,8 +70,8 @@ utility configures the adapter to receiv The maximum MTU size for Jumbo Frames is 16114. .Pp This driver version supports VLANs. -For information on enabling VLANs, see the -.Pa README . +For information on enabling VLANs, see +.Xr ifconfig 8 . .Sh HARDWARE The .Nm @@ -73,9 +82,9 @@ driver supports the following cards: Intel(R) 10 Gigabit XF SR/AF Dual Port Server Adapter .It Intel(R) 10 Gigabit XF SR/LR Server Adapter -.IT +.It Intel(R) 82598EB 10 Gigabit AF Network Connection -.IT +.It Intel(R) 82598EB 10 Gigabit AT CX4 Network Connection .El .Sh DIAGNOSTICS @@ -89,10 +98,6 @@ The device has stopped responding to the the network connection (cable). .El .Sh SUPPORT -For additional information regarding building and installation, -see the -.Pa README -included with the driver. For general information and support, go to the Intel support website at: .Pa http://support.intel.com . @@ -103,7 +108,6 @@ issue to .Aq freebsdnic@mailbox.intel.com . .Sh SEE ALSO .Xr arp 4 , -.Xr gx 4 , .Xr netintro 4 , .Xr ng_ether 4 , .Xr polling 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:33:57 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D8E60106566B; Thu, 27 Jan 2011 19:33:57 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C8CBA8FC08; Thu, 27 Jan 2011 19:33:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJXvlr032389; Thu, 27 Jan 2011 19:33:57 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJXvLU032386; Thu, 27 Jan 2011 19:33:57 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101271933.p0RJXvLU032386@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 27 Jan 2011 19:33:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217969 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:33:57 -0000 Author: pjd Date: Thu Jan 27 19:33:57 2011 New Revision: 217969 URL: http://svn.freebsd.org/changeset/base/217969 Log: Remember created control connection so on fork(2) we can close it in child. Found with: procstat(1) MFC after: 1 week Modified: head/sbin/hastd/control.c head/sbin/hastd/hast.h Modified: head/sbin/hastd/control.c ============================================================================== --- head/sbin/hastd/control.c Thu Jan 27 19:32:53 2011 (r217968) +++ head/sbin/hastd/control.c Thu Jan 27 19:33:57 2011 (r217969) @@ -278,6 +278,7 @@ control_handle(struct hastd_config *cfg) return; } + cfg->hc_controlin = conn; nvin = nvout = NULL; role = HAST_ROLE_UNDEF; @@ -384,6 +385,7 @@ close: if (nvout != NULL) nv_free(nvout); proto_close(conn); + cfg->hc_controlin = NULL; } /* Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Thu Jan 27 19:32:53 2011 (r217968) +++ head/sbin/hastd/hast.h Thu Jan 27 19:33:57 2011 (r217969) @@ -101,6 +101,8 @@ struct hastd_config { char hc_controladdr[HAST_ADDRSIZE]; /* Protocol-specific data. */ struct proto_conn *hc_controlconn; + /* Incoming control connection. */ + struct proto_conn *hc_controlin; /* Address to listen on. */ char hc_listenaddr[HAST_ADDRSIZE]; /* Protocol-specific data. */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:37:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD5D9106564A; Thu, 27 Jan 2011 19:37:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AC4078FC15; Thu, 27 Jan 2011 19:37:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJb2S0032533; Thu, 27 Jan 2011 19:37:02 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJb2AC032530; Thu, 27 Jan 2011 19:37:02 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101271937.p0RJb2AC032530@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 19:37:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217970 - stable/7/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:37:02 -0000 Author: remko Date: Thu Jan 27 19:37:01 2011 New Revision: 217970 URL: http://svn.freebsd.org/changeset/base/217970 Log: MFC r194582 Add support for the Myson Heden 8813. Note that I also added the usbdev to the list, because the 8813 version is not yet known there. I might have twisted the sorting there but because 8813 comes before 8818, I added it before that (with _8813 to differentiate) the item. PR: 135628 Submitted by: Yoshikazu GOTO Approved by: imp (mentor, implicit) PR: 135628 Modified: stable/7/sys/dev/usb/umass.c stable/7/sys/dev/usb/usbdevs Directory Properties: stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/dev/usb/umass.c ============================================================================== --- stable/7/sys/dev/usb/umass.c Thu Jan 27 19:33:57 2011 (r217969) +++ stable/7/sys/dev/usb/umass.c Thu Jan 27 19:37:01 2011 (r217970) @@ -571,6 +571,10 @@ static struct umass_devdescr_t umass_dev UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_INQUIRY | IGNORE_RESIDUE | NO_SYNCHRONIZE_CACHE }, + { USB_VENDOR_MYSON, USB_PRODUCT_MYSON_HEDEN_8813, RID_WILDCARD, + UMASS_PROTO_SCSI | UMASS_PROTO_BBB, + NO_SYNCHRONIZE_CACHE + }, { USB_VENDOR_MYSON, USB_PRODUCT_MYSON_STARREADER, RID_WILDCARD, UMASS_PROTO_SCSI | UMASS_PROTO_BBB, NO_SYNCHRONIZE_CACHE Modified: stable/7/sys/dev/usb/usbdevs ============================================================================== --- stable/7/sys/dev/usb/usbdevs Thu Jan 27 19:33:57 2011 (r217969) +++ stable/7/sys/dev/usb/usbdevs Thu Jan 27 19:37:01 2011 (r217970) @@ -1837,6 +1837,7 @@ product MSYSTEMS DISKONKEY 0x0010 DiskOn product MSYSTEMS DISKONKEY2 0x0011 DiskOnKey /* Myson products */ +product MYSON HEDEN_8813 0x8813 USB-IDE product MYSON HEDEN 0x8818 USB-IDE product MYSON STARREADER 0x9920 USB flash card adapter From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 19:38:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C82821065673; Thu, 27 Jan 2011 19:38:03 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B72B08FC1E; Thu, 27 Jan 2011 19:38:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RJc39N032591; Thu, 27 Jan 2011 19:38:03 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RJc3NX032589; Thu, 27 Jan 2011 19:38:03 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101271938.p0RJc3NX032589@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 19:38:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217971 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 19:38:03 -0000 Author: yongari Date: Thu Jan 27 19:38:03 2011 New Revision: 217971 URL: http://svn.freebsd.org/changeset/base/217971 Log: MFC r182771: Hook up ixgbe(4) to the build. D'oh! Modified: stable/7/share/man/man4/Makefile Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/Makefile ============================================================================== --- stable/7/share/man/man4/Makefile Thu Jan 27 19:37:01 2011 (r217970) +++ stable/7/share/man/man4/Makefile Thu Jan 27 19:38:03 2011 (r217971) @@ -146,6 +146,7 @@ MAN= aac.4 \ ispfw.4 \ iwi.4 \ ixgb.4 \ + ixgbe.4 \ jme.4 \ joy.4 \ kbdmux.4 \ @@ -493,6 +494,7 @@ MLINKS+=ipfirewall.4 ipaccounting.4 \ MLINKS+=ipw.4 if_ipw.4 MLINKS+=iwi.4 if_iwi.4 MLINKS+=ixgb.4 if_ixgb.4 +MLINKS+=ixgbe.4 if_ixgbe.4 MLINKS+=kue.4 if_kue.4 MLINKS+=lagg.4 trunk.4 MLINKS+=le.4 if_le.4 From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:06:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4C801065672; Thu, 27 Jan 2011 20:06:24 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C46828FC0C; Thu, 27 Jan 2011 20:06:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RK6OlY033629; Thu, 27 Jan 2011 20:06:24 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RK6O0F033627; Thu, 27 Jan 2011 20:06:24 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101272006.p0RK6O0F033627@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 20:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217973 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:06:24 -0000 Author: yongari Date: Thu Jan 27 20:06:24 2011 New Revision: 217973 URL: http://svn.freebsd.org/changeset/base/217973 Log: Backout r216577. ixgb(4) does not support altq(4) yet. Modified: head/share/man/man4/ixgb.4 Modified: head/share/man/man4/ixgb.4 ============================================================================== --- head/share/man/man4/ixgb.4 Thu Jan 27 19:56:15 2011 (r217972) +++ head/share/man/man4/ixgb.4 Thu Jan 27 20:06:24 2011 (r217973) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 19, 2010 +.Dd August 18, 2006 .Dt IXGB 4 .Os .Sh NAME @@ -104,7 +104,6 @@ with a supported adapter, email the spec issue to .Aq freebsdnic@mailbox.intel.com . .Sh SEE ALSO -.Xr altq 4 , .Xr arp 4 , .Xr em 4 , .Xr netintro 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:08:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94E81106566B; Thu, 27 Jan 2011 20:08:15 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A9288FC08; Thu, 27 Jan 2011 20:08:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RK8F6C033728; Thu, 27 Jan 2011 20:08:15 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RK8FtX033726; Thu, 27 Jan 2011 20:08:15 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101272008.p0RK8FtX033726@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 27 Jan 2011 20:08:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217974 - head/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:08:15 -0000 Author: yongari Date: Thu Jan 27 20:08:14 2011 New Revision: 217974 URL: http://svn.freebsd.org/changeset/base/217974 Log: ixgb(4) does not support altq(4) yet. Modified: head/share/man/man4/altq.4 Modified: head/share/man/man4/altq.4 ============================================================================== --- head/share/man/man4/altq.4 Thu Jan 27 20:06:24 2011 (r217973) +++ head/share/man/man4/altq.4 Thu Jan 27 20:08:14 2011 (r217974) @@ -139,7 +139,6 @@ They have been applied to the following .Xr igb 4 , .Xr ipw 4 , .Xr iwi 4 , -.Xr ixgb 4 , .Xr ixgbe 4 , .Xr jme 4 , .Xr le 4 , From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:09:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C19BB1065674; Thu, 27 Jan 2011 20:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 960268FC12; Thu, 27 Jan 2011 20:09:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RK9LjW033792; Thu, 27 Jan 2011 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RK9LMR033789; Thu, 27 Jan 2011 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272009.p0RK9LMR033789@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 20:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217975 - in stable/8/sys: kern net X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:09:21 -0000 Author: jhb Date: Thu Jan 27 20:09:20 2011 New Revision: 217975 URL: http://svn.freebsd.org/changeset/base/217975 Log: MFC 217076: - Restore dropping the priority of syncer down to PPAUSE when it is idle. This was lost when it was converted to using a condition variable instead of lbolt. - Drop the priority of flowtable down to PPAUSE when it is idle as well since it is a similar background task. Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/net/flowtable.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c ============================================================================== --- stable/8/sys/kern/vfs_subr.c Thu Jan 27 20:08:14 2011 (r217974) +++ stable/8/sys/kern/vfs_subr.c Thu Jan 27 20:09:20 2011 (r217975) @@ -65,6 +65,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1883,6 +1884,12 @@ sched_sync(void) * matter as we are just trying to generally pace the * filesystem activity. */ + if (syncer_state != SYNCER_RUNNING || + time_uptime == starttime) { + thread_lock(td); + sched_prio(td, PPAUSE); + thread_unlock(td); + } if (syncer_state != SYNCER_RUNNING) cv_timedwait(&sync_wakeup, &sync_mtx, hz / SYNCER_SHUTDOWN_SPEEDUP); Modified: stable/8/sys/net/flowtable.c ============================================================================== --- stable/8/sys/net/flowtable.c Thu Jan 27 20:08:14 2011 (r217974) +++ stable/8/sys/net/flowtable.c Thu Jan 27 20:09:20 2011 (r217975) @@ -1548,9 +1548,11 @@ static void flowtable_cleaner(void) { VNET_ITERATOR_DECL(vnet_iter); + struct thread *td; if (bootverbose) log(LOG_INFO, "flowtable cleaner started\n"); + td = curthread; while (1) { VNET_LIST_RLOCK(); VNET_FOREACH(vnet_iter) { @@ -1565,6 +1567,9 @@ flowtable_cleaner(void) * is arbitrary */ mtx_lock(&flowclean_lock); + thread_lock(td); + sched_prio(td, PPAUSE); + thread_unlock(td); flowclean_cycles++; cv_broadcast(&flowclean_f_cv); cv_timedwait(&flowclean_c_cv, &flowclean_lock, flowclean_freq); From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:12:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB5C0106576B; Thu, 27 Jan 2011 20:12:18 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA50C8FC20; Thu, 27 Jan 2011 20:12:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKCIZ3033938; Thu, 27 Jan 2011 20:12:18 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKCIWi033936; Thu, 27 Jan 2011 20:12:18 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272012.p0RKCIWi033936@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 20:12:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217976 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:12:18 -0000 Author: jhb Date: Thu Jan 27 20:12:18 2011 New Revision: 217976 URL: http://svn.freebsd.org/changeset/base/217976 Log: MFC 217077: Only change the priority of timeshare threads to PRI_MAX_TIMESHARE when yield() is called. Specifically, leave the priority of real time and idle threads unchanged. Modified: stable/8/sys/kern/kern_synch.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_synch.c ============================================================================== --- stable/8/sys/kern/kern_synch.c Thu Jan 27 20:09:20 2011 (r217975) +++ stable/8/sys/kern/kern_synch.c Thu Jan 27 20:12:18 2011 (r217976) @@ -546,7 +546,8 @@ yield(struct thread *td, struct yield_ar { thread_lock(td); - sched_prio(td, PRI_MAX_TIMESHARE); + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) + sched_prio(td, PRI_MAX_TIMESHARE); mi_switch(SW_VOL | SWT_RELINQUISH, NULL); thread_unlock(td); td->td_retval[0] = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:12:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 263DB10656A5; Thu, 27 Jan 2011 20:12:36 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1566D8FC26; Thu, 27 Jan 2011 20:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKCZ5h033987; Thu, 27 Jan 2011 20:12:35 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKCZNQ033985; Thu, 27 Jan 2011 20:12:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272012.p0RKCZNQ033985@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 20:12:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217977 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:12:36 -0000 Author: jhb Date: Thu Jan 27 20:12:35 2011 New Revision: 217977 URL: http://svn.freebsd.org/changeset/base/217977 Log: MFC 217077: Only change the priority of timeshare threads to PRI_MAX_TIMESHARE when yield() is called. Specifically, leave the priority of real time and idle threads unchanged. Modified: stable/7/sys/kern/kern_synch.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/kern/kern_synch.c ============================================================================== --- stable/7/sys/kern/kern_synch.c Thu Jan 27 20:12:18 2011 (r217976) +++ stable/7/sys/kern/kern_synch.c Thu Jan 27 20:12:35 2011 (r217977) @@ -552,7 +552,8 @@ yield(struct thread *td, struct yield_ar { thread_lock(td); - sched_prio(td, PRI_MAX_TIMESHARE); + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) + sched_prio(td, PRI_MAX_TIMESHARE); mi_switch(SW_VOL, NULL); thread_unlock(td); td->td_retval[0] = 0; From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:28:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12AE7106566B for ; Thu, 27 Jan 2011 20:28:49 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id D96268FC0A for ; Thu, 27 Jan 2011 20:28:38 +0000 (UTC) Received: (qmail 6763 invoked by uid 399); 27 Jan 2011 20:27:44 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 27 Jan 2011 20:27:44 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D41D52D.2080906@FreeBSD.org> Date: Thu, 27 Jan 2011 12:27:25 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20101212 Thunderbird/3.1.7 MIME-Version: 1.0 To: Bruce Evans References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> <4D408463.4000001@FreeBSD.org> <20110127153956.J1436@besplex.bde.org> In-Reply-To: <20110127153956.J1436@besplex.bde.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:28:49 -0000 On 01/26/2011 21:24, Bruce Evans wrote: > On Wed, 26 Jan 2011, Doug Barton wrote: >> My concern was that the man page says that we don't support the option >> at all, but with a FreeBSD client and a solaris server it has a >> demonstrable effect. If someone wants to improve the wording then by >> all means, either make a suggestion or just do it. :) > > What is the effect? Um, the expected one? :) If I use a FreeBSD client to nfs mount something on a solaris system with the noatime option then the access time does not change no matter how many times I access the file. If I then unmount and remount without the noatime option the access time will be modified. If I do the same thing but with a FreeBSD nfs server the access time is modified, with or without the noatime option. Thus I think my change accurately describes the situation, but I'm still open to better wording. hth, Doug -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:29:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0848610656F4 for ; Thu, 27 Jan 2011 20:29:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx22.fluidhosting.com [204.14.89.5]) by mx1.freebsd.org (Postfix) with ESMTP id A67D98FC1E for ; Thu, 27 Jan 2011 20:29:40 +0000 (UTC) Received: (qmail 11079 invoked by uid 399); 27 Jan 2011 20:29:08 -0000 Received: from localhost (HELO doug-optiplex.ka9q.net) (dougb@dougbarton.us@127.0.0.1) by localhost with ESMTPAM; 27 Jan 2011 20:29:08 -0000 X-Originating-IP: 127.0.0.1 X-Sender: dougb@dougbarton.us Message-ID: <4D41D57D.5000102@FreeBSD.org> Date: Thu, 27 Jan 2011 12:28:45 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.9.2.13) Gecko/20101212 Thunderbird/3.1.7 MIME-Version: 1.0 To: Colin Percival References: <201101270901.p0R910xA007604@svn.freebsd.org> In-Reply-To: <201101270901.p0R910xA007604@svn.freebsd.org> X-Enigmail-Version: 1.1.2 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r217927 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:29:41 -0000 You will also want r217872 for rgephy.4. hth, Doug On 01/27/2011 01:01, Colin Percival wrote: > Author: cperciva > Date: Thu Jan 27 09:01:00 2011 > New Revision: 217927 > URL: http://svn.freebsd.org/changeset/base/217927 > > Log: > MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4). > k > > Modified: > stable/8/share/man/man4/nfe.4 > stable/8/share/man/man4/re.4 > Directory Properties: > stable/8/share/man/man4/ (props changed) > > Modified: stable/8/share/man/man4/nfe.4 > ============================================================================== > --- stable/8/share/man/man4/nfe.4 Thu Jan 27 08:47:06 2011 (r217926) > +++ stable/8/share/man/man4/nfe.4 Thu Jan 27 09:01:00 2011 (r217927) > @@ -16,7 +16,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January, 2011 > +.Dd January 15, 2011 > .Dt NFE 4 > .Os > .Sh NAME > > Modified: stable/8/share/man/man4/re.4 > ============================================================================== > --- stable/8/share/man/man4/re.4 Thu Jan 27 08:47:06 2011 (r217926) > +++ stable/8/share/man/man4/re.4 Thu Jan 27 09:01:00 2011 (r217927) > @@ -30,7 +30,7 @@ > .\" > .\" $FreeBSD$ > .\" > -.Dd January, 2011 > +.Dd January 15, 2011 > .Dt RE 4 > .Os > .Sh NAME > -- Nothin' ever doesn't change, but nothin' changes much. -- OK Go Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:39:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A22AA1065673; Thu, 27 Jan 2011 20:39:20 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8388E8FC26; Thu, 27 Jan 2011 20:39:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKdKo7034871; Thu, 27 Jan 2011 20:39:20 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKdKZ8034869; Thu, 27 Jan 2011 20:39:20 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272039.p0RKdKZ8034869@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:39:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217978 - stable/7/tools/tools/tinybsd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:39:20 -0000 Author: remko Date: Thu Jan 27 20:39:19 2011 New Revision: 217978 URL: http://svn.freebsd.org/changeset/base/217978 Log: MFC r194558 Add architecture support for TinyBSD PR: 135301 Submitted by: Olivier Cochard-Labbe Reviewed by: Jean Milanez Melo (maintainer) Approved by: imp (mentor, implicit) MFC after: 1 week PR: 135301 Modified: stable/7/tools/tools/tinybsd/tinybsd Directory Properties: stable/7/tools/tools/tinybsd/ (props changed) Modified: stable/7/tools/tools/tinybsd/tinybsd ============================================================================== --- stable/7/tools/tools/tinybsd/tinybsd Thu Jan 27 20:12:35 2011 (r217977) +++ stable/7/tools/tools/tinybsd/tinybsd Thu Jan 27 20:39:19 2011 (r217978) @@ -19,6 +19,8 @@ BASEFILE="tinybsd.basefiles" PORTSFILE="tinybsd.ports" PORTSDIR=/usr/ports DEFINSTARGS="-o 0 -g 0 -m 555" +TINYARCH=$(uname -p) + TS="=====>" splitarg1 () { @@ -331,7 +333,7 @@ install_ports() { make_kernel() { echo "${TS} Building customized tiny beastie kernel... " - cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/i386/conf + cp -p ${CURRENTDIR}/conf/${CONF}/${KERNCONF} /usr/src/sys/${TINYARCH}/conf cd /usr/src make buildkernel KERNCONF=${KERNCONF} || exit 1 gzip -9 /usr/obj/usr/src/sys/${KERNCONF}/kernel @@ -339,7 +341,7 @@ make_kernel() { install ${DEFINSTARGS} \ /usr/obj/usr/src/sys/${KERNCONF}/modules/usr/src/sys/modules/acpi/acpi/acpi.ko \ ${WORKDIR}/boot/kernel - install -o 0 -g 0 -m 444 /sys/i386/conf/GENERIC.hints ${WORKDIR}/boot/device.hints + install -o 0 -g 0 -m 444 /sys/${TINYARCH}/conf/GENERIC.hints ${WORKDIR}/boot/device.hints } copy_libraries() { From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:50:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73B82106566C; Thu, 27 Jan 2011 20:50:04 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E2F88FC1A; Thu, 27 Jan 2011 20:50:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKo447035321; Thu, 27 Jan 2011 20:50:04 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKo4bw035319; Thu, 27 Jan 2011 20:50:04 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272050.p0RKo4bw035319@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:50:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217979 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:50:04 -0000 Author: remko Date: Thu Jan 27 20:50:03 2011 New Revision: 217979 URL: http://svn.freebsd.org/changeset/base/217979 Log: MFC r186424 Add quirk for the Storcase InfoStation 12bay SATA to FC SAN. PR: 129858 Submitted by: Nick Triantos MFC after: 1 week PR: 129858 Modified: stable/7/sys/cam/scsi/scsi_da.c Directory Properties: stable/7/sys/cam/scsi/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_da.c Thu Jan 27 20:39:19 2011 (r217978) +++ stable/7/sys/cam/scsi/scsi_da.c Thu Jan 27 20:50:03 2011 (r217979) @@ -537,6 +537,14 @@ static struct da_quirk_entry da_quirk_ta }, { /* + * Storcase (Kingston) InfoStation IFS FC2/SATA-R 201A + * PR: 129858 + */ + {T_DIRECT, SIP_MEDIA_FIXED, "IFS", "FC2/SATA-R*", + "*"}, /*quirks*/ DA_Q_NO_SYNC_CACHE + }, + { + /* * Samsung YP-U3 mp3-player * PR: 125398 */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 20:53:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BFD0E106566B; Thu, 27 Jan 2011 20:53:03 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AEECF8FC18; Thu, 27 Jan 2011 20:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RKr3f3035440; Thu, 27 Jan 2011 20:53:03 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RKr3LW035438; Thu, 27 Jan 2011 20:53:03 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101272053.p0RKr3LW035438@svn.freebsd.org> From: Remko Lodder Date: Thu, 27 Jan 2011 20:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217980 - stable/7/sbin/fsck_ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 20:53:03 -0000 Author: remko Date: Thu Jan 27 20:53:03 2011 New Revision: 217980 URL: http://svn.freebsd.org/changeset/base/217980 Log: MFC r183110 Document the -F 's return statement. If the application returns succesfully the return code is 7 (which means the filesystem is clean). PR: 127432 Submitted by: edwin MFC after: 3 days PR: 127432 Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 Directory Properties: stable/7/sbin/fsck_ffs/ (props changed) Modified: stable/7/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 27 20:50:03 2011 (r217979) +++ stable/7/sbin/fsck_ffs/fsck_ffs.8 Thu Jan 27 20:53:03 2011 (r217980) @@ -329,6 +329,12 @@ contains default list of file systems to .El .Sh EXIT STATUS .Ex -std +.Pp +If the option +.Fl F +is used, +.Nm +exits 7 if the file system is clean. .Sh DIAGNOSTICS The diagnostics produced by .Nm From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:16:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B2991065670; Thu, 27 Jan 2011 21:16:24 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 49C8B8FC0C; Thu, 27 Jan 2011 21:16:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLGOtO036166; Thu, 27 Jan 2011 21:16:24 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLGOWI036160; Thu, 27 Jan 2011 21:16:24 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272116.p0RLGOWI036160@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:16:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217981 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:16:24 -0000 Author: jhb Date: Thu Jan 27 21:16:23 2011 New Revision: 217981 URL: http://svn.freebsd.org/changeset/base/217981 Log: MFC 217078,217079: Various priority fixes for creating new threads: - Move sched_fork() later in fork() after the various sections of the new thread and proc have been copied and zeroed from the old thread and proc. Otherwise attempts to modify thread or process data in sched_fork() could be undone. - Don't copy td_{base,}_user_pri from the old thread to the new thread in sched_fork_thread() in ULE. This is already done courtesy the bcopy() of the thread copy region. - Always initialize the real priority (td_priority) of new threads to the new thread's base priority (td_base_pri) to avoid bogusly inheriting a borrowed priority from the parent thread. - Properly initialize the base priority (td_base_pri) of thread0 to PVM to match the desired priority in td_priority. Otherwise the first time thread0 used a borrowed priority it would drop down to PUSER instead of PVM. - Explicitly initialize the starting priority of new kprocs to PVM to avoid inheriting some random priority from thread0. Modified: stable/8/sys/kern/init_main.c stable/8/sys/kern/kern_fork.c stable/8/sys/kern/kern_kthread.c stable/8/sys/kern/sched_4bsd.c stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/init_main.c ============================================================================== --- stable/8/sys/kern/init_main.c Thu Jan 27 20:53:03 2011 (r217980) +++ stable/8/sys/kern/init_main.c Thu Jan 27 21:16:23 2011 (r217981) @@ -457,7 +457,7 @@ proc0_init(void *dummy __unused) td->td_user_pri = PUSER; td->td_base_user_pri = PUSER; td->td_priority = PVM; - td->td_base_pri = PUSER; + td->td_base_pri = PVM; td->td_oncpu = 0; td->td_flags = TDF_INMEM|TDP_KTHREAD; td->td_cpuset = cpuset_thread0(); Modified: stable/8/sys/kern/kern_fork.c ============================================================================== --- stable/8/sys/kern/kern_fork.c Thu Jan 27 20:53:03 2011 (r217980) +++ stable/8/sys/kern/kern_fork.c Thu Jan 27 21:16:23 2011 (r217981) @@ -447,12 +447,6 @@ again: p2 = newproc; p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; - /* - * Allow the scheduler to initialize the child. - */ - thread_lock(td); - sched_fork(td, td2); - thread_unlock(td); AUDIT_ARG_PID(p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); @@ -548,6 +542,13 @@ again: #endif /* + * Allow the scheduler to initialize the child. + */ + thread_lock(td); + sched_fork(td, td2); + thread_unlock(td); + + /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. */ Modified: stable/8/sys/kern/kern_kthread.c ============================================================================== --- stable/8/sys/kern/kern_kthread.c Thu Jan 27 20:53:03 2011 (r217980) +++ stable/8/sys/kern/kern_kthread.c Thu Jan 27 21:16:23 2011 (r217981) @@ -116,14 +116,15 @@ kproc_create(void (*func)(void *), void /* call the processes' main()... */ cpu_set_fork_handler(td, func, arg); + thread_lock(td); TD_SET_CAN_RUN(td); + sched_prio(td, PVM); + sched_user_prio(td, PUSER); /* Delay putting it on the run queue until now. */ - if (!(flags & RFSTOPPED)) { - thread_lock(td); + if (!(flags & RFSTOPPED)) sched_add(td, SRQ_BORING); - thread_unlock(td); - } + thread_unlock(td); return 0; } Modified: stable/8/sys/kern/sched_4bsd.c ============================================================================== --- stable/8/sys/kern/sched_4bsd.c Thu Jan 27 20:53:03 2011 (r217980) +++ stable/8/sys/kern/sched_4bsd.c Thu Jan 27 21:16:23 2011 (r217981) @@ -748,6 +748,7 @@ sched_fork_thread(struct thread *td, str childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); + childtd->td_priority = childtd->td_base_pri; ts = childtd->td_sched; bzero(ts, sizeof(*ts)); ts->ts_flags |= (td->td_sched->ts_flags & TSF_AFFINITY); Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Thu Jan 27 20:53:03 2011 (r217980) +++ stable/8/sys/kern/sched_ule.c Thu Jan 27 21:16:23 2011 (r217981) @@ -1979,14 +1979,16 @@ sched_fork_thread(struct thread *td, str ts2->ts_cpu = ts->ts_cpu; ts2->ts_flags = 0; /* - * Grab our parents cpu estimation information and priority. + * Grab our parents cpu estimation information. */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; - child->td_user_pri = td->td_user_pri; - child->td_base_user_pri = td->td_base_user_pri; + /* + * Do not inherit any borrowed priority from the parent. + */ + child->td_priority = child->td_base_pri; /* * And update interactivity score. */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:21:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FC4B106566C; Thu, 27 Jan 2011 21:21:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5E73F8FC14; Thu, 27 Jan 2011 21:21:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLL99G036330; Thu, 27 Jan 2011 21:21:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLL9rf036324; Thu, 27 Jan 2011 21:21:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272121.p0RLL9rf036324@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:21:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217982 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:21:09 -0000 Author: jhb Date: Thu Jan 27 21:21:09 2011 New Revision: 217982 URL: http://svn.freebsd.org/changeset/base/217982 Log: MFC 217078,217079: Various priority fixes for creating new threads: - Move sched_fork() later in fork() after the various sections of the new thread and proc have been copied and zeroed from the old thread and proc. Otherwise attempts to modify thread or process data in sched_fork() could be undone. - Don't copy td_{base,}_user_pri from the old thread to the new thread in sched_fork_thread() in ULE. This is already done courtesy the bcopy() of the thread copy region. - Always initialize the real priority (td_priority) of new threads to the new thread's base priority (td_base_pri) to avoid bogusly inheriting a borrowed priority from the parent thread. - Properly initialize the base priority (td_base_pri) of thread0 to PVM to match the desired priority in td_priority. Otherwise the first time thread0 used a borrowed priority it would drop down to PUSER instead of PVM. - Explicitly initialize the starting priority of new kprocs to PVM to avoid inheriting some random priority from thread0. Modified: stable/7/sys/kern/init_main.c stable/7/sys/kern/kern_fork.c stable/7/sys/kern/kern_kthread.c stable/7/sys/kern/sched_4bsd.c stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) Modified: stable/7/sys/kern/init_main.c ============================================================================== --- stable/7/sys/kern/init_main.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/init_main.c Thu Jan 27 21:21:09 2011 (r217982) @@ -438,7 +438,7 @@ proc0_init(void *dummy __unused) td->td_user_pri = PUSER; td->td_base_user_pri = PUSER; td->td_priority = PVM; - td->td_base_pri = PUSER; + td->td_base_pri = PVM; td->td_oncpu = 0; td->td_flags = TDF_INMEM; td->td_cpuset = cpuset_thread0(); Modified: stable/7/sys/kern/kern_fork.c ============================================================================== --- stable/7/sys/kern/kern_fork.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/kern_fork.c Thu Jan 27 21:21:09 2011 (r217982) @@ -419,12 +419,6 @@ again: p2 = newproc; p2->p_state = PRS_NEW; /* protect against others */ p2->p_pid = trypid; - /* - * Allow the scheduler to initialize the child. - */ - thread_lock(td); - sched_fork(td, td2); - thread_unlock(td); AUDIT_ARG(pid, p2->p_pid); LIST_INSERT_HEAD(&allproc, p2, p_list); LIST_INSERT_HEAD(PIDHASH(p2->p_pid), p2, p_hash); @@ -514,6 +508,13 @@ again: td2->td_flags = TDF_INMEM; /* + * Allow the scheduler to initialize the child. + */ + thread_lock(td); + sched_fork(td, td2); + thread_unlock(td); + + /* * Duplicate sub-structures as needed. * Increase reference counts on shared objects. */ Modified: stable/7/sys/kern/kern_kthread.c ============================================================================== --- stable/7/sys/kern/kern_kthread.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/kern_kthread.c Thu Jan 27 21:21:09 2011 (r217982) @@ -109,14 +109,15 @@ kthread_create(void (*func)(void *), voi /* call the processes' main()... */ td = FIRST_THREAD_IN_PROC(p2); cpu_set_fork_handler(td, func, arg); + thread_lock(td); TD_SET_CAN_RUN(td); + sched_prio(td, PVM); + sched_user_prio(td, PUSER); /* Delay putting it on the run queue until now. */ - if (!(flags & RFSTOPPED)) { - thread_lock(td); + if (!(flags & RFSTOPPED)) sched_add(td, SRQ_BORING); - thread_unlock(td); - } + thread_unlock(td); return 0; } Modified: stable/7/sys/kern/sched_4bsd.c ============================================================================== --- stable/7/sys/kern/sched_4bsd.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/sched_4bsd.c Thu Jan 27 21:21:09 2011 (r217982) @@ -660,6 +660,7 @@ sched_fork_thread(struct thread *td, str childtd->td_estcpu = td->td_estcpu; childtd->td_lock = &sched_lock; childtd->td_cpuset = cpuset_ref(td->td_cpuset); + childtd->td_priority = childtd->td_base_pri; sched_newthread(childtd); childtd->td_sched->ts_flags |= (td->td_sched->ts_flags & TSF_AFFINITY); } Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jan 27 21:16:23 2011 (r217981) +++ stable/7/sys/kern/sched_ule.c Thu Jan 27 21:21:09 2011 (r217982) @@ -2065,14 +2065,16 @@ sched_fork_thread(struct thread *td, str ts2->ts_cpu = ts->ts_cpu; ts2->ts_runq = NULL; /* - * Grab our parents cpu estimation information and priority. + * Grab our parents cpu estimation information. */ ts2->ts_ticks = ts->ts_ticks; ts2->ts_ltick = ts->ts_ltick; ts2->ts_incrtick = ts->ts_incrtick; ts2->ts_ftick = ts->ts_ftick; - child->td_user_pri = td->td_user_pri; - child->td_base_user_pri = td->td_base_user_pri; + /* + * Do not inherit any borrowed priority from the parent. + */ + child->td_priority = child->td_base_pri; /* * And update interactivity score. */ From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:27:49 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BA768106564A; Thu, 27 Jan 2011 21:27:49 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E4008FC0C; Thu, 27 Jan 2011 21:27:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLRnKu036566; Thu, 27 Jan 2011 21:27:49 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLRnb5036565; Thu, 27 Jan 2011 21:27:49 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272127.p0RLRnb5036565@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:27:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217983 - in stable/7/sys: . cam/scsi cddl/contrib/opensolaris contrib/dev/acpica contrib/pf dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:27:49 -0000 Author: jhb Date: Thu Jan 27 21:27:49 2011 New Revision: 217983 URL: http://svn.freebsd.org/changeset/base/217983 Log: Cleanup mergeinfo from some earlier changes. Modified: Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cam/scsi/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/usb/ (props changed) From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:28:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC88D106564A; Thu, 27 Jan 2011 21:28:01 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 9BF5D8FC13; Thu, 27 Jan 2011 21:28:01 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 32D3C46B37; Thu, 27 Jan 2011 16:28:01 -0500 (EST) Received: from jhbbsd.localnet (smtp.hudson-trading.com [209.249.190.9]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 498B68A009; Thu, 27 Jan 2011 16:28:00 -0500 (EST) From: John Baldwin To: Remko Lodder Date: Thu, 27 Jan 2011 16:20:39 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) References: <201101272050.p0RKo4bw035319@svn.freebsd.org> In-Reply-To: <201101272050.p0RKo4bw035319@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201101271620.39540.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Thu, 27 Jan 2011 16:28:00 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.9 required=4.2 tests=BAYES_00 autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-7@freebsd.org Subject: Re: svn commit: r217979 - stable/7/sys/cam/scsi X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:28:01 -0000 On Thursday, January 27, 2011 3:50:04 pm Remko Lodder wrote: > Author: remko > Date: Thu Jan 27 20:50:03 2011 > New Revision: 217979 > URL: http://svn.freebsd.org/changeset/base/217979 > > Log: > MFC r186424 > > Add quirk for the Storcase InfoStation 12bay > SATA to FC SAN. > > PR: 129858 > Submitted by: Nick Triantos > MFC after: 1 week > > PR: 129858 > > Modified: > stable/7/sys/cam/scsi/scsi_da.c > Directory Properties: > stable/7/sys/cam/scsi/ (props changed) All kernel changes should be merged to sys/, not a subdirectory. -- John Baldwin From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:32:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8ECF6106566C; Thu, 27 Jan 2011 21:32:50 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 63B6F8FC17; Thu, 27 Jan 2011 21:32:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLWoKJ036804; Thu, 27 Jan 2011 21:32:50 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLWoTp036802; Thu, 27 Jan 2011 21:32:50 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272132.p0RLWoTp036802@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:32:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217984 - stable/8/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:32:50 -0000 Author: jhb Date: Thu Jan 27 21:32:50 2011 New Revision: 217984 URL: http://svn.freebsd.org/changeset/base/217984 Log: MFC 217237,217291: - Fix two harmless off-by-one errors. - Always use PRI_BASE() when checking the base type of a thread's priority class. Modified: stable/8/sys/kern/sched_ule.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/sched_ule.c ============================================================================== --- stable/8/sys/kern/sched_ule.c Thu Jan 27 21:27:49 2011 (r217983) +++ stable/8/sys/kern/sched_ule.c Thu Jan 27 21:32:50 2011 (r217984) @@ -153,7 +153,7 @@ static struct td_sched td_sched0; #define SCHED_PRI_NHALF (SCHED_PRI_NRESV / 2) #define SCHED_PRI_MIN (PRI_MIN_TIMESHARE + SCHED_PRI_NHALF) #define SCHED_PRI_MAX (PRI_MAX_TIMESHARE - SCHED_PRI_NHALF) -#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN) +#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN + 1) #define SCHED_PRI_TICKS(ts) \ (SCHED_TICK_HZ((ts)) / \ (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) @@ -1391,7 +1391,7 @@ sched_priority(struct thread *td) int score; int pri; - if (td->td_pri_class != PRI_TIMESHARE) + if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) return; /* * If the score is interactive we place the thread in the realtime @@ -1409,8 +1409,8 @@ sched_priority(struct thread *td) score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_REALTIME; - pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) - * score; + pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME + 1) / + sched_interact) * score; KASSERT(pri >= PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME, ("sched_priority: invalid interactive priority %d score %d", pri, score)); @@ -2142,7 +2142,7 @@ sched_clock(struct thread *td) ts = td->td_sched; if (td->td_pri_class & PRI_FIFO_BIT) return; - if (td->td_pri_class == PRI_TIMESHARE) { + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { /* * We used a tick; charge it to the thread so * that we can compute our interactivity. From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:33:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADB1D1065672; Thu, 27 Jan 2011 21:33:06 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82A478FC15; Thu, 27 Jan 2011 21:33:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLX6lE036875; Thu, 27 Jan 2011 21:33:06 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLX6Yh036873; Thu, 27 Jan 2011 21:33:06 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101272133.p0RLX6Yh036873@svn.freebsd.org> From: John Baldwin Date: Thu, 27 Jan 2011 21:33:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217985 - stable/7/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:33:06 -0000 Author: jhb Date: Thu Jan 27 21:33:06 2011 New Revision: 217985 URL: http://svn.freebsd.org/changeset/base/217985 Log: MFC 217237,217291: - Fix two harmless off-by-one errors. - Always use PRI_BASE() when checking the base type of a thread's priority class. Modified: stable/7/sys/kern/sched_ule.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/kern/sched_ule.c ============================================================================== --- stable/7/sys/kern/sched_ule.c Thu Jan 27 21:32:50 2011 (r217984) +++ stable/7/sys/kern/sched_ule.c Thu Jan 27 21:33:06 2011 (r217985) @@ -151,7 +151,7 @@ static struct td_sched td_sched0; #define SCHED_PRI_NHALF (SCHED_PRI_NRESV / 2) #define SCHED_PRI_MIN (PRI_MIN_TIMESHARE + SCHED_PRI_NHALF) #define SCHED_PRI_MAX (PRI_MAX_TIMESHARE - SCHED_PRI_NHALF) -#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN) +#define SCHED_PRI_RANGE (SCHED_PRI_MAX - SCHED_PRI_MIN + 1) #define SCHED_PRI_TICKS(ts) \ (SCHED_TICK_HZ((ts)) / \ (roundup(SCHED_TICK_TOTAL((ts)), SCHED_PRI_RANGE) / SCHED_PRI_RANGE)) @@ -1460,7 +1460,7 @@ sched_priority(struct thread *td) int score; int pri; - if (td->td_pri_class != PRI_TIMESHARE) + if (PRI_BASE(td->td_pri_class) != PRI_TIMESHARE) return; /* * If the score is interactive we place the thread in the realtime @@ -1478,8 +1478,8 @@ sched_priority(struct thread *td) score = imax(0, sched_interact_score(td) + td->td_proc->p_nice); if (score < sched_interact) { pri = PRI_MIN_REALTIME; - pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME) / sched_interact) - * score; + pri += ((PRI_MAX_REALTIME - PRI_MIN_REALTIME + 1) / + sched_interact) * score; KASSERT(pri >= PRI_MIN_REALTIME && pri <= PRI_MAX_REALTIME, ("sched_priority: invalid interactive priority %d score %d", pri, score)); @@ -2229,7 +2229,7 @@ sched_clock(struct thread *td) ts = td->td_sched; if (td->td_pri_class & PRI_FIFO_BIT) return; - if (td->td_pri_class == PRI_TIMESHARE) { + if (PRI_BASE(td->td_pri_class) == PRI_TIMESHARE) { /* * We used a tick; charge it to the thread so * that we can compute our interactivity. From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:39:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8603106564A; Thu, 27 Jan 2011 21:39:03 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D74828FC13; Thu, 27 Jan 2011 21:39:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLd3vT037305; Thu, 27 Jan 2011 21:39:03 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLd3rT037303; Thu, 27 Jan 2011 21:39:03 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101272139.p0RLd3rT037303@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 21:39:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217986 - stable/7/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:39:04 -0000 Author: cperciva Date: Thu Jan 27 21:39:03 2011 New Revision: 217986 URL: http://svn.freebsd.org/changeset/base/217986 Log: MFC r217872: Unbreak .Dd line. Approved by: re (kib) Modified: stable/7/share/man/man4/rgephy.4 Directory Properties: stable/7/share/man/man4/ (props changed) Modified: stable/7/share/man/man4/rgephy.4 ============================================================================== --- stable/7/share/man/man4/rgephy.4 Thu Jan 27 21:33:06 2011 (r217985) +++ stable/7/share/man/man4/rgephy.4 Thu Jan 27 21:39:03 2011 (r217986) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:39:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B861C106564A; Thu, 27 Jan 2011 21:39:45 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A7C548FC20; Thu, 27 Jan 2011 21:39:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLdja6037407; Thu, 27 Jan 2011 21:39:45 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLdjuN037405; Thu, 27 Jan 2011 21:39:45 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101272139.p0RLdjuN037405@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 21:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217987 - releng/7.4/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:39:45 -0000 Author: cperciva Date: Thu Jan 27 21:39:45 2011 New Revision: 217987 URL: http://svn.freebsd.org/changeset/base/217987 Log: MFC r217872: Unbreak .Dd line. Approved by: re (kib) Modified: releng/7.4/share/man/man4/rgephy.4 Directory Properties: releng/7.4/share/man/man4/ (props changed) Modified: releng/7.4/share/man/man4/rgephy.4 ============================================================================== --- releng/7.4/share/man/man4/rgephy.4 Thu Jan 27 21:39:03 2011 (r217986) +++ releng/7.4/share/man/man4/rgephy.4 Thu Jan 27 21:39:45 2011 (r217987) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:40:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40425106566C; Thu, 27 Jan 2011 21:40:32 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F2E38FC0C; Thu, 27 Jan 2011 21:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLeWDO037515; Thu, 27 Jan 2011 21:40:32 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLeWb8037513; Thu, 27 Jan 2011 21:40:32 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101272140.p0RLeWb8037513@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 21:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217988 - stable/8/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:40:32 -0000 Author: cperciva Date: Thu Jan 27 21:40:31 2011 New Revision: 217988 URL: http://svn.freebsd.org/changeset/base/217988 Log: MFC r217872: Unbreak .Dd line. Approved by: re (kib) Modified: stable/8/share/man/man4/rgephy.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/rgephy.4 ============================================================================== --- stable/8/share/man/man4/rgephy.4 Thu Jan 27 21:39:45 2011 (r217987) +++ stable/8/share/man/man4/rgephy.4 Thu Jan 27 21:40:31 2011 (r217988) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:41:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 966C11065809; Thu, 27 Jan 2011 21:41:27 +0000 (UTC) (envelope-from cperciva@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE5CD8FC1B; Thu, 27 Jan 2011 21:41:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLfRxE037657; Thu, 27 Jan 2011 21:41:27 GMT (envelope-from cperciva@svn.freebsd.org) Received: (from cperciva@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLfRsV037656; Thu, 27 Jan 2011 21:41:27 GMT (envelope-from cperciva@svn.freebsd.org) Message-Id: <201101272141.p0RLfRsV037656@svn.freebsd.org> From: Colin Percival Date: Thu, 27 Jan 2011 21:41:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217990 - releng/8.2/share/man/man4 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:41:31 -0000 Author: cperciva Date: Thu Jan 27 21:41:27 2011 New Revision: 217990 URL: http://svn.freebsd.org/changeset/base/217990 Log: MFC r217872: Unbreak .Dd line. Approved by: re (kib) Modified: releng/8.2/share/man/man4/rgephy.4 Directory Properties: releng/8.2/share/man/man4/ (props changed) Modified: releng/8.2/share/man/man4/rgephy.4 ============================================================================== --- releng/8.2/share/man/man4/rgephy.4 Thu Jan 27 21:41:25 2011 (r217989) +++ releng/8.2/share/man/man4/rgephy.4 Thu Jan 27 21:41:27 2011 (r217990) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 15 2011 $ +.Dd January 16, 2011 .Dt RGEPHY 4 .Os .Sh NAME From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 21:45:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3DE0106566B; Thu, 27 Jan 2011 21:45:38 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E36D18FC19; Thu, 27 Jan 2011 21:45:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RLjcNp037961; Thu, 27 Jan 2011 21:45:38 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RLjc8l037959; Thu, 27 Jan 2011 21:45:38 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101272145.p0RLjc8l037959@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 27 Jan 2011 21:45:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217991 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 21:45:39 -0000 Author: kib Date: Thu Jan 27 21:45:38 2011 New Revision: 217991 URL: http://svn.freebsd.org/changeset/base/217991 Log: linux_sigreturn() loads the struct trapframe from l_sigcontext members, thus making a signed extension of 32 bit register context. If the register is not touched in usermode between return from signal and next syscall entry, the sign-extension part of 64bit register is not cleared, causing linux32_fetch_syscall_args() to read wrong values. Use unsigned type for the registers in the linux sigcontext. Reported by: Jacob Frelinger , arundel In collaboration with: dchagin MFC after: 1 week Modified: head/sys/amd64/linux32/linux.h Modified: head/sys/amd64/linux32/linux.h ============================================================================== --- head/sys/amd64/linux32/linux.h Thu Jan 27 21:41:27 2011 (r217990) +++ head/sys/amd64/linux32/linux.h Thu Jan 27 21:45:38 2011 (r217991) @@ -370,28 +370,28 @@ typedef struct { /* The Linux sigcontext, pretty much a standard 386 trapframe. */ struct l_sigcontext { - l_int sc_gs; - l_int sc_fs; - l_int sc_es; - l_int sc_ds; - l_int sc_edi; - l_int sc_esi; - l_int sc_ebp; - l_int sc_esp; - l_int sc_ebx; - l_int sc_edx; - l_int sc_ecx; - l_int sc_eax; - l_int sc_trapno; - l_int sc_err; - l_int sc_eip; - l_int sc_cs; - l_int sc_eflags; - l_int sc_esp_at_signal; - l_int sc_ss; - l_int sc_387; - l_int sc_mask; - l_int sc_cr2; + l_uint sc_gs; + l_uint sc_fs; + l_uint sc_es; + l_uint sc_ds; + l_uint sc_edi; + l_uint sc_esi; + l_uint sc_ebp; + l_uint sc_esp; + l_uint sc_ebx; + l_uint sc_edx; + l_uint sc_ecx; + l_uint sc_eax; + l_uint sc_trapno; + l_uint sc_err; + l_uint sc_eip; + l_uint sc_cs; + l_uint sc_eflags; + l_uint sc_esp_at_signal; + l_uint sc_ss; + l_uint sc_387; + l_uint sc_mask; + l_uint sc_cr2; } __packed; struct l_ucontext { From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 23:05:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 63F32106564A; Thu, 27 Jan 2011 23:05:30 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5119E8FC0A; Thu, 27 Jan 2011 23:05:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN5UhV042268; Thu, 27 Jan 2011 23:05:30 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN5UJC042264; Thu, 27 Jan 2011 23:05:30 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101272305.p0RN5UJC042264@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 27 Jan 2011 23:05:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217993 - in stable/8: share/man/man4 sys/dev/usb sys/dev/usb/serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:05:30 -0000 Author: gavin Date: Thu Jan 27 23:05:29 2011 New Revision: 217993 URL: http://svn.freebsd.org/changeset/base/217993 Log: Merge r217061, r217274, r217275 from head: - Support the Uniform Industrial Corp (UIC) MSR206 Magnetic Card Reader. - Improve or fix some comments. - Update the uplcom(4) man page to reflect the devices currently supported by uplcom(4). Modified: stable/8/share/man/man4/uplcom.4 stable/8/sys/dev/usb/serial/uplcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man4/uplcom.4 ============================================================================== --- stable/8/share/man/man4/uplcom.4 Thu Jan 27 23:04:16 2011 (r217992) +++ stable/8/share/man/man4/uplcom.4 Thu Jan 27 23:05:29 2011 (r217993) @@ -36,7 +36,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 22, 2006 +.Dd January 11, 2011 .Dt UPLCOM 4 .Os .Sh NAME @@ -70,19 +70,35 @@ driver which makes it behave like a .Sh HARDWARE The .Nm -driver supports the following adapters: +driver supports the following devices and adapters: .Pp .Bl -bullet -compact .It -ATEN UC-232A +ADLINK ND-6530 USB-Serial Adapter +.It +Alcatel One Touch 535/735 Phone +.It +Alcor AU9720 USB-RS232 Serial Adapter +.It +AlDiga AL-11U Modem +.It +Alltronix ACM003U00 Modem .It -BAFO BF-800 +Anchor Serial adapter .It -BAFO BF-810 +ATEN UC-232A +.It +BAFO BF-800 and BF-810 .It Belkin F5U257 .It -ELECOM UC-SGT +BenQ S81 Phone +.It +Corega CG-USBRS232R Serial Adapter +.It +Cressi Edy (Seiko) Diving Computer +.It +ELECOM UC-SGT Serial Adapter .It HAL Corporation Crossam2+USB IR commander .It @@ -90,29 +106,83 @@ Hama USB RS-232 Serial Adapter .It Hamlet exagerate XURS232 .It +HP LD220 Point-Of-Sale (POS) Display +.It IOGEAR UC-232A .It -I/O DATA USB-RSAQ +I/O DATA USB-RSAQ, USB-RSAQ2, USB-RSAQ3 and USB-RSAQ5 +.It +iTegno WM1080A GSM/GFPRS Modem +.It +iTegno WM2080A CDMA Modem .It -I/O DATA USB-RSAQ2 +Leadtek 9531 GPS .It -I/O DATA USB-RSAQ3 +Micromax 610U Modem +.It +Microsoft Palm 700WX .It Mobile Action MA-620 Infrared Adapter .It +Nokia CA-42 Cable +.It +OTI DKU-5 cable +.It +Panasonic TY-TP50P6-S flat screen +.It +PLX CA-42 Phone Cable +.It PLANEX USB-RS232 URS-03 .It +Prolific Generic USB-Serial Adapters +.It +Prolific Pharos USB-Serial Adapter +.It RATOC REX-USB60 .It Radio Shack USB Serial Cable .It +Sagem USB-Serial Adapter +.It +Samsung I330 Phone Cradle +.It Sandberg USB to Serial Link (model number 133-08) .It +Sanwa KB-USB2 Multimeter cable +.It +Siemens/BenQ EF81, SX1, X65 and X75 Mobile Phones +.It +Sitecom USB-Serial Adapter +.It +SMART Technologies USB-Serial Adapter +.It +Sony QN3 Phone Cable +.It +Sony Ericsson Datapilot +.It +Sony Ericsson DCU-10 and DCU-11 (Susteen) USB Cables +.It SOURCENEXT KeikaiDenwa 8 (with and without charger) .It -Sony Ericsson USB Cable (Susteen USB Data Cable) +Speed Dragon USB-Serial Cable +.It +Syntech CPT-8001C Barcode Scanner +.It +TDK UHA6400 and UPA9664 USB-PHS Adapters +.It +TRENDnet USB to Serial Converter (TU-S9) +.It +Tripp-Lite U209-000-R USB-Serial Adapter +.It +UIC HCR331 Magnetic Stripe Card Reader +.It +UIC MSR206 Magnetic Stripe Card Reader .It Willcom W-SIM DD PHS terminal.(WS002IN) +.It +YC-Cable USB-Serial Adapter +.It +Zeagle N2iTion3 Diving Computer .El .Sh SEE ALSO .Xr tty 4 , Modified: stable/8/sys/dev/usb/serial/uplcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uplcom.c Thu Jan 27 23:04:16 2011 (r217992) +++ stable/8/sys/dev/usb/serial/uplcom.c Thu Jan 27 23:05:29 2011 (r217993) @@ -255,11 +255,11 @@ static const struct usb_device_id uplcom UPLCOM_DEV(ALCOR, AU9720), /* Alcor AU9720 USB 2.0-RS232 */ UPLCOM_DEV(ANCHOR, SERIAL), /* Anchor Serial adapter */ UPLCOM_DEV(ATEN, UC232A), /* PLANEX USB-RS232 URS-03 */ - UPLCOM_DEV(BELKIN, F5U257), /* Belkin F5U257 */ + UPLCOM_DEV(BELKIN, F5U257), /* Belkin F5U257 USB to Serial */ UPLCOM_DEV(COREGA, CGUSBRS232R), /* Corega CG-USBRS232R */ UPLCOM_DEV(EPSON, CRESSI_EDY), /* Cressi Edy diving computer */ - UPLCOM_DEV(ELECOM, UCSGT), /* ELECOM UC-SGT */ - UPLCOM_DEV(ELECOM, UCSGT0), /* ELECOM UC-SGT */ + UPLCOM_DEV(ELECOM, UCSGT), /* ELECOM UC-SGT Serial Adapter */ + UPLCOM_DEV(ELECOM, UCSGT0), /* ELECOM UC-SGT Serial Adapter */ UPLCOM_DEV(HAL, IMR001), /* HAL Corporation Crossam2+USB */ UPLCOM_DEV(HP, LD220), /* HP LD220 POS Display */ UPLCOM_DEV(IODATA, USBRSAQ), /* I/O DATA USB-RSAQ */ @@ -283,18 +283,19 @@ static const struct usb_device_id uplcom UPLCOM_DEV(PROLIFIC, PL2303), /* Generic adapter */ UPLCOM_DEV(PROLIFIC, RSAQ2), /* I/O DATA USB-RSAQ2 */ UPLCOM_DEV(PROLIFIC, RSAQ3), /* I/O DATA USB-RSAQ3 */ + UPLCOM_DEV(PROLIFIC, UIC_MSR206), /* UIC MSR206 Card Reader */ UPLCOM_DEV(PROLIFIC2, PL2303), /* Prolific adapter */ - UPLCOM_DEV(RADIOSHACK, USBCABLE), + UPLCOM_DEV(RADIOSHACK, USBCABLE), /* Radio Shack USB Adapter */ UPLCOM_DEV(RATOC, REXUSB60), /* RATOC REX-USB60 */ UPLCOM_DEV(SAGEM, USBSERIAL), /* Sagem USB-Serial Controller */ UPLCOM_DEV(SAMSUNG, I330), /* Samsung I330 phone cradle */ UPLCOM_DEV(SANWA, KB_USB2), /* Sanwa KB-USB2 Multimeter cable */ - UPLCOM_DEV(SIEMENS3, EF81), /* Seimens EF81 */ - UPLCOM_DEV(SIEMENS3, SX1), /* Seimens SX1 */ - UPLCOM_DEV(SIEMENS3, X65), /* Seimens X65 */ - UPLCOM_DEV(SIEMENS3, X75), /* Seimens X75 */ + UPLCOM_DEV(SIEMENS3, EF81), /* Siemens EF81 */ + UPLCOM_DEV(SIEMENS3, SX1), /* Siemens SX1 */ + UPLCOM_DEV(SIEMENS3, X65), /* Siemens X65 */ + UPLCOM_DEV(SIEMENS3, X75), /* Siemens X75 */ UPLCOM_DEV(SITECOM, SERIAL), /* Sitecom USB to Serial */ - UPLCOM_DEV(SMART, PL2303), /* SMART Technologies */ + UPLCOM_DEV(SMART, PL2303), /* SMART Technologies USB to Serial */ UPLCOM_DEV(SONY, QN3), /* Sony QN3 phone cable */ UPLCOM_DEV(SONYERICSSON, DATAPILOT), /* Sony Ericsson Datapilot */ UPLCOM_DEV(SONYERICSSON, DCU10), /* Sony Ericsson DCU-10 Cable */ @@ -304,7 +305,7 @@ static const struct usb_device_id uplcom UPLCOM_DEV(SYNTECH, CPT8001C), /* Syntech CPT-8001C Barcode scanner */ UPLCOM_DEV(TDK, UHA6400), /* TDK USB-PHS Adapter UHA6400 */ UPLCOM_DEV(TDK, UPA9664), /* TDK USB-PHS Adapter UPA9664 */ - UPLCOM_DEV(TRIPPLITE, U209), /* Tripp-Lite U209-000-R */ + UPLCOM_DEV(TRIPPLITE, U209), /* Tripp-Lite U209-000-R USB to Serial */ UPLCOM_DEV(YCCABLE, PL2303), /* YC Cable USB-Serial */ }; #undef UPLCOM_DEV Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Jan 27 23:04:16 2011 (r217992) +++ stable/8/sys/dev/usb/usbdevs Thu Jan 27 23:05:29 2011 (r217993) @@ -2599,6 +2599,7 @@ product PROLIFIC ALLTRONIX_GPRS 0x0609 A product PROLIFIC ALDIGA_AL11U 0x0611 AlDiga AL-11U modem product PROLIFIC MICROMAX_610U 0x0612 Micromax 610U product PROLIFIC DCU11 0x1234 DCU-11 Phone Cable +product PROLIFIC UIC_MSR206 0x206a UIC MSR206 Card Reader product PROLIFIC PL2303 0x2303 PL2303 Serial (ATEN/IOGEAR UC232A) product PROLIFIC PL2305 0x2305 Parallel printer product PROLIFIC ATAPI4 0x2307 ATAPI-4 Controller From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 23:07:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3505A106564A; Thu, 27 Jan 2011 23:07:04 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 23F748FC13; Thu, 27 Jan 2011 23:07:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN74H3042420; Thu, 27 Jan 2011 23:07:04 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN74lx042418; Thu, 27 Jan 2011 23:07:04 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101272307.p0RN74lx042418@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 27 Jan 2011 23:07:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217994 - stable/8/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:07:04 -0000 Author: gavin Date: Thu Jan 27 23:07:03 2011 New Revision: 217994 URL: http://svn.freebsd.org/changeset/base/217994 Log: Merge r217264 from head: Remove a bullet point that appears to have been accidentally inserted twice. It has also been included within the feature lists to which it is relevant. Submitted by: tobez Modified: stable/8/share/man/man3/queue.3 Directory Properties: stable/8/share/man/man3/ (props changed) Modified: stable/8/share/man/man3/queue.3 ============================================================================== --- stable/8/share/man/man3/queue.3 Thu Jan 27 23:05:29 2011 (r217993) +++ stable/8/share/man/man3/queue.3 Thu Jan 27 23:07:03 2011 (r217994) @@ -186,7 +186,6 @@ O(1) removal of an entry from the head o Forward traversal through the list. .El .Pp -O(n) removal of any entry in the list. Singly-linked lists are the simplest of the four data structures and support only the above functionality. Singly-linked lists are ideal for applications with large datasets From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 23:07:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B5BC1065673; Thu, 27 Jan 2011 23:07:23 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A4B58FC12; Thu, 27 Jan 2011 23:07:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN7NZT042477; Thu, 27 Jan 2011 23:07:23 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN7NkF042475; Thu, 27 Jan 2011 23:07:23 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101272307.p0RN7NkF042475@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 27 Jan 2011 23:07:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217995 - stable/7/share/man/man3 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:07:23 -0000 Author: gavin Date: Thu Jan 27 23:07:23 2011 New Revision: 217995 URL: http://svn.freebsd.org/changeset/base/217995 Log: Merge r217264 from head: Remove a bullet point that appears to have been accidentally inserted twice. It has also been included within the feature lists to which it is relevant. PR: tobez Modified: stable/7/share/man/man3/queue.3 Directory Properties: stable/7/share/man/man3/ (props changed) Modified: stable/7/share/man/man3/queue.3 ============================================================================== --- stable/7/share/man/man3/queue.3 Thu Jan 27 23:07:03 2011 (r217994) +++ stable/7/share/man/man3/queue.3 Thu Jan 27 23:07:23 2011 (r217995) @@ -186,7 +186,6 @@ O(1) removal of an entry from the head o Forward traversal through the list. .El .Pp -O(n) removal of any entry in the list. Singly-linked lists are the simplest of the four data structures and support only the above functionality. Singly-linked lists are ideal for applications with large datasets From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 23:08:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE98E1065670; Thu, 27 Jan 2011 23:08:20 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DDF988FC17; Thu, 27 Jan 2011 23:08:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RN8K1t042575; Thu, 27 Jan 2011 23:08:20 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RN8Krm042574; Thu, 27 Jan 2011 23:08:20 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101272308.p0RN8Krm042574@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 27 Jan 2011 23:08:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217996 - head/tools/regression/bin/sh/builtins X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:08:21 -0000 Author: jilles Date: Thu Jan 27 23:08:20 2011 New Revision: 217996 URL: http://svn.freebsd.org/changeset/base/217996 Log: sh: Add test for EXIT trap in command substitution. This is not really realistic but is an opposition to $(trap). Added: head/tools/regression/bin/sh/builtins/trap7.0 (contents, props changed) Added: head/tools/regression/bin/sh/builtins/trap7.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/trap7.0 Thu Jan 27 23:08:20 2011 (r217996) @@ -0,0 +1,3 @@ +# $FreeBSD$ + +[ "$(trap 'echo trapped' EXIT)" = trapped ] From owner-svn-src-all@FreeBSD.ORG Thu Jan 27 23:16:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D5CA0106566B; Thu, 27 Jan 2011 23:16:41 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C42778FC14; Thu, 27 Jan 2011 23:16:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0RNGfYa043142; Thu, 27 Jan 2011 23:16:41 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0RNGfZf043139; Thu, 27 Jan 2011 23:16:41 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201101272316.p0RNGfZf043139@svn.freebsd.org> From: Gavin Atkinson Date: Thu, 27 Jan 2011 23:16:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r217997 - in stable/8/sys/dev/usb: . serial X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Jan 2011 23:16:41 -0000 Author: gavin Date: Thu Jan 27 23:16:41 2011 New Revision: 217997 URL: http://svn.freebsd.org/changeset/base/217997 Log: Merge r217200 from head: Sync the list of devices supported by uslcom(4) with Linux, bringing in all new devices added between our r211022 and their git revision 93ad03d60b5b18897030038234aa2ebae8234748 Also correct a Foxconn entry. Modified: stable/8/sys/dev/usb/serial/uslcom.c stable/8/sys/dev/usb/usbdevs Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/usb/serial/uslcom.c ============================================================================== --- stable/8/sys/dev/usb/serial/uslcom.c Thu Jan 27 23:08:20 2011 (r217996) +++ stable/8/sys/dev/usb/serial/uslcom.c Thu Jan 27 23:16:41 2011 (r217997) @@ -186,6 +186,7 @@ static const struct usb_device_id uslcom USLCOM_DEV(DYNASTREAM, ANT2USB), USLCOM_DEV(ELV, USBI2C), USLCOM_DEV(FOXCONN, PIRELLI_DP_L10), + USLCOM_DEV(FOXCONN, TCOM_TC_300), USLCOM_DEV(GEMALTO, PROXPU), USLCOM_DEV(JABLOTRON, PC60B), USLCOM_DEV(MEI, CASHFLOW_SC), @@ -194,6 +195,7 @@ static const struct usb_device_id uslcom USLCOM_DEV(OWEN, AC4), USLCOM_DEV(PHILIPS, ACE1001), USLCOM_DEV(PLX, CA42), + USLCOM_DEV(RENESAS, RX610), USLCOM_DEV(SILABS, AEROCOMM), USLCOM_DEV(SILABS, AMBER_AMB2560), USLCOM_DEV(SILABS, ARGUSISP), @@ -201,6 +203,8 @@ static const struct usb_device_id uslcom USLCOM_DEV(SILABS, ARKHAM_DS101_M), USLCOM_DEV(SILABS, ARYGON_MIFARE), USLCOM_DEV(SILABS, AVIT_USB_TTL), + USLCOM_DEV(SILABS, B_G_H3000), + USLCOM_DEV(SILABS, BALLUFF_RFID), USLCOM_DEV(SILABS, BEI_VCP), USLCOM_DEV(SILABS, BSM7DUSB), USLCOM_DEV(SILABS, BURNSIDE), @@ -248,7 +252,12 @@ static const struct usb_device_id uslcom USLCOM_DEV(SYNTECH, CYPHERLAB100), USLCOM_DEV(USI, MC60), USLCOM_DEV(VAISALA, CABLE), + USLCOM_DEV(WAGO, SERVICECABLE), USLCOM_DEV(WAVESENSE, JAZZ), + USLCOM_DEV(WIENERPLEINBAUS, PL512), + USLCOM_DEV(WIENERPLEINBAUS, RCM), + USLCOM_DEV(WIENERPLEINBAUS, MPOD), + USLCOM_DEV(WIENERPLEINBAUS, CML), #undef USLCOM_DEV }; Modified: stable/8/sys/dev/usb/usbdevs ============================================================================== --- stable/8/sys/dev/usb/usbdevs Thu Jan 27 23:08:20 2011 (r217996) +++ stable/8/sys/dev/usb/usbdevs Thu Jan 27 23:16:41 2011 (r217997) @@ -649,6 +649,7 @@ vendor GLOBALSUN 0x16ab Global Sun Techn vendor ANYDATA 0x16d5 AnyDATA Corporation vendor JABLOTRON 0x16d6 Jablotron vendor CMOTECH 0x16d8 C-motech +vendor WIENERPLEINBAUS 0x16dc WIENER Plein & Baus GmbH. vendor AXESSTEL 0x1726 Axesstel Co., Ltd. vendor LINKSYS4 0x1737 Linksys vendor SENAO 0x1740 Senao @@ -668,6 +669,7 @@ vendor STELERA 0x1a8d Stelera Wireless vendor MATRIXORBITAL 0x1b3d Matrix Orbital vendor OVISLINK 0x1b75 OvisLink vendor TCTMOBILE 0x1bbb TCT Mobile +vendor WAGO 0x1be3 WAGO Kontakttechnik GmbH. vendor TELIT 0x1bc7 Telit vendor LONGCHEER 0x1c9e Longcheer Holdings, Ltd. vendor MPMAN 0x1cae MpMan @@ -1574,7 +1576,8 @@ product FIBERLINE WL430U 0x6003 WL-430U product FOSSIL WRISTPDA 0x0002 Wrist PDA /* Foxconn products */ -product FOXCONN PIRELLI_DP_L10 0xe000 Pirelli DP-L10 +product FOXCONN TCOM_TC_300 0xe000 T-Com TC 300 +product FOXCONN PIRELLI_DP_L10 0xe003 Pirelli DP-L10 /* Freecom products */ product FREECOM DVD 0xfc01 DVD drive @@ -2757,6 +2760,9 @@ product REALTEK RTL8187B_0 0x8189 RTL818 product REALTEK RTL8187B_1 0x8197 RTL8187B Wireless Adapter product REALTEK RTL8187B_2 0x8198 RTL8187B Wireless Adapter +/* Renesas products */ +product RENESAS RX610 0x0053 RX610 RX-Stick + /* Ricoh products */ product RICOH VGPVCC2 0x1830 VGP-VCC2 Camera product RICOH VGPVCC3 0x1832 VGP-VCC3 Camera @@ -2973,6 +2979,7 @@ product SILABS TAMSMASTER 0x813f Tams Ma product SILABS WMRBATT 0x814a WMR RIGblaster Plug&Play product SILABS WMRRIGBLASTER 0x814a WMR RIGblaster Plug&Play product SILABS WMRRIGTALK 0x814b WMR RIGtalk RT1 +product SILABS B_G_H3000 0x8156 B&G H3000 Data Cable product SILABS HELICOM 0x815e Helicomm IP-Link 1220-DVM product SILABS AVIT_USB_TTL 0x818b AVIT Research USB-TTL product SILABS MJS_TOSLINK 0x819f MJS USB-TOSLINk @@ -2994,6 +3001,7 @@ product SILABS CYGNAL 0x8382 Cygnal product SILABS AMBER_AMB2560 0x83a8 Amber Wireless AMB2560 product SILABS KYOCERA_GPS 0x8411 Kyocera GPS product SILABS BEI_VCP 0x846e BEI USB Sensor (VCP) +product SILABS BALLUFF_RFID 0x8477 Balluff RFID reader product SILABS CP2102 0xea60 SILABS USB UART product SILABS CP210X_2 0xea61 CP210x Serial product SILABS INFINITY_MIC 0xea71 Infinity GPS-MIC-1 Radio Monophone @@ -3327,6 +3335,9 @@ product WACOM GRAPHIRE3_4X5 0x0013 Graph product WACOM INTUOSA5 0x0021 Intuos A5 product WACOM GD0912U 0x0022 Intuos 9x12 Graphics Tablet +/* WAGO Kontakttechnik GmbH products */ +product WAGO SERVICECABLE 0x07a6 USB Service Cable 750-923 + /* WaveSense products */ product WAVESENSE JAZZ 0xaaaa Jazz blood glucose meter @@ -3341,6 +3352,12 @@ product WESTERN HUB 0x0500 USB HUB product WESTERN MYBOOK 0x0901 MyBook External HDD product WESTERN MYPASSWORD 0x0704 MyPassword External HDD +/* WIENER Plein & Baus GmbH products */ +product WIENERPLEINBAUS PL512 0x0010 PL512 PSU +product WIENERPLEINBAUS RCM 0x0011 RCM Remote Control +product WIENERPLEINBAUS MPOD 0x0012 MPOD PSU +product WIENERPLEINBAUS CML 0x0015 CML Data Logger + /* Windbond Electronics */ product WINBOND UH104 0x5518 4-port USB Hub From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 00:22:04 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5569D106566C; Fri, 28 Jan 2011 00:22:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 442568FC1D; Fri, 28 Jan 2011 00:22:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S0M4MT046694; Fri, 28 Jan 2011 00:22:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S0M4IV046692; Fri, 28 Jan 2011 00:22:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101280022.p0S0M4IV046692@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 28 Jan 2011 00:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218000 - stable/8/sys/dev/uart X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 00:22:04 -0000 Author: marcel Date: Fri Jan 28 00:22:03 2011 New Revision: 218000 URL: http://svn.freebsd.org/changeset/base/218000 Log: In uart_tty_outwakeup(), check CTS/RTS flow control settings and prevent sending data when CTS is de-asserted. In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal changed, knowing that uart_tty_outwakeup() will do the right thing for flow control. This avoids redundant conditionals. PR: kern/148644 Submitted by: John Wehle Modified: stable/8/sys/dev/uart/uart_tty.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/uart/uart_tty.c ============================================================================== --- stable/8/sys/dev/uart/uart_tty.c Thu Jan 27 23:28:00 2011 (r217999) +++ stable/8/sys/dev/uart/uart_tty.c Fri Jan 28 00:22:03 2011 (r218000) @@ -169,6 +169,14 @@ uart_tty_outwakeup(struct tty *tp) if (sc->sc_txbusy) return; + /* + * Respect RTS/CTS (output) flow control if enabled and not already + * handled by hardware. + */ + if ((tp->t_termios.c_cflag & CCTS_OFLOW) && !sc->sc_hwoflow && + !(sc->sc_hwsig & SER_CTS)) + return; + sc->sc_txdatasz = ttydisc_getc(tp, sc->sc_txbuf, sc->sc_txfifosz); if (sc->sc_txdatasz != 0) UART_TRANSMIT(sc); @@ -316,11 +324,8 @@ uart_tty_intr(void *arg) sig = pend & SER_INT_SIGMASK; if (sig & SER_DDCD) ttydisc_modem(tp, sig & SER_DCD); - if ((sig & SER_DCTS) && (tp->t_termios.c_cflag & CCTS_OFLOW) && - !sc->sc_hwoflow) { - if (sig & SER_CTS) - uart_tty_outwakeup(tp); - } + if (sig & SER_DCTS) + uart_tty_outwakeup(tp); } if (pend & SER_INT_TXIDLE) From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 05:42:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 61538106566B; Fri, 28 Jan 2011 05:42:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 50FB88FC0C; Fri, 28 Jan 2011 05:42:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S5gFmF058250; Fri, 28 Jan 2011 05:42:15 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S5gFvG058248; Fri, 28 Jan 2011 05:42:15 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101280542.p0S5gFvG058248@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 28 Jan 2011 05:42:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218005 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 05:42:15 -0000 Author: dchagin Date: Fri Jan 28 05:42:14 2011 New Revision: 218005 URL: http://svn.freebsd.org/changeset/base/218005 Log: Style(9) fix. MFC after: 1 month. Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jan 28 02:12:43 2011 (r218004) +++ head/sys/compat/linux/linux_misc.c Fri Jan 28 05:42:14 2011 (r218005) @@ -886,7 +886,7 @@ linux_waitpid(struct thread *td, struct return copyout(&tmpstat, args->status, sizeof(int)); } - return 0; + return (0); } int From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 06:12:59 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79E62106564A; Fri, 28 Jan 2011 06:12:59 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68D378FC13; Fri, 28 Jan 2011 06:12:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S6Cxcl059864; Fri, 28 Jan 2011 06:12:59 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S6CxVW059861; Fri, 28 Jan 2011 06:12:59 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101280612.p0S6CxVW059861@svn.freebsd.org> From: "Jayachandran C." Date: Fri, 28 Jan 2011 06:12:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218007 - in head/sys/cddl/compat/opensolaris: kern sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 06:12:59 -0000 Author: jchandra Date: Fri Jan 28 06:12:59 2011 New Revision: 218007 URL: http://svn.freebsd.org/changeset/base/218007 Log: CDDL fixes for MIPS n32. Provide 64 bit atomic ops, and use 32 bit pointer. Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c head/sys/cddl/compat/opensolaris/sys/atomic.h Modified: head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c ============================================================================== --- head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Fri Jan 28 05:52:02 2011 (r218006) +++ head/sys/cddl/compat/opensolaris/kern/opensolaris_atomic.c Fri Jan 28 06:12:59 2011 (r218007) @@ -52,7 +52,7 @@ atomic_init(void) } #endif -#ifndef __LP64__ +#if !defined(__LP64__) && !defined(__mips_n32) void atomic_add_64(volatile uint64_t *target, int64_t delta) { Modified: head/sys/cddl/compat/opensolaris/sys/atomic.h ============================================================================== --- head/sys/cddl/compat/opensolaris/sys/atomic.h Fri Jan 28 05:52:02 2011 (r218006) +++ head/sys/cddl/compat/opensolaris/sys/atomic.h Fri Jan 28 06:12:59 2011 (r218007) @@ -36,9 +36,11 @@ atomic_cmpset_ptr((volatile uintptr_t *)(_a), (uintptr_t)(_b), (uintptr_t) (_c)) #define cas32 atomic_cmpset_32 -#ifndef __LP64__ +#if !defined(__LP64__) && !defined(__mips_n32) extern void atomic_add_64(volatile uint64_t *target, int64_t delta); extern void atomic_dec_64(volatile uint64_t *target); +#endif +#ifndef __LP64__ extern void *atomic_cas_ptr(volatile void *target, void *cmp, void *newval); #endif #ifndef __sparc64__ @@ -84,7 +86,7 @@ atomic_dec_32_nv(volatile uint32_t *targ return (atomic_fetchadd_32(target, -1) - 1); } -#ifdef __LP64__ +#if defined(__LP64__) || defined(__mips_n32) static __inline void atomic_dec_64(volatile uint64_t *target) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 07:04:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE4F8106566C; Fri, 28 Jan 2011 07:04:02 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD1D78FC1C; Fri, 28 Jan 2011 07:04:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S742DR061825; Fri, 28 Jan 2011 07:04:02 GMT (envelope-from remko@svn.freebsd.org) Received: (from remko@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S742WM061823; Fri, 28 Jan 2011 07:04:02 GMT (envelope-from remko@svn.freebsd.org) Message-Id: <201101280704.p0S742WM061823@svn.freebsd.org> From: Remko Lodder Date: Fri, 28 Jan 2011 07:04:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218009 - stable/7/sbin/newfs_msdos X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 07:04:02 -0000 Author: remko Date: Fri Jan 28 07:04:01 2011 New Revision: 218009 URL: http://svn.freebsd.org/changeset/base/218009 Log: MFC r174460,174478 Add information about the maximum file size for msdosfs. PR: docs/112935 Submitted by: Julian Stacey Actually this was inspired by the ticket submitted by Julian. MFC After: 3 days PR: docs/112935 Modified: stable/7/sbin/newfs_msdos/newfs_msdos.8 Directory Properties: stable/7/sbin/newfs_msdos/ (props changed) Modified: stable/7/sbin/newfs_msdos/newfs_msdos.8 ============================================================================== --- stable/7/sbin/newfs_msdos/newfs_msdos.8 Fri Jan 28 06:58:14 2011 (r218008) +++ stable/7/sbin/newfs_msdos/newfs_msdos.8 Fri Jan 28 07:04:01 2011 (r218009) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 6, 1998 +.Dd December 8, 2007 .Dt NEWFS_MSDOS 8 .Os .Sh NAME @@ -162,6 +162,9 @@ struct bsxbpb { u_int16_t bkbs; /* [-k] backup boot sector */ }; .Ed +.Sh LIMITATION +The maximum file size is 4GB, even if the file system itself is bigger. +.Ed .Sh EXIT STATUS Exit status is 0 on success and 1 on error. .Sh EXAMPLES From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 08:00:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1105D106566B; Fri, 28 Jan 2011 08:00:58 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 008338FC12; Fri, 28 Jan 2011 08:00:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S80vK4064970; Fri, 28 Jan 2011 08:00:57 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S80vtb064968; Fri, 28 Jan 2011 08:00:57 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201101280800.p0S80vtb064968@svn.freebsd.org> From: Hans Petter Selasky Date: Fri, 28 Jan 2011 08:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218010 - head/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 08:00:58 -0000 Author: hselasky Date: Fri Jan 28 08:00:57 2011 New Revision: 218010 URL: http://svn.freebsd.org/changeset/base/218010 Log: - Remove double semicolon. - Remove reference to sprintf. Use printf directly. This part of the code should be optimised further to avoid many small printouts. Setting a sensible line buffer length could help aswell when printing out megabytes of data per second. Approved by: thompsa (mentor) Modified: head/usr.sbin/usbdump/usbdump.c Modified: head/usr.sbin/usbdump/usbdump.c ============================================================================== --- head/usr.sbin/usbdump/usbdump.c Fri Jan 28 07:04:01 2011 (r218009) +++ head/usr.sbin/usbdump/usbdump.c Fri Jan 28 08:00:57 2011 (r218010) @@ -72,7 +72,7 @@ struct usbcap_filehdr { static int doexit = 0; static int pkt_captured = 0; static int verbose = 0; -static const char *i_arg = "usbus0";; +static const char *i_arg = "usbus0"; static const char *r_arg = NULL; static const char *w_arg = NULL; static const char *errstr_table[USB_ERR_MAX] = { @@ -185,11 +185,10 @@ static void hexdump(const char *region, size_t len) { const char *line; - int x, c; - char lbuf[80]; -#define EMIT(fmt, args...) do { \ - sprintf(lbuf, fmt , ## args); \ - printf("%s", lbuf); \ + int x; + int c; +#define EMIT(fmt, ...) do { \ + printf(fmt,## __VA_ARGS__); \ } while (0) for (line = region; line < (region + len); line += 16) { From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 08:35:56 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E712B106566C; Fri, 28 Jan 2011 08:35:55 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D655B8FC1B; Fri, 28 Jan 2011 08:35:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S8Zt1d066854; Fri, 28 Jan 2011 08:35:55 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S8Zt5C066851; Fri, 28 Jan 2011 08:35:55 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101280835.p0S8Zt5C066851@svn.freebsd.org> From: Adrian Chadd Date: Fri, 28 Jan 2011 08:35:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218011 - head/sys/dev/ath/ath_hal X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 08:35:56 -0000 Author: adrian Date: Fri Jan 28 08:35:55 2011 New Revision: 218011 URL: http://svn.freebsd.org/changeset/base/218011 Log: Bring in some 802.11n packet duration calculation functions from a mix of Sam/Rui and linux ath9k . This will eventually be used by rate control modules and by the TX code for calculating packet duration when handling rts/cts protection. Obtained from: sam@, rpaulo@, linux ath9k Modified: head/sys/dev/ath/ath_hal/ah.c head/sys/dev/ath/ath_hal/ah.h Modified: head/sys/dev/ath/ath_hal/ah.c ============================================================================== --- head/sys/dev/ath/ath_hal/ah.c Fri Jan 28 08:00:57 2011 (r218010) +++ head/sys/dev/ath/ath_hal/ah.c Fri Jan 28 08:35:55 2011 (r218011) @@ -234,6 +234,78 @@ ath_hal_reverseBits(uint32_t val, uint32 return retval; } +/* 802.11n related timing definitions */ + +#define OFDM_PLCP_BITS 22 +#define HT_L_STF 8 +#define HT_L_LTF 8 +#define HT_L_SIG 4 +#define HT_SIG 8 +#define HT_STF 4 +#define HT_LTF(n) ((n) * 4) + +#define HT_RC_2_MCS(_rc) ((_rc) & 0xf) +#define HT_RC_2_STREAMS(_rc) ((((_rc) & 0x78) >> 3) + 1) +#define IS_HT_RATE(_rc) ( (_rc) & IEEE80211_RATE_MCS) + +/* + * Calculate the duration of a packet whether it is 11n or legacy. + */ +uint32_t +ath_hal_pkt_txtime(struct ath_hal *ah, const HAL_RATE_TABLE *rates, uint32_t frameLen, + uint16_t rateix, HAL_BOOL isht40, HAL_BOOL shortPreamble) +{ + uint8_t rc; + int numStreams; + + rc = rates->info[rateix].rateCode; + + /* Legacy rate? Return the old way */ + if (! IS_HT_RATE(rc)) + return ath_hal_computetxtime(ah, rates, frameLen, rateix, shortPreamble); + + /* 11n frame - extract out the number of spatial streams */ + numStreams = HT_RC_2_STREAMS(rc); + KASSERT(numStreams == 1 || numStreams == 2, ("number of spatial streams needs to be 1 or 2: MCS rate 0x%x!", rateix)); + + return ath_computedur_ht(frameLen, rc, numStreams, isht40, shortPreamble); +} + +/* + * Calculate the transmit duration of an 11n frame. + * This only works for MCS0->MCS15. + */ +uint32_t +ath_computedur_ht(uint32_t frameLen, uint16_t rate, int streams, HAL_BOOL isht40, + HAL_BOOL isShortGI) +{ + static const uint16_t ht20_bps[16] = { + 26, 52, 78, 104, 156, 208, 234, 260, + 52, 104, 156, 208, 312, 416, 468, 520 + }; + static const uint16_t ht40_bps[16] = { + 54, 108, 162, 216, 324, 432, 486, 540, + 108, 216, 324, 432, 648, 864, 972, 1080, + }; + uint32_t bitsPerSymbol, numBits, numSymbols, txTime; + + KASSERT(rate & IEEE80211_RATE_MCS, ("not mcs %d", rate)); + KASSERT((rate &~ IEEE80211_RATE_MCS) < 16, ("bad mcs 0x%x", rate)); + + if (isht40) + bitsPerSymbol = ht40_bps[rate & 0xf]; + else + bitsPerSymbol = ht20_bps[rate & 0xf]; + numBits = OFDM_PLCP_BITS + (frameLen << 3); + numSymbols = howmany(numBits, bitsPerSymbol); + if (isShortGI) + txTime = ((numSymbols * 18) + 4) / 5; /* 3.6us */ + else + txTime = numSymbols * 4; /* 4us */ + return txTime + HT_L_STF + HT_L_LTF + + HT_L_SIG + HT_SIG + HT_STF + HT_LTF(streams); +} + /* * Compute the time to transmit a frame of length frameLen bytes * using the specified rate, phy, and short preamble setting. Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Fri Jan 28 08:00:57 2011 (r218010) +++ head/sys/dev/ath/ath_hal/ah.h Fri Jan 28 08:35:55 2011 (r218011) @@ -882,7 +882,20 @@ extern void __ahdecl ath_hal_process_noi extern u_int __ahdecl ath_hal_getwirelessmodes(struct ath_hal*); /* - * Calculate the transmit duration of a frame. + * Calculate the packet TX time for a legacy or 11n frame + */ +extern uint32_t __ahdecl ath_hal_pkt_txtime(struct ath_hal *ah, + const HAL_RATE_TABLE *rates, uint32_t frameLen, + uint16_t rateix, HAL_BOOL isht40, HAL_BOOL shortPreamble); + +/* + * Calculate the duration of an 11n frame. + */ +extern uint32_t __ahdecl ath_computedur_ht(uint32_t frameLen, uint16_t rate, + int streams, HAL_BOOL isht40, HAL_BOOL isShortGI); + +/* + * Calculate the transmit duration of a legacy frame. */ extern uint16_t __ahdecl ath_hal_computetxtime(struct ath_hal *, const HAL_RATE_TABLE *rates, uint32_t frameLen, From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 08:45:19 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0FEF106564A; Fri, 28 Jan 2011 08:45:19 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D0BF28FC0A; Fri, 28 Jan 2011 08:45:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S8jJYO067420; Fri, 28 Jan 2011 08:45:19 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S8jJhP067418; Fri, 28 Jan 2011 08:45:19 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101280845.p0S8jJhP067418@svn.freebsd.org> From: Adrian Chadd Date: Fri, 28 Jan 2011 08:45:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218012 - head/sys/dev/ath/ath_hal/ar5212 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 08:45:20 -0000 Author: adrian Date: Fri Jan 28 08:45:19 2011 New Revision: 218012 URL: http://svn.freebsd.org/changeset/base/218012 Log: Make space for the extended 802.11n MCS rate tables. Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 28 08:35:55 2011 (r218011) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212.h Fri Jan 28 08:45:19 2011 (r218012) @@ -326,7 +326,7 @@ struct ath_hal_5212 { */ uint16_t *ah_pcdacTable; u_int ah_pcdacTableSize; - uint16_t ah_ratesArray[16]; + uint16_t ah_ratesArray[37]; uint8_t ah_txTrigLev; /* current Tx trigger level */ uint8_t ah_maxTxTrigLev; /* max tx trigger level */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 08:57:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4BEFB106566B; Fri, 28 Jan 2011 08:57:58 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 39B548FC0C; Fri, 28 Jan 2011 08:57:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S8vweN068255; Fri, 28 Jan 2011 08:57:58 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S8vwLn068252; Fri, 28 Jan 2011 08:57:58 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101280857.p0S8vwLn068252@svn.freebsd.org> From: Adrian Chadd Date: Fri, 28 Jan 2011 08:57:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218013 - head/sys/dev/ath/ath_rate/sample X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 08:57:58 -0000 Author: adrian Date: Fri Jan 28 08:57:58 2011 New Revision: 218013 URL: http://svn.freebsd.org/changeset/base/218013 Log: (Mostly) teach ath_rate_sample about MCS rates. This is just the bare minimum needed to teach ath_rate_sample to try and handle MCS rates. It doesn't at all attempt to find the best rate by any means - it doesn't know anything about the MCS rate relations, TX aggregation or any of the much sexier 11n stuff that's out there. It's just enough to transmit 11n frames and handle TX completion. It shouldn't affect legacy (11abg) behaviour. Obtained from: rpaulo@ Added: head/sys/dev/ath/ath_rate/sample/tx_schedules.h (contents, props changed) Modified: head/sys/dev/ath/ath_rate/sample/sample.c Modified: head/sys/dev/ath/ath_rate/sample/sample.c ============================================================================== --- head/sys/dev/ath/ath_rate/sample/sample.c Fri Jan 28 08:45:19 2011 (r218012) +++ head/sys/dev/ath/ath_rate/sample/sample.c Fri Jan 28 08:57:58 2011 (r218013) @@ -75,6 +75,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include /* * This file is an implementation of the SampleRate algorithm @@ -142,6 +143,13 @@ ath_rate_node_cleanup(struct ath_softc * { } +static int +dot11rate(const HAL_RATE_TABLE *rt, int rix) +{ + return rt->info[rix].phy == IEEE80211_T_HT ? + rt->info[rix].dot11Rate : (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL) / 2; +} + /* * Return the rix with the lowest average_tx_time, * or -1 if all the average_tx_times are 0. @@ -186,6 +194,7 @@ pick_sample_rate(struct sample_softc *ss const HAL_RATE_TABLE *rt, int size_bin) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) +#define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) int current_rix, rix; unsigned current_tt; uint32_t mask; @@ -232,6 +241,7 @@ pick_sample_rate(struct sample_softc *ss } return current_rix; #undef DOT11RATE +#undef MCS } void @@ -240,6 +250,7 @@ ath_rate_findrate(struct ath_softc *sc, u_int8_t *rix0, int *try0, u_int8_t *txrate) { #define DOT11RATE(ix) (rt->info[ix].dot11Rate & IEEE80211_RATE_VAL) +#define MCS(ix) (rt->info[ix].dot11Rate | IEEE80211_RATE_MCS) #define RATE(ix) (DOT11RATE(ix) / 2) struct sample_node *sn = ATH_NODE_SAMPLE(an); struct sample_softc *ssc = ATH_SOFTC_SAMPLE(sc); @@ -334,7 +345,7 @@ ath_rate_findrate(struct ath_softc *sc, /* * Set the visible txrate for this node. */ - an->an_node.ni_txrate = DOT11RATE(best_rix); + an->an_node.ni_txrate = (rt->info[best_rix].phy == IEEE80211_T_HT) ? MCS(best_rix) : DOT11RATE(best_rix); } rix = sn->current_rix[size_bin]; sn->packets_since_switch[size_bin]++; @@ -348,81 +359,10 @@ done: | (shortPreamble ? rt->info[rix].shortPreamble : 0); sn->packets_sent[size_bin]++; #undef DOT11RATE +#undef MCS #undef RATE } -#define A(_r) \ - (((_r) == 6) ? 0 : (((_r) == 9) ? 1 : (((_r) == 12) ? 2 : \ - (((_r) == 18) ? 3 : (((_r) == 24) ? 4 : (((_r) == 36) ? 5 : \ - (((_r) == 48) ? 6 : (((_r) == 54) ? 7 : 0)))))))) -static const struct txschedule series_11a[] = { - { 3,A( 6), 3,A( 6), 0,A( 6), 0,A( 6) }, /* 6Mb/s */ - { 4,A( 9), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 9Mb/s */ - { 4,A(12), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 12Mb/s */ - { 4,A(18), 3,A( 12), 4,A( 6), 2,A( 6) }, /* 18Mb/s */ - { 4,A(24), 3,A( 18), 4,A( 12), 2,A( 6) }, /* 24Mb/s */ - { 4,A(36), 3,A( 24), 4,A( 18), 2,A( 6) }, /* 36Mb/s */ - { 4,A(48), 3,A( 36), 4,A( 24), 2,A(12) }, /* 48Mb/s */ - { 4,A(54), 3,A( 48), 4,A( 36), 2,A(24) } /* 54Mb/s */ -}; -#undef A - -#define G(_r) \ - (((_r) == 1) ? 0 : (((_r) == 2) ? 1 : (((_r) == 5.5) ? 2 : \ - (((_r) == 11) ? 3 : (((_r) == 6) ? 4 : (((_r) == 9) ? 5 : \ - (((_r) == 12) ? 6 : (((_r) == 18) ? 7 : (((_r) == 24) ? 8 : \ - (((_r) == 36) ? 9 : (((_r) == 48) ? 10 : (((_r) == 54) ? 11 : 0)))))))))))) -static const struct txschedule series_11g[] = { - { 3,G( 1), 3,G( 1), 0,G( 1), 0,G( 1) }, /* 1Mb/s */ - { 4,G( 2), 3,G( 1), 4,G( 1), 0,G( 1) }, /* 2Mb/s */ - { 4,G(5.5),3,G( 2), 4,G( 1), 2,G( 1) }, /* 5.5Mb/s */ - { 4,G(11), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 11Mb/s */ - { 4,G( 6), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 6Mb/s */ - { 4,G( 9), 3,G( 6), 4,G(5.5), 2,G( 1) }, /* 9Mb/s */ - { 4,G(12), 3,G( 11), 4,G(5.5), 2,G( 1) }, /* 12Mb/s */ - { 4,G(18), 3,G( 12), 4,G( 11), 2,G( 1) }, /* 18Mb/s */ - { 4,G(24), 3,G( 18), 4,G( 12), 2,G( 1) }, /* 24Mb/s */ - { 4,G(36), 3,G( 24), 4,G( 18), 2,G( 1) }, /* 36Mb/s */ - { 4,G(48), 3,G( 36), 4,G( 24), 2,G( 1) }, /* 48Mb/s */ - { 4,G(54), 3,G( 48), 4,G( 36), 2,G( 1) } /* 54Mb/s */ -}; -#undef G - -#define H(_r) \ - (((_r) == 3) ? 0 : (((_r) == 4.5) ? 1 : (((_r) == 6) ? 2 : \ - (((_r) == 9) ? 3 : (((_r) == 12) ? 4 : (((_r) == 18) ? 5 : \ - (((_r) == 24) ? 6 : (((_r) == 27) ? 7 : 0)))))))) -static const struct txschedule series_half[] = { - { 3,H( 3), 3,H( 3), 0,H( 3), 0,H( 3) }, /* 3Mb/s */ - { 4,H(4.5),3,H( 3), 4,H( 3), 0,H( 3) }, /* 4.5Mb/s */ - { 4,H( 6), 3,H( 3), 4,H( 3), 0,H( 3) }, /* 6Mb/s */ - { 4,H( 9), 3,H( 6), 4,H( 3), 2,H( 3) }, /* 9Mb/s */ - { 4,H(12), 3,H( 9), 4,H( 6), 2,H( 3) }, /* 12Mb/s */ - { 4,H(18), 3,H( 12), 4,H( 9), 2,H( 3) }, /* 18Mb/s */ - { 4,H(24), 3,H( 18), 4,H( 12), 2,H( 6) }, /* 24Mb/s */ - { 4,H(27), 3,H( 24), 4,H( 18), 2,H(12) } /* 27Mb/s */ -}; -#undef H - -#ifdef Q -#undef Q /* sun4v bogosity */ -#endif -#define Q(_r) \ - (((_r) == 1.5) ? 0 : (((_r) ==2.25) ? 1 : (((_r) == 3) ? 2 : \ - (((_r) == 4.5) ? 3 : (((_r) == 6) ? 4 : (((_r) == 9) ? 5 : \ - (((_r) == 12) ? 6 : (((_r) == 13.5)? 7 : 0)))))))) -static const struct txschedule series_quarter[] = { - { 3,Q( 1.5),3,Q(1.5), 0,Q(1.5), 0,Q(1.5) }, /* 1.5Mb/s */ - { 4,Q(2.25),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) }, /*2.25Mb/s */ - { 4,Q( 3),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) }, /* 3Mb/s */ - { 4,Q( 4.5),3,Q( 3), 4,Q(1.5), 2,Q(1.5) }, /* 4.5Mb/s */ - { 4,Q( 6),3,Q(4.5), 4,Q( 3), 2,Q(1.5) }, /* 6Mb/s */ - { 4,Q( 9),3,Q( 6), 4,Q(4.5), 2,Q(1.5) }, /* 9Mb/s */ - { 4,Q( 12),3,Q( 9), 4,Q( 6), 2,Q( 3) }, /* 12Mb/s */ - { 4,Q(13.5),3,Q( 12), 4,Q( 9), 2,Q( 6) } /*13.5Mb/s */ -}; -#undef Q - void ath_rate_setupxtxdesc(struct ath_softc *sc, struct ath_node *an, struct ath_desc *ds, int shortPreamble, u_int8_t rix) @@ -592,7 +532,7 @@ ath_rate_tx_complete(struct ath_softc *s __func__, bin_to_size(size_to_bin(frame_size)), ts->ts_status ? "FAIL" : "OK", - final_rix, short_tries, long_tries); + dot11rate(rt, final_rix), short_tries, long_tries); update_stats(sc, an, frame_size, final_rix, long_tries, 0, 0, @@ -608,8 +548,10 @@ ath_rate_tx_complete(struct ath_softc *s * Process intermediate rates that failed. */ ath_hal_gettxcompletionrates(sc->sc_ah, ds0, hwrates, tries); - for (i = 0; i < 4; i++) + + for (i = 0; i < 4; i++) { rix[i] = rt->rateCodeToIndex[hwrates[i]]; + } IEEE80211_NOTE(an->an_node.ni_vap, IEEE80211_MSG_RATECTL, &an->an_node, @@ -619,19 +561,15 @@ ath_rate_tx_complete(struct ath_softc *s finalTSIdx, long_tries, ts->ts_status ? "FAIL" : "OK", - rix[0], tries[0], - rix[1], tries[1], - rix[2], tries[2], - rix[3], tries[3]); - - if (tries[0] && !IS_RATE_DEFINED(sn, rix[0])) - badrate(ifp, 0, hwrates[0], tries[0], ts->ts_status); - if (tries[1] && !IS_RATE_DEFINED(sn, rix[1])) - badrate(ifp, 1, hwrates[1], tries[1], ts->ts_status); - if (tries[2] && !IS_RATE_DEFINED(sn, rix[2])) - badrate(ifp, 2, hwrates[2], tries[2], ts->ts_status); - if (tries[3] && !IS_RATE_DEFINED(sn, rix[3])) - badrate(ifp, 3, hwrates[3], tries[3], ts->ts_status); + dot11rate(rt, rix[0]), tries[0], + dot11rate(rt, rix[1]), tries[1], + dot11rate(rt, rix[2]), tries[2], + dot11rate(rt, rix[3]), tries[3]); + + for (i = 0; i < 4; i++) { + if (tries[i] && !IS_RATE_DEFINED(sn, rix[i])) + badrate(ifp, 0, hwrates[i], tries[i], ts->ts_status); + } /* * NB: series > 0 are not penalized for failure @@ -675,7 +613,7 @@ ath_rate_tx_complete(struct ath_softc *s if (tries[3] && finalTSIdx > 2) { update_stats(sc, an, frame_size, - rix[3], tries[3], + rix[3], tries[3], 0, 0, 0, 0, 0, 0, @@ -701,8 +639,8 @@ static const struct txschedule *mrr_sche series_11a, /* IEEE80211_MODE_TURBO_A */ series_11g, /* IEEE80211_MODE_TURBO_G */ series_11a, /* IEEE80211_MODE_STURBO_A */ - series_11a, /* IEEE80211_MODE_11NA */ - series_11g, /* IEEE80211_MODE_11NG */ + series_11na, /* IEEE80211_MODE_11NA */ + series_11ng, /* IEEE80211_MODE_11NG */ series_half, /* IEEE80211_MODE_HALF */ series_quarter, /* IEEE80211_MODE_QUARTER */ }; @@ -715,6 +653,8 @@ ath_rate_ctl_reset(struct ath_softc *sc, { #define RATE(_ix) (ni->ni_rates.rs_rates[(_ix)] & IEEE80211_RATE_VAL) #define DOT11RATE(_ix) (rt->info[(_ix)].dot11Rate & IEEE80211_RATE_VAL) +#define MCS(_ix) (ni->ni_htrates.rs_rates[_ix] | IEEE80211_RATE_MCS) + struct ath_node *an = ATH_NODE(ni); const struct ieee80211_txparam *tp = ni->ni_txparms; struct sample_node *sn = ATH_NODE_SAMPLE(an); @@ -737,8 +677,11 @@ ath_rate_ctl_reset(struct ath_softc *sc, * negotiated rate set for the node. Note the fixed rate * may not be available for various reasons so we only * setup the static rate index if the lookup is successful. - * XXX handle MCS */ + + /* XXX todo: check MCS rates */ + + /* Check legacy rates */ for (srate = ni->ni_rates.rs_nrates - 1; srate >= 0; srate--) if (RATE(srate) == tp->ucastrate) { sn->static_rix = sc->sc_rixmap[tp->ucastrate]; @@ -761,6 +704,22 @@ ath_rate_ctl_reset(struct ath_softc *sc, * to be ignored for doing rate control. */ sn->ratemask = 0; + /* MCS rates */ + if (ni->ni_flags & IEEE80211_NODE_HT) { + for (x = 0; x < ni->ni_htrates.rs_nrates; x++) { + rix = sc->sc_rixmap[MCS(x)]; + if (rix == 0xff) + continue; + /* skip rates marked broken by hal */ + if (!rt->info[rix].valid) + continue; + KASSERT(rix < SAMPLE_MAXRATES, + ("mcs %u has rix %d", MCS(x), rix)); + sn->ratemask |= 1<ni_rates.rs_nrates; x++) { rix = sc->sc_rixmap[RATE(x)]; if (rix == 0xff) @@ -781,7 +740,7 @@ ath_rate_ctl_reset(struct ath_softc *sc, for (mask = sn->ratemask, rix = 0; mask != 0; mask >>= 1, rix++) { if ((mask & 1) == 0) continue; - printf(" %d/%d", DOT11RATE(rix) / 2, + printf(" %d/%d", dot11rate(rt, rix), calc_usecs_unicast_packet(sc, 1600, rix, 0,0)); } printf("\n"); @@ -866,7 +825,7 @@ sample_stats(void *arg, struct ieee80211 if (sn->stats[y][rix].total_packets == 0) continue; printf("[%2u:%4u] %8d:%-8d (%3d%%) T %8d F %4d avg %5u last %u\n", - (rt->info[rix].dot11Rate & IEEE80211_RATE_VAL)/2, + dot11rate(rt, rix), bin_to_size(y), sn->stats[y][rix].total_packets, sn->stats[y][rix].packets_acked, Added: head/sys/dev/ath/ath_rate/sample/tx_schedules.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/ath_rate/sample/tx_schedules.h Fri Jan 28 08:57:58 2011 (r218013) @@ -0,0 +1,193 @@ +/*- + * Copyright (c) 2005 John Bicket + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + */ +#ifndef __ATH_RATE_SAMPLE_TXSCHEDULES_H__ +#define __ATH_RATE_SAMPLE_TXSCHEDULES_H__ + +#include +__FBSDID("$FreeBSD$"); + +#define A(_r) \ + (((_r) == 6) ? 0 : (((_r) == 9) ? 1 : (((_r) == 12) ? 2 : \ + (((_r) == 18) ? 3 : (((_r) == 24) ? 4 : (((_r) == 36) ? 5 : \ + (((_r) == 48) ? 6 : (((_r) == 54) ? 7 : 0)))))))) +static const struct txschedule series_11a[] = { + { 3,A( 6), 3,A( 6), 0,A( 6), 0,A( 6) }, /* 6Mb/s */ + { 4,A( 9), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 9Mb/s */ + { 4,A(12), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 12Mb/s */ + { 4,A(18), 3,A( 12), 4,A( 6), 2,A( 6) }, /* 18Mb/s */ + { 4,A(24), 3,A( 18), 4,A( 12), 2,A( 6) }, /* 24Mb/s */ + { 4,A(36), 3,A( 24), 4,A( 18), 2,A( 6) }, /* 36Mb/s */ + { 4,A(48), 3,A( 36), 4,A( 24), 2,A(12) }, /* 48Mb/s */ + { 4,A(54), 3,A( 48), 4,A( 36), 2,A(24) } /* 54Mb/s */ +}; + +#define NA1(_r) \ + (((_r) == 6.5) ? 8 : (((_r) == 13) ? 9 : (((_r) == 19.5)? 10 : \ + (((_r) == 26) ? 11 : (((_r) == 39) ? 12 : (((_r) == 52) ? 13 : \ + (((_r) == 58.5)? 14 : (((_r) == 65) ? 15 : 0)))))))) +#define NA2(_r) \ + (((_r) == 13) ? 16 : (((_r) == 26) ? 17 : (((_r) == 39) ? 18 : \ + (((_r) == 52) ? 19 : (((_r) == 78) ? 20 : (((_r) == 104)? 21 : \ + (((_r) == 117)? 22 : (((_r) == 130)? 23 : 0)))))))) +static const struct txschedule series_11na[] = { + { 3,A( 6), 3,A( 6), 0,A( 6), 0,A( 6) }, /* 6Mb/s */ + { 4,A( 9), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 9Mb/s */ + { 4,A(12), 3,A( 6), 4,A( 6), 0,A( 6) }, /* 12Mb/s */ + { 4,A(18), 3,A( 12), 4,A( 6), 2,A( 6) }, /* 18Mb/s */ + { 4,A(24), 3,A( 18), 4,A( 12), 2,A( 6) }, /* 24Mb/s */ + { 4,A(36), 3,A( 24), 4,A( 18), 2,A( 6) }, /* 36Mb/s */ + { 4,A(48), 3,A( 36), 4,A( 24), 2,A(12) }, /* 48Mb/s */ + { 4,A(54), 3,A( 48), 4,A( 36), 2,A(24) }, /* 54Mb/s */ + { 3,NA1( 6.5), 3,NA1( 6.5), 0,NA1( 6.5), 0,NA1(6.5) }, /* 6.5Mb/s */ + { 4,NA1( 13), 3,NA1( 6.5), 4,NA1( 6.5), 0,NA1(6.5) }, /* 13Mb/s */ + { 4,NA1(19.5), 3,NA1( 6.5), 4,NA1( 6.5), 0,NA1(6.5) }, /*19.5Mb/s */ + { 4,NA1( 26), 3,NA1(19.5), 4,NA1( 6.5), 2,NA1(6.5) }, /* 26Mb/s */ + { 4,NA1( 39), 3,NA1( 26), 4,NA1(19.5), 2,NA1(6.5) }, /* 39Mb/s */ + { 4,NA1( 52), 3,NA1( 39), 4,NA1( 26), 2,NA1(6.5) }, /* 52Mb/s */ + { 4,NA1(58.5), 3,NA1( 52), 4,NA1( 39), 2,NA1( 13) }, /*58.5Mb/s */ + { 4,NA1( 65), 3,NA1(58.5), 4,NA1( 52), 2,NA1( 13) }, /* 65Mb/s */ + { 3,NA2( 13), 3,NA2( 13), 0,NA2( 13), 0,NA2( 13) }, /* 13Mb/s */ + { 4,NA2( 26), 3,NA2( 13), 4,NA2( 13), 0,NA2( 13) }, /* 26Mb/s */ + { 4,NA2( 39), 3,NA2( 26), 4,NA2( 13), 2,NA2( 13) }, /* 39Mb/s */ + { 4,NA2( 52), 3,NA2( 39), 4,NA2( 26), 2,NA2( 13) }, /* 52Mb/s */ + { 4,NA2( 78), 3,NA2( 52), 4,NA2( 39), 2,NA2( 13) }, /* 78Mb/s */ + { 4,NA2( 104), 3,NA2( 78), 4,NA2( 52), 2,NA2( 13) }, /* 104Mb/s */ + { 4,NA2( 117), 3,NA2( 104), 4,NA2( 78), 2,NA2( 26) }, /* 117Mb/s */ + { 4,NA2( 130), 3,NA2( 117), 4,NA2( 104), 2,NA2( 26) } /* 130Mb/s */ +}; +#undef A +#undef NA2 +#undef NA1 + +#define G(_r) \ + (((_r) == 1) ? 0 : (((_r) == 2) ? 1 : (((_r) == 5.5) ? 2 : \ + (((_r) == 11) ? 3 : (((_r) == 6) ? 4 : (((_r) == 9) ? 5 : \ + (((_r) == 12) ? 6 : (((_r) == 18) ? 7 : (((_r) == 24) ? 8 : \ + (((_r) == 36) ? 9 : (((_r) == 48) ? 10 : (((_r) == 54) ? 11 : 0)))))))))))) +static const struct txschedule series_11g[] = { + { 3,G( 1), 3,G( 1), 0,G( 1), 0,G( 1) }, /* 1Mb/s */ + { 4,G( 2), 3,G( 1), 4,G( 1), 0,G( 1) }, /* 2Mb/s */ + { 4,G(5.5),3,G( 2), 4,G( 1), 2,G( 1) }, /* 5.5Mb/s */ + { 4,G(11), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 11Mb/s */ + { 4,G( 6), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 6Mb/s */ + { 4,G( 9), 3,G( 6), 4,G(5.5), 2,G( 1) }, /* 9Mb/s */ + { 4,G(12), 3,G( 11), 4,G(5.5), 2,G( 1) }, /* 12Mb/s */ + { 4,G(18), 3,G( 12), 4,G( 11), 2,G( 1) }, /* 18Mb/s */ + { 4,G(24), 3,G( 18), 4,G( 12), 2,G( 1) }, /* 24Mb/s */ + { 4,G(36), 3,G( 24), 4,G( 18), 2,G( 1) }, /* 36Mb/s */ + { 4,G(48), 3,G( 36), 4,G( 24), 2,G( 1) }, /* 48Mb/s */ + { 4,G(54), 3,G( 48), 4,G( 36), 2,G( 1) } /* 54Mb/s */ +}; + +#define NG1(_r) \ + (((_r) == 6.5) ? 12 : (((_r) == 13) ? 13 : (((_r) == 19.5)? 14 : \ + (((_r) == 26) ? 15 : (((_r) == 39) ? 16 : (((_r) == 52) ? 17 : \ + (((_r) == 58.5)? 18 : (((_r) == 65) ? 19 : 0)))))))) +#define NG2(_r) \ + (((_r) == 13) ? 20 : (((_r) == 26) ? 21 : (((_r) == 39) ? 22 : \ + (((_r) == 52) ? 23 : (((_r) == 78) ? 24 : (((_r) == 104) ? 25 : \ + (((_r) == 117) ? 26 : (((_r) == 130)? 27 : 0)))))))) +static const struct txschedule series_11ng[] = { + { 3,G( 1), 3,G( 1), 0,G( 1), 0,G( 1) }, /* 1Mb/s */ + { 4,G( 2), 3,G( 1), 4,G( 1), 0,G( 1) }, /* 2Mb/s */ + { 4,G(5.5),3,G( 2), 4,G( 1), 2,G( 1) }, /* 5.5Mb/s */ + { 4,G(11), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 11Mb/s */ + { 4,G( 6), 3,G(5.5), 4,G( 2), 2,G( 1) }, /* 6Mb/s */ + { 4,G( 9), 3,G( 6), 4,G(5.5), 2,G( 1) }, /* 9Mb/s */ + { 4,G(12), 3,G( 11), 4,G(5.5), 2,G( 1) }, /* 12Mb/s */ + { 4,G(18), 3,G( 12), 4,G( 11), 2,G( 1) }, /* 18Mb/s */ + { 4,G(24), 3,G( 18), 4,G( 12), 2,G( 1) }, /* 24Mb/s */ + { 4,G(36), 3,G( 24), 4,G( 18), 2,G( 1) }, /* 36Mb/s */ + { 4,G(48), 3,G( 36), 4,G( 24), 2,G( 1) }, /* 48Mb/s */ + { 4,G(54), 3,G( 48), 4,G( 36), 2,G( 1) }, /* 54Mb/s */ + { 3,NG1( 6.5), 3,NG1( 6.5), 0,NG1( 6.5), 0,NG1(6.5) }, /* 6.5Mb/s */ + { 4,NG1( 13), 3,NG1( 6.5), 4,NG1( 6.5), 0,NG1(6.5) }, /* 13Mb/s */ + { 4,NG1(19.5), 3,NG1( 6.5), 4,NG1( 6.5), 0,NG1(6.5) }, /*19.5Mb/s */ + { 4,NG1( 26), 3,NG1(19.5), 4,NG1( 6.5), 2,NG1(6.5) }, /* 26Mb/s */ + { 4,NG1( 39), 3,NG1( 26), 4,NG1(19.5), 2,NG1(6.5) }, /* 39Mb/s */ + { 4,NG1( 52), 3,NG1( 39), 4,NG1( 26), 2,NG1(6.5) }, /* 52Mb/s */ + { 4,NG1(58.5), 3,NG1( 52), 4,NG1( 39), 2,NG1( 13) }, /*58.5Mb/s */ + { 4,NG1( 65), 3,NG1(58.5), 4,NG1( 52), 2,NG1( 13) }, /* 65Mb/s */ + { 3,NG2( 13), 3,NG2( 13), 0,NG2( 13), 0,NG2( 13) }, /* 13Mb/s */ + { 4,NG2( 26), 3,NG2( 13), 4,NG2( 13), 0,NG2( 13) }, /* 26Mb/s */ + { 4,NG2( 39), 3,NG2( 26), 4,NG2( 13), 2,NG2( 13) }, /* 39Mb/s */ + { 4,NG2( 52), 3,NG2( 39), 4,NG2( 26), 2,NG2( 13) }, /* 52Mb/s */ + { 4,NG2( 78), 3,NG2( 52), 4,NG2( 39), 2,NG2( 13) }, /* 78Mb/s */ + { 4,NG2( 104), 3,NG2( 78), 4,NG2( 52), 2,NG2( 13) }, /* 104Mb/s */ + { 4,NG2( 117), 3,NG2( 104), 4,NG2( 78), 2,NG2( 26) }, /* 117Mb/s */ + { 4,NG2( 130), 3,NG2( 117), 4,NG2( 104), 2,NG2( 26) } /* 130Mb/s */ +}; +#undef G +#undef NG2 +#undef NG1 + +#define H(_r) \ + (((_r) == 3) ? 0 : (((_r) == 4.5) ? 1 : (((_r) == 6) ? 2 : \ + (((_r) == 9) ? 3 : (((_r) == 12) ? 4 : (((_r) == 18) ? 5 : \ + (((_r) == 24) ? 6 : (((_r) == 27) ? 7 : 0)))))))) +static const struct txschedule series_half[] = { + { 3,H( 3), 3,H( 3), 0,H( 3), 0,H( 3) }, /* 3Mb/s */ + { 4,H(4.5),3,H( 3), 4,H( 3), 0,H( 3) }, /* 4.5Mb/s */ + { 4,H( 6), 3,H( 3), 4,H( 3), 0,H( 3) }, /* 6Mb/s */ + { 4,H( 9), 3,H( 6), 4,H( 3), 2,H( 3) }, /* 9Mb/s */ + { 4,H(12), 3,H( 9), 4,H( 6), 2,H( 3) }, /* 12Mb/s */ + { 4,H(18), 3,H( 12), 4,H( 9), 2,H( 3) }, /* 18Mb/s */ + { 4,H(24), 3,H( 18), 4,H( 12), 2,H( 6) }, /* 24Mb/s */ + { 4,H(27), 3,H( 24), 4,H( 18), 2,H(12) } /* 27Mb/s */ +}; +#undef H + +#ifdef Q +#undef Q /* sun4v bogosity */ +#endif +#define Q(_r) \ + (((_r) == 1.5) ? 0 : (((_r) ==2.25) ? 1 : (((_r) == 3) ? 2 : \ + (((_r) == 4.5) ? 3 : (((_r) == 6) ? 4 : (((_r) == 9) ? 5 : \ + (((_r) == 12) ? 6 : (((_r) == 13.5)? 7 : 0)))))))) +static const struct txschedule series_quarter[] = { + { 3,Q( 1.5),3,Q(1.5), 0,Q(1.5), 0,Q(1.5) }, /* 1.5Mb/s */ + { 4,Q(2.25),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) }, /*2.25Mb/s */ + { 4,Q( 3),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) }, /* 3Mb/s */ + { 4,Q( 4.5),3,Q( 3), 4,Q(1.5), 2,Q(1.5) }, /* 4.5Mb/s */ + { 4,Q( 6),3,Q(4.5), 4,Q( 3), 2,Q(1.5) }, /* 6Mb/s */ + { 4,Q( 9),3,Q( 6), 4,Q(4.5), 2,Q(1.5) }, /* 9Mb/s */ + { 4,Q( 12),3,Q( 9), 4,Q( 6), 2,Q( 3) }, /* 12Mb/s */ + { 4,Q(13.5),3,Q( 12), 4,Q( 9), 2,Q( 6) } /*13.5Mb/s */ +}; +#undef Q + +#endif From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 09:06:31 2011 Return-Path: Delivered-To: svn-src-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 28E42106566C; Fri, 28 Jan 2011 09:06:31 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail01.syd.optusnet.com.au (mail01.syd.optusnet.com.au [211.29.132.182]) by mx1.freebsd.org (Postfix) with ESMTP id B5FE48FC0C; Fri, 28 Jan 2011 09:06:30 +0000 (UTC) Received: from c122-106-165-206.carlnfd1.nsw.optusnet.com.au (c122-106-165-206.carlnfd1.nsw.optusnet.com.au [122.106.165.206]) by mail01.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id p0S96Q5s027886 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 Jan 2011 20:06:28 +1100 Date: Fri, 28 Jan 2011 20:06:26 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Doug Barton In-Reply-To: <4D41D52D.2080906@FreeBSD.org> Message-ID: <20110128194615.G1167@besplex.bde.org> References: <201101260506.p0Q56Bhf064034@svn.freebsd.org> <20110126173411.P972@besplex.bde.org> <4D408463.4000001@FreeBSD.org> <20110127153956.J1436@besplex.bde.org> <4D41D52D.2080906@FreeBSD.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Bruce Evans Subject: Re: svn commit: r217871 - head/sbin/mount X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 09:06:31 -0000 On Thu, 27 Jan 2011, Doug Barton wrote: > On 01/26/2011 21:24, Bruce Evans wrote: >> On Wed, 26 Jan 2011, Doug Barton wrote: > >>> My concern was that the man page says that we don't support the option >>> at all, but with a FreeBSD client and a solaris server it has a >>> demonstrable effect. If someone wants to improve the wording then by >>> all means, either make a suggestion or just do it. :) >> >> What is the effect? > > Um, the expected one? :) > > If I use a FreeBSD client to nfs mount something on a solaris system with the > noatime option then the access time does not change no matter how many times > I access the file. If I then unmount and remount without the noatime option > the access time will be modified. If I do the same thing but with a FreeBSD > nfs server the access time is modified, with or without the noatime option. The solaris server behaviour can't happen, except accidentally due to races :-). Since the FreeBSD client doesn't support the noatime flag except to ignore it, it can't tell any server about it. The FreeBSD server behaviour is as expected -- unmounting flushes the client's cache, so the first read after remounting goes to the server and the server must mark the atime for update (unless the server filesystem is mounted with noatime); then a later stat() on the client should somehow see an updated atime (but I wonder if caching defeats this too -- stat() on the server must change any mark for update to an update, but the client has an attribute cache which should be used to prevent most stat()s going to the server). Bruce From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 10:11:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 120DD1065693; Fri, 28 Jan 2011 10:11:20 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.garage.freebsd.pl (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1696E8FC0A; Fri, 28 Jan 2011 10:11:17 +0000 (UTC) Received: by mail.garage.freebsd.pl (Postfix, from userid 65534) id DE45345C8A; Fri, 28 Jan 2011 11:11:12 +0100 (CET) Received: from localhost (58.wheelsystems.com [83.12.187.58]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.garage.freebsd.pl (Postfix) with ESMTP id CDD3945684; Fri, 28 Jan 2011 11:10:53 +0100 (CET) Date: Fri, 28 Jan 2011 11:10:37 +0100 From: Pawel Jakub Dawidek To: Hans Petter Selasky Message-ID: <20110128101037.GF1729@garage.freebsd.pl> References: <201101280800.p0S80vtb064968@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+ts6NCQ4mrNQIV8p" Content-Disposition: inline In-Reply-To: <201101280800.p0S80vtb064968@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-PGP-Key-URL: http://people.freebsd.org/~pjd/pjd.asc X-OS: FreeBSD 9.0-CURRENT amd64 X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on mail.garage.freebsd.pl X-Spam-Level: X-Spam-Status: No, score=-5.9 required=4.5 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.0.4 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218010 - head/usr.sbin/usbdump X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 10:11:20 -0000 --+ts6NCQ4mrNQIV8p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jan 28, 2011 at 08:00:57AM +0000, Hans Petter Selasky wrote: > Author: hselasky > Date: Fri Jan 28 08:00:57 2011 > New Revision: 218010 > URL: http://svn.freebsd.org/changeset/base/218010 >=20 > Log: > - Remove double semicolon. > - Remove reference to sprintf. Use printf directly. This part of > the code should be optimised further to avoid many small printouts. > Setting a sensible line buffer length could help aswell when printing > out megabytes of data per second. > =20 > Approved by: thompsa (mentor) [...] > +#define EMIT(fmt, ...) do { \ > + printf(fmt,## __VA_ARGS__); \ > } while (0) Or: #define EMIT(...) printf(__VA_ARGS__) --=20 Pawel Jakub Dawidek http://www.wheelsystems.com pjd@FreeBSD.org http://www.FreeBSD.org FreeBSD committer Am I Evil? Yes, I Am! --+ts6NCQ4mrNQIV8p Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iEYEARECAAYFAk1ClhwACgkQForvXbEpPzTw8wCfaog6vuxqr1uPNjqmGKbwa3xE 538AnAz7MljD46oRlQKR7/i9rX7+PXXl =S0MV -----END PGP SIGNATURE----- --+ts6NCQ4mrNQIV8p-- From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 11:13:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECB36106564A; Fri, 28 Jan 2011 11:13:01 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB8798FC12; Fri, 28 Jan 2011 11:13:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SBD1Hj075380; Fri, 28 Jan 2011 11:13:01 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SBD10k075372; Fri, 28 Jan 2011 11:13:01 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101281113.p0SBD10k075372@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 28 Jan 2011 11:13:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218014 - in head/sys: geom/part sys X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 11:13:02 -0000 Author: ae Date: Fri Jan 28 11:13:01 2011 New Revision: 218014 URL: http://svn.freebsd.org/changeset/base/218014 Log: Add new user-friendly aliases for partition types for the MBR and EBR schemes: fat32, ebr, linux-data, linux-raid, linux-swap and linux-lvm. Add bios-boot GUID and alias for the GPT scheme. It used by GRUB 2 loader. Also do sorting definitions of types in diskmbr.h and in g_part.c. PR: bin/120990, kern/147664 MFC after: 2 weeks Modified: head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_ebr.c head/sys/geom/part/g_part_gpt.c head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h head/sys/sys/gpt.h Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/geom/part/g_part.c Fri Jan 28 11:13:01 2011 (r218014) @@ -76,7 +76,10 @@ struct g_part_alias_list { { "apple-raid-offline", G_PART_ALIAS_APPLE_RAID_OFFLINE }, { "apple-tv-recovery", G_PART_ALIAS_APPLE_TV_RECOVERY }, { "apple-ufs", G_PART_ALIAS_APPLE_UFS }, + { "bios-boot", G_PART_ALIAS_BIOS_BOOT }, + { "ebr", G_PART_ALIAS_EBR }, { "efi", G_PART_ALIAS_EFI }, + { "fat32", G_PART_ALIAS_MS_FAT32 }, { "freebsd", G_PART_ALIAS_FREEBSD }, { "freebsd-boot", G_PART_ALIAS_FREEBSD_BOOT }, { "freebsd-swap", G_PART_ALIAS_FREEBSD_SWAP }, @@ -87,6 +90,7 @@ struct g_part_alias_list { { "linux-lvm", G_PART_ALIAS_LINUX_LVM }, { "linux-raid", G_PART_ALIAS_LINUX_RAID }, { "linux-swap", G_PART_ALIAS_LINUX_SWAP }, + { "mbr", G_PART_ALIAS_MBR }, { "ms-basic-data", G_PART_ALIAS_MS_BASIC_DATA }, { "ms-ldm-data", G_PART_ALIAS_MS_LDM_DATA }, { "ms-ldm-metadata", G_PART_ALIAS_MS_LDM_METADATA }, @@ -98,7 +102,6 @@ struct g_part_alias_list { { "netbsd-lfs", G_PART_ALIAS_NETBSD_LFS }, { "netbsd-raid", G_PART_ALIAS_NETBSD_RAID }, { "netbsd-swap", G_PART_ALIAS_NETBSD_SWAP }, - { "mbr", G_PART_ALIAS_MBR } }; /* Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/geom/part/g_part.h Fri Jan 28 11:13:01 2011 (r218014) @@ -66,6 +66,9 @@ enum g_part_alias { G_PART_ALIAS_NETBSD_RAID, /* A NetBSD RAID partition entry. */ G_PART_ALIAS_NETBSD_SWAP, /* A NetBSD swap partition entry. */ G_PART_ALIAS_NETBSD_LFS, /* A NetBSD LFS partition entry. */ + G_PART_ALIAS_EBR, /* A EBR partition entry. */ + G_PART_ALIAS_MS_FAT32, /* A Microsoft FAT32 partition entry. */ + G_PART_ALIAS_BIOS_BOOT, /* A GRUB 2 boot partition entry. */ /* Keep the following last */ G_PART_ALIAS_COUNT }; Modified: head/sys/geom/part/g_part_ebr.c ============================================================================== --- head/sys/geom/part/g_part_ebr.c Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/geom/part/g_part_ebr.c Fri Jan 28 11:13:01 2011 (r218014) @@ -113,6 +113,19 @@ static struct g_part_scheme g_part_ebr_s }; G_PART_SCHEME_DECLARE(g_part_ebr); +static struct g_part_ebr_alias { + u_char typ; + int alias; +} ebr_alias_match[] = { + { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, + { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, +}; + static void ebr_set_chs(struct g_part_table *, uint32_t, u_char *, u_char *, u_char *); @@ -152,6 +165,7 @@ ebr_parse_type(const char *type, u_char const char *alias; char *endp; long lt; + int i; if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); @@ -160,14 +174,18 @@ ebr_parse_type(const char *type, u_char *dp_typ = (u_char)lt; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); - if (!strcasecmp(type, alias)) { - *dp_typ = DOSPTYP_386BSD; - return (0); + for (i = 0; + i < sizeof(ebr_alias_match) / sizeof(ebr_alias_match[0]); i++) { + alias = g_part_alias_name(ebr_alias_match[i].alias); + if (strcasecmp(type, alias) == 0) { + *dp_typ = ebr_alias_match[i].typ; + return (0); + } } return (EINVAL); } + static void ebr_set_chs(struct g_part_table *table, uint32_t lba, u_char *cylp, u_char *hdp, u_char *secp) @@ -543,13 +561,15 @@ g_part_ebr_type(struct g_part_table *bas char *buf, size_t bufsz) { struct g_part_ebr_entry *entry; - int type; + int i; entry = (struct g_part_ebr_entry *)baseentry; - type = entry->ent.dp_typ; - if (type == DOSPTYP_386BSD) - return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); - snprintf(buf, bufsz, "!%d", type); + for (i = 0; + i < sizeof(ebr_alias_match) / sizeof(ebr_alias_match[0]); i++) { + if (ebr_alias_match[i].typ == entry->ent.dp_typ) + return (g_part_alias_name(ebr_alias_match[i].alias)); + } + snprintf(buf, bufsz, "!%d", entry->ent.dp_typ); return (buf); } Modified: head/sys/geom/part/g_part_gpt.c ============================================================================== --- head/sys/geom/part/g_part_gpt.c Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/geom/part/g_part_gpt.c Fri Jan 28 11:13:01 2011 (r218014) @@ -146,6 +146,7 @@ static struct uuid gpt_uuid_apple_raid = static struct uuid gpt_uuid_apple_raid_offline = GPT_ENT_TYPE_APPLE_RAID_OFFLINE; static struct uuid gpt_uuid_apple_tv_recovery = GPT_ENT_TYPE_APPLE_TV_RECOVERY; static struct uuid gpt_uuid_apple_ufs = GPT_ENT_TYPE_APPLE_UFS; +static struct uuid gpt_uuid_bios_boot = GPT_ENT_TYPE_BIOS_BOOT; static struct uuid gpt_uuid_efi = GPT_ENT_TYPE_EFI; static struct uuid gpt_uuid_freebsd = GPT_ENT_TYPE_FREEBSD; static struct uuid gpt_uuid_freebsd_boot = GPT_ENT_TYPE_FREEBSD_BOOT; @@ -181,6 +182,7 @@ static struct g_part_uuid_alias { { &gpt_uuid_apple_raid_offline, G_PART_ALIAS_APPLE_RAID_OFFLINE }, { &gpt_uuid_apple_tv_recovery, G_PART_ALIAS_APPLE_TV_RECOVERY }, { &gpt_uuid_apple_ufs, G_PART_ALIAS_APPLE_UFS }, + { &gpt_uuid_bios_boot, G_PART_ALIAS_BIOS_BOOT }, { &gpt_uuid_efi, G_PART_ALIAS_EFI }, { &gpt_uuid_freebsd, G_PART_ALIAS_FREEBSD }, { &gpt_uuid_freebsd_boot, G_PART_ALIAS_FREEBSD_BOOT }, Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/geom/part/g_part_mbr.c Fri Jan 28 11:13:01 2011 (r218014) @@ -108,12 +108,27 @@ static struct g_part_scheme g_part_mbr_s }; G_PART_SCHEME_DECLARE(g_part_mbr); +static struct g_part_mbr_alias { + u_char typ; + int alias; +} mbr_alias_match[] = { + { DOSPTYP_386BSD, G_PART_ALIAS_FREEBSD }, + { DOSPTYP_EXT, G_PART_ALIAS_EBR }, + { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, + { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, + { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, + { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, + { DOSPTYP_LINRAID, G_PART_ALIAS_LINUX_RAID }, +}; + static int mbr_parse_type(const char *type, u_char *dp_typ) { const char *alias; char *endp; long lt; + int i; if (type[0] == '!') { lt = strtol(type + 1, &endp, 0); @@ -122,15 +137,13 @@ mbr_parse_type(const char *type, u_char *dp_typ = (u_char)lt; return (0); } - alias = g_part_alias_name(G_PART_ALIAS_FREEBSD); - if (!strcasecmp(type, alias)) { - *dp_typ = DOSPTYP_386BSD; - return (0); - } - alias = g_part_alias_name(G_PART_ALIAS_MS_NTFS); - if (!strcasecmp(type, alias)) { - *dp_typ = DOSPTYP_NTFS; - return (0); + for (i = 0; + i < sizeof(mbr_alias_match) / sizeof(mbr_alias_match[0]); i++) { + alias = g_part_alias_name(mbr_alias_match[i].alias); + if (strcasecmp(type, alias) == 0) { + *dp_typ = mbr_alias_match[i].typ; + return (0); + } } return (EINVAL); } @@ -505,18 +518,15 @@ g_part_mbr_type(struct g_part_table *bas char *buf, size_t bufsz) { struct g_part_mbr_entry *entry; - int type; + int i; entry = (struct g_part_mbr_entry *)baseentry; - type = entry->ent.dp_typ; - switch (type) { - case DOSPTYP_386BSD: - return (g_part_alias_name(G_PART_ALIAS_FREEBSD)); - case DOSPTYP_NTFS: - return (g_part_alias_name(G_PART_ALIAS_MS_NTFS)); - default: - snprintf(buf, bufsz, "!%d", type); + for (i = 0; + i < sizeof(mbr_alias_match) / sizeof(mbr_alias_match[0]); i++) { + if (mbr_alias_match[i].typ == entry->ent.dp_typ) + return (g_part_alias_name(mbr_alias_match[i].alias)); } + snprintf(buf, bufsz, "!%d", entry->ent.dp_typ); return (buf); } Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/sys/diskmbr.h Fri Jan 28 11:13:01 2011 (r218014) @@ -43,13 +43,16 @@ #define DOSMAGICOFFSET 510 #define DOSMAGIC 0xAA55 +#define DOSPTYP_EXT 0x05 /* DOS extended partition */ +#define DOSPTYP_NTFS 0x07 /* NTFS partition */ +#define DOSPTYP_FAT32 0x0b /* FAT32 partition */ +#define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ +#define DOSPTYP_LINLVM 0x8e /* Linux LVM partition */ #define DOSPTYP_PMBR 0xee /* GPT Protective MBR */ -#define DOSPTYP_EXT 5 /* DOS extended partition */ -#define DOSPTYP_EXTLBA 15 /* DOS extended partition */ -#define DOSPTYP_NTFS 0x07 /* NTFS partition */ +#define DOSPTYP_LINRAID 0xfd /* Linux raid partition */ struct dos_partition { unsigned char dp_flag; /* bootstrap flags */ Modified: head/sys/sys/gpt.h ============================================================================== --- head/sys/sys/gpt.h Fri Jan 28 08:57:58 2011 (r218013) +++ head/sys/sys/gpt.h Fri Jan 28 11:13:01 2011 (r218014) @@ -150,4 +150,10 @@ struct gpt_ent { #define GPT_ENT_TYPE_NETBSD_CGD \ {0x2db519ec,0xb10f,0x11dc,0xb9,0x9b,{0x00,0x19,0xd1,0x87,0x96,0x48}} +/* + * Boot partition used by GRUB 2. + */ +#define GPT_ENT_TYPE_BIOS_BOOT \ + {0x21686148,0x6449,0x6e6f,0x74,0x4e,{0x65,0x65,0x64,0x45,0x46,0x49}} + #endif /* _SYS_GPT_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 11:56:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24F9C1065674; Fri, 28 Jan 2011 11:56:15 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 14EF78FC16; Fri, 28 Jan 2011 11:56:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SBuE2L076679; Fri, 28 Jan 2011 11:56:14 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SBuEqB076677; Fri, 28 Jan 2011 11:56:14 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201101281156.p0SBuEqB076677@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 28 Jan 2011 11:56:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218015 - head/sbin/geom/class/part X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 11:56:15 -0000 Author: ae Date: Fri Jan 28 11:56:14 2011 New Revision: 218015 URL: http://svn.freebsd.org/changeset/base/218015 Log: Document the "bios-boot" partition type. MFC after: 2 weeks Modified: head/sbin/geom/class/part/gpart.8 Modified: head/sbin/geom/class/part/gpart.8 ============================================================================== --- head/sbin/geom/class/part/gpart.8 Fri Jan 28 11:13:01 2011 (r218014) +++ head/sbin/geom/class/part/gpart.8 Fri Jan 28 11:56:14 2011 (r218015) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 12, 2011 +.Dd January 28, 2011 .Dt GPART 8 .Os .Sh NAME @@ -509,6 +509,11 @@ utility also allows the user to specify for partition types that do not have symbol names. The symbolic names currently understood are: .Bl -tag -width ".Cm freebsd-vinum" +.It Cm bios-boot +The system partition dedicated to second stage of the boot loader program. +Usually it used by GRUB 2 loader when the partition table is GPT. +The scheme-specific type is +.Qq Li "!21686148-6449-6E6F-744E-656564454649" . .It Cm efi The system partition for computers that use the Extensible Firmware Interface (EFI). From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 15:29:36 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F57F106564A; Fri, 28 Jan 2011 15:29:36 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F5878FC12; Fri, 28 Jan 2011 15:29:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SFTavq084885; Fri, 28 Jan 2011 15:29:36 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SFTair084884; Fri, 28 Jan 2011 15:29:36 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201101281529.p0SFTair084884@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 28 Jan 2011 15:29:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218019 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 15:29:36 -0000 Author: jilles Date: Fri Jan 28 15:29:35 2011 New Revision: 218019 URL: http://svn.freebsd.org/changeset/base/218019 Log: Do not trip a KASSERT if /dev/null cannot be opened for a setuid program. The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening /dev/null. If this fails (e.g. missing devfs or wrong permissions), fdcheckstd() will return failure and the process will exit as if it received SIGABRT. The KASSERT is only to check that kern_open() returns the expected fd, given that it succeeded. Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not. MFC after: 2 weeks Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Fri Jan 28 15:25:46 2011 (r218018) +++ head/sys/kern/kern_descrip.c Fri Jan 28 15:29:35 2011 (r218019) @@ -2024,10 +2024,10 @@ fdcheckstd(struct thread *td) error = kern_open(td, "/dev/null", UIO_SYSSPACE, O_RDWR, 0); devnull = td->td_retval[0]; - KASSERT(devnull == i, ("oof, we didn't get our fd")); td->td_retval[0] = save; if (error) break; + KASSERT(devnull == i, ("oof, we didn't get our fd")); } else { error = do_dup(td, DUP_FIXED, devnull, i, &retval); if (error != 0) From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 17:10:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F00A1065670; Fri, 28 Jan 2011 17:10:37 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6EF808FC13; Fri, 28 Jan 2011 17:10:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SHAbWs089085; Fri, 28 Jan 2011 17:10:37 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SHAbMh089083; Fri, 28 Jan 2011 17:10:37 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201101281710.p0SHAbMh089083@svn.freebsd.org> From: Ken Smith Date: Fri, 28 Jan 2011 17:10:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218024 - releng/7.4/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 17:10:37 -0000 Author: kensmith Date: Fri Jan 28 17:10:37 2011 New Revision: 218024 URL: http://svn.freebsd.org/changeset/base/218024 Log: Ready for 7.4-RC3 builds. Approved by: re (implicit) Modified: releng/7.4/sys/conf/newvers.sh Modified: releng/7.4/sys/conf/newvers.sh ============================================================================== --- releng/7.4/sys/conf/newvers.sh Fri Jan 28 16:28:57 2011 (r218023) +++ releng/7.4/sys/conf/newvers.sh Fri Jan 28 17:10:37 2011 (r218024) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="7.4" -BRANCH="RC2" +BRANCH="RC3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 17:30:24 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66AF0106564A; Fri, 28 Jan 2011 17:30:24 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 566608FC18; Fri, 28 Jan 2011 17:30:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SHUOZO089936; Fri, 28 Jan 2011 17:30:24 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SHUORo089934; Fri, 28 Jan 2011 17:30:24 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201101281730.p0SHUORo089934@svn.freebsd.org> From: Sergey Kandaurov Date: Fri, 28 Jan 2011 17:30:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218025 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 17:30:24 -0000 Author: pluknet Date: Fri Jan 28 17:30:24 2011 New Revision: 218025 URL: http://svn.freebsd.org/changeset/base/218025 Log: Remove SuperH architecture from a comment as we do not support it. Presumably it was leaked from NetBSD together with rtld-elf mips support. Approved by: kib (mentor) MFC after: 3 days Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Jan 28 17:10:37 2011 (r218024) +++ head/libexec/rtld-elf/rtld.c Fri Jan 28 17:30:24 2011 (r218025) @@ -1385,7 +1385,7 @@ init_rtld(caddr_t mapbase, Elf_Auxinfo * digest_dynamic1(&objtmp, 1, &dyn_rpath, &dyn_soname); assert(objtmp.needed == NULL); #if !defined(__mips__) - /* MIPS and SH{3,5} have a bogus DT_TEXTREL. */ + /* MIPS has a bogus DT_TEXTREL. */ assert(!objtmp.textrel); #endif From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 17:37:09 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0DE106566C; Fri, 28 Jan 2011 17:37:09 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89F338FC12; Fri, 28 Jan 2011 17:37:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SHb9hd090425; Fri, 28 Jan 2011 17:37:09 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SHb9vQ090423; Fri, 28 Jan 2011 17:37:09 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101281737.p0SHb9vQ090423@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 28 Jan 2011 17:37:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218026 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 17:37:09 -0000 Author: kib Date: Fri Jan 28 17:37:09 2011 New Revision: 218026 URL: http://svn.freebsd.org/changeset/base/218026 Log: If more than one thread allocated sf buffers for sendfile(2), and each of the threads needs more while current pool of the buffers is exhausted, then neither thread can make progress. Switch to nowait allocations after we got first buffer already. Reported by: az Reviewed by: alc (previous version) Tested by: pho MFC after: 1 week Modified: head/sys/kern/uipc_syscalls.c Modified: head/sys/kern/uipc_syscalls.c ============================================================================== --- head/sys/kern/uipc_syscalls.c Fri Jan 28 17:30:24 2011 (r218025) +++ head/sys/kern/uipc_syscalls.c Fri Jan 28 17:37:09 2011 (r218026) @@ -2126,18 +2126,25 @@ retry_space: } /* - * Get a sendfile buf. We usually wait as long - * as necessary, but this wait can be interrupted. + * Get a sendfile buf. When allocating the + * first buffer for mbuf chain, we usually + * wait as long as necessary, but this wait + * can be interrupted. For consequent + * buffers, do not sleep, since several + * threads might exhaust the buffers and then + * deadlock. */ - if ((sf = sf_buf_alloc(pg, - (mnw ? SFB_NOWAIT : SFB_CATCH))) == NULL) { + sf = sf_buf_alloc(pg, (mnw || m != NULL) ? SFB_NOWAIT : + SFB_CATCH); + if (sf == NULL) { mbstat.sf_allocfail++; vm_page_lock(pg); vm_page_unwire(pg, 0); KASSERT(pg->object != NULL, ("kern_sendfile: object disappeared")); vm_page_unlock(pg); - error = (mnw ? EAGAIN : EINTR); + if (m == NULL) + error = (mnw ? EAGAIN : EINTR); break; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 18:25:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D379B106564A; Fri, 28 Jan 2011 18:25:51 +0000 (UTC) (envelope-from jpaetzel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C27958FC15; Fri, 28 Jan 2011 18:25:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SIPpw8093836; Fri, 28 Jan 2011 18:25:51 GMT (envelope-from jpaetzel@svn.freebsd.org) Received: (from jpaetzel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SIPpaQ093834; Fri, 28 Jan 2011 18:25:51 GMT (envelope-from jpaetzel@svn.freebsd.org) Message-Id: <201101281825.p0SIPpaQ093834@svn.freebsd.org> From: Josh Paetzel Date: Fri, 28 Jan 2011 18:25:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218027 - stable/8/etc/periodic/daily X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 18:25:51 -0000 Author: jpaetzel Date: Fri Jan 28 18:25:51 2011 New Revision: 218027 URL: http://svn.freebsd.org/changeset/base/218027 Log: MFC: r217755 r217822 This script parses output of userland tools. In the case of a faulted zpool the output causes the script to bail out with syntax errors. Since a scrub of a faulted zpool is pointless, just skip over any pools marked as such. PR: conf/150228 Approved by: kib (mentor) Modified: stable/8/etc/periodic/daily/800.scrub-zfs Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/periodic/daily/800.scrub-zfs ============================================================================== --- stable/8/etc/periodic/daily/800.scrub-zfs Fri Jan 28 17:37:09 2011 (r218026) +++ stable/8/etc/periodic/daily/800.scrub-zfs Fri Jan 28 18:25:51 2011 (r218027) @@ -5,6 +5,10 @@ # If there is a global system configuration file, suck it in. # + +newline=" +" # A single newline + if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf @@ -24,13 +28,19 @@ case "$daily_scrub_zfs_enable" in for pool in ${daily_scrub_zfs_pools}; do # sanity check - zpool list ${pool} >/dev/null 2>&1 + _status=$(zpool list "${pool}" 2> /dev/null) if [ $? -ne 0 ]; then echo " WARNING: pool '${pool}' specified in" echo " '/etc/periodic.conf:daily_scrub_zfs_pools'" echo " does not exist" continue fi + _status=${_status##*$newline} + case ${_status} in + *FAULTED*) + echo "Skipping faulted pool: ${pool}" + continue ;; + esac # successful only if there is at least one pool to scrub rc=0 From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 18:28:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4DE610656A6; Fri, 28 Jan 2011 18:28:06 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7A3F88FC1D; Fri, 28 Jan 2011 18:28:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SIS6vr094015; Fri, 28 Jan 2011 18:28:06 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SIS6Uq094013; Fri, 28 Jan 2011 18:28:06 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101281828.p0SIS6Uq094013@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 28 Jan 2011 18:28:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218028 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 18:28:06 -0000 Author: dchagin Date: Fri Jan 28 18:28:06 2011 New Revision: 218028 URL: http://svn.freebsd.org/changeset/base/218028 Log: To avoid excessive code duplication move struct rusage translation to a separate function. MFC after: 1 Month. Modified: head/sys/amd64/linux32/linux32_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Fri Jan 28 18:25:51 2011 (r218027) +++ head/sys/amd64/linux32/linux32_machdep.c Fri Jan 28 18:28:06 2011 (r218028) @@ -106,6 +106,28 @@ bsd_to_linux_sigaltstack(int bsa) return (lsa); } +static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru) +{ + lru->ru_utime.tv_sec = ru->ru_utime.tv_sec; + lru->ru_utime.tv_usec = ru->ru_utime.tv_usec; + lru->ru_stime.tv_sec = ru->ru_stime.tv_sec; + lru->ru_stime.tv_usec = ru->ru_stime.tv_usec; + lru->ru_maxrss = ru->ru_maxrss; + lru->ru_ixrss = ru->ru_ixrss; + lru->ru_idrss = ru->ru_idrss; + lru->ru_isrss = ru->ru_isrss; + lru->ru_minflt = ru->ru_minflt; + lru->ru_majflt = ru->ru_majflt; + lru->ru_nswap = ru->ru_nswap; + lru->ru_inblock = ru->ru_inblock; + lru->ru_oublock = ru->ru_oublock; + lru->ru_msgsnd = ru->ru_msgsnd; + lru->ru_msgrcv = ru->ru_msgrcv; + lru->ru_nsignals = ru->ru_nsignals; + lru->ru_nvcsw = ru->ru_nvcsw; + lru->ru_nivcsw = ru->ru_nivcsw; +} + int linux_execve(struct thread *td, struct linux_execve_args *args) { @@ -1126,24 +1148,7 @@ linux_getrusage(struct thread *td, struc if (error != 0) return (error); if (uap->rusage != NULL) { - s32.ru_utime.tv_sec = s.ru_utime.tv_sec; - s32.ru_utime.tv_usec = s.ru_utime.tv_usec; - s32.ru_stime.tv_sec = s.ru_stime.tv_sec; - s32.ru_stime.tv_usec = s.ru_stime.tv_usec; - s32.ru_maxrss = s.ru_maxrss; - s32.ru_ixrss = s.ru_ixrss; - s32.ru_idrss = s.ru_idrss; - s32.ru_isrss = s.ru_isrss; - s32.ru_minflt = s.ru_minflt; - s32.ru_majflt = s.ru_majflt; - s32.ru_nswap = s.ru_nswap; - s32.ru_inblock = s.ru_inblock; - s32.ru_oublock = s.ru_oublock; - s32.ru_msgsnd = s.ru_msgsnd; - s32.ru_msgrcv = s.ru_msgrcv; - s32.ru_nsignals = s.ru_nsignals; - s32.ru_nvcsw = s.ru_nvcsw; - s32.ru_nivcsw = s.ru_nivcsw; + bsd_to_linux_rusage(&s, &s32); error = copyout(&s32, uap->rusage, sizeof(s32)); } return (error); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 18:47:07 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 903FA1065694; Fri, 28 Jan 2011 18:47:07 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ECD38FC18; Fri, 28 Jan 2011 18:47:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SIl7Wj095353; Fri, 28 Jan 2011 18:47:07 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SIl7w3095348; Fri, 28 Jan 2011 18:47:07 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101281847.p0SIl7w3095348@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 28 Jan 2011 18:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218030 - in head/sys: amd64/linux32 compat/linux i386/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 18:47:07 -0000 Author: dchagin Date: Fri Jan 28 18:47:07 2011 New Revision: 218030 URL: http://svn.freebsd.org/changeset/base/218030 Log: Implement a variation of the linux_common_wait() which should be used by linuxolator itself. Move linux_wait4() to MD path as it requires native struct rusage translation to struct l_rusage on linux32/amd64. MFC after: 1 Month. Modified: head/sys/amd64/linux32/linux32_machdep.c head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_misc.h head/sys/i386/linux/linux_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Fri Jan 28 18:42:17 2011 (r218029) +++ head/sys/amd64/linux32/linux32_machdep.c Fri Jan 28 18:47:07 2011 (r218030) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -66,6 +67,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1272,3 +1274,44 @@ linux_set_thread_area(struct thread *td, return (0); } + +int +linux_wait4(struct thread *td, struct linux_wait4_args *args) +{ + int error, options; + struct rusage ru, *rup; + struct l_rusage lru; + struct proc *p; + +#ifdef DEBUG + if (ldebug(wait4)) + printf(ARGS(wait4, "%d, %p, %d, %p"), + args->pid, (void *)args->status, args->options, + (void *)args->rusage); +#endif + + options = (args->options & (WNOHANG | WUNTRACED)); + /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ + if (args->options & __WCLONE) + options |= WLINUXCLONE; + + if (args->rusage != NULL) + rup = &ru; + else + rup = NULL; + error = linux_common_wait(td, args->pid, args->status, options, rup); + if (error) + return (error); + + p = td->td_proc; + PROC_LOCK(p); + sigqueue_delete(&p->p_sigqueue, SIGCHLD); + PROC_UNLOCK(p); + + if (args->rusage != NULL) { + bsd_to_linux_rusage(rup, &lru); + error = copyout(&lru, args->rusage, sizeof(lru)); + } + + return (error); +} Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jan 28 18:42:17 2011 (r218029) +++ head/sys/compat/linux/linux_misc.c Fri Jan 28 18:47:07 2011 (r218030) @@ -847,35 +847,17 @@ linux_futimesat(struct thread *td, struc } #endif /* __i386__ || (__amd64__ && COMPAT_LINUX32) */ -#define __WCLONE 0x80000000 - int -linux_waitpid(struct thread *td, struct linux_waitpid_args *args) +linux_common_wait(struct thread *td, int pid, int *status, + int options, struct rusage *ru) { - int error, options, tmpstat; - -#ifdef DEBUG - if (ldebug(waitpid)) - printf(ARGS(waitpid, "%d, %p, %d"), - args->pid, (void *)args->status, args->options); -#endif - /* - * this is necessary because the test in kern_wait doesn't work - * because we mess with the options here - */ - if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE)) - return (EINVAL); + int error, tmpstat; - options = (args->options & (WNOHANG | WUNTRACED)); - /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ - if (args->options & __WCLONE) - options |= WLINUXCLONE; - - error = kern_wait(td, args->pid, &tmpstat, options, NULL); + error = kern_wait(td, pid, &tmpstat, options, ru); if (error) - return error; + return (error); - if (args->status) { + if (status) { tmpstat &= 0xffff; if (WIFSIGNALED(tmpstat)) tmpstat = (tmpstat & 0xffffff80) | @@ -883,60 +865,38 @@ linux_waitpid(struct thread *td, struct else if (WIFSTOPPED(tmpstat)) tmpstat = (tmpstat & 0xffff00ff) | (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); - return copyout(&tmpstat, args->status, sizeof(int)); + error = copyout(&tmpstat, status, sizeof(int)); } - return (0); + return (error); } int -linux_wait4(struct thread *td, struct linux_wait4_args *args) +linux_waitpid(struct thread *td, struct linux_waitpid_args *args) { - int error, options, tmpstat; - struct rusage ru, *rup; - struct proc *p; - + int options; + #ifdef DEBUG - if (ldebug(wait4)) - printf(ARGS(wait4, "%d, %p, %d, %p"), - args->pid, (void *)args->status, args->options, - (void *)args->rusage); + if (ldebug(waitpid)) + printf(ARGS(waitpid, "%d, %p, %d"), + args->pid, (void *)args->status, args->options); #endif - + /* + * this is necessary because the test in kern_wait doesn't work + * because we mess with the options here + */ + if (args->options & ~(WUNTRACED | WNOHANG | WCONTINUED | __WCLONE)) + return (EINVAL); + options = (args->options & (WNOHANG | WUNTRACED)); /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ if (args->options & __WCLONE) options |= WLINUXCLONE; - if (args->rusage != NULL) - rup = &ru; - else - rup = NULL; - error = kern_wait(td, args->pid, &tmpstat, options, rup); - if (error) - return error; - - p = td->td_proc; - PROC_LOCK(p); - sigqueue_delete(&p->p_sigqueue, SIGCHLD); - PROC_UNLOCK(p); - - if (args->status) { - tmpstat &= 0xffff; - if (WIFSIGNALED(tmpstat)) - tmpstat = (tmpstat & 0xffffff80) | - BSD_TO_LINUX_SIGNAL(WTERMSIG(tmpstat)); - else if (WIFSTOPPED(tmpstat)) - tmpstat = (tmpstat & 0xffff00ff) | - (BSD_TO_LINUX_SIGNAL(WSTOPSIG(tmpstat)) << 8); - error = copyout(&tmpstat, args->status, sizeof(int)); - } - if (args->rusage != NULL && error == 0) - error = copyout(&ru, args->rusage, sizeof(ru)); - - return (error); + return (linux_common_wait(td, args->pid, args->status, options, NULL)); } + int linux_mknod(struct thread *td, struct linux_mknod_args *args) { Modified: head/sys/compat/linux/linux_misc.h ============================================================================== --- head/sys/compat/linux/linux_misc.h Fri Jan 28 18:42:17 2011 (r218029) +++ head/sys/compat/linux/linux_misc.h Fri Jan 28 18:47:07 2011 (r218030) @@ -67,4 +67,9 @@ extern const char *linux_platform; extern int stclohz; +#define __WCLONE 0x80000000 + +int linux_common_wait(struct thread *td, int pid, int *status, + int options, struct rusage *ru); + #endif /* _LINUX_MISC_H_ */ Modified: head/sys/i386/linux/linux_machdep.c ============================================================================== --- head/sys/i386/linux/linux_machdep.c Fri Jan 28 18:42:17 2011 (r218029) +++ head/sys/i386/linux/linux_machdep.c Fri Jan 28 18:47:07 2011 (r218030) @@ -63,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -1312,3 +1313,40 @@ linux_mq_getsetattr(struct thread *td, s #endif } +int +linux_wait4(struct thread *td, struct linux_wait4_args *args) +{ + int error, options; + struct rusage ru, *rup; + struct proc *p; + +#ifdef DEBUG + if (ldebug(wait4)) + printf(ARGS(wait4, "%d, %p, %d, %p"), + args->pid, (void *)args->status, args->options, + (void *)args->rusage); +#endif + + options = (args->options & (WNOHANG | WUNTRACED)); + /* WLINUXCLONE should be equal to __WCLONE, but we make sure */ + if (args->options & __WCLONE) + options |= WLINUXCLONE; + + if (args->rusage != NULL) + rup = &ru; + else + rup = NULL; + error = linux_common_wait(td, args->pid, args->status, options, rup); + if (error) + return (error); + + p = td->td_proc; + PROC_LOCK(p); + sigqueue_delete(&p->p_sigqueue, SIGCHLD); + PROC_UNLOCK(p); + + if (args->rusage != NULL) + error = copyout(&ru, args->rusage, sizeof(ru)); + + return (error); +} From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 19:04:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A827106566B; Fri, 28 Jan 2011 19:04:15 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59BCD8FC12; Fri, 28 Jan 2011 19:04:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SJ4Fkr096286; Fri, 28 Jan 2011 19:04:15 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SJ4FAg096284; Fri, 28 Jan 2011 19:04:15 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101281904.p0SJ4FAg096284@svn.freebsd.org> From: Dmitry Chagin Date: Fri, 28 Jan 2011 19:04:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218031 - head/sys/compat/linux X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 19:04:15 -0000 Author: dchagin Date: Fri Jan 28 19:04:15 2011 New Revision: 218031 URL: http://svn.freebsd.org/changeset/base/218031 Log: Style(9) fixes. MFC after: 1 Month. Modified: head/sys/compat/linux/linux_misc.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Jan 28 18:47:07 2011 (r218030) +++ head/sys/compat/linux/linux_misc.c Fri Jan 28 19:04:15 2011 (r218031) @@ -160,7 +160,7 @@ linux_sysinfo(struct thread *td, struct sysinfo.freebig = 0; sysinfo.mem_unit = 1; - return copyout(&sysinfo, args->info, sizeof(sysinfo)); + return (copyout(&sysinfo, args->info, sizeof(sysinfo))); } int @@ -216,7 +216,7 @@ linux_brk(struct thread *td, struct linu else td->td_retval[0] = (long)old; - return 0; + return (0); } #if defined(__i386__) @@ -468,7 +468,7 @@ cleanup: vm_map_remove(kernel_map, (vm_offset_t)a_out, (vm_offset_t)a_out + PAGE_SIZE); - return error; + return (error); } #endif /* __i386__ */ @@ -562,7 +562,7 @@ select_out: if (ldebug(select)) printf(LMSG("select_out -> %d"), error); #endif - return error; + return (error); } int @@ -602,7 +602,7 @@ linux_mremap(struct thread *td, struct l if (args->new_len > args->old_len) { td->td_retval[0] = 0; - return ENOMEM; + return (ENOMEM); } if (args->new_len < args->old_len) { @@ -613,7 +613,7 @@ linux_mremap(struct thread *td, struct l } td->td_retval[0] = error ? 0 : (uintptr_t)args->addr; - return error; + return (error); } #define LINUX_MS_ASYNC 0x0001 @@ -629,7 +629,7 @@ linux_msync(struct thread *td, struct li bsd_args.len = (uintptr_t)args->len; bsd_args.flags = args->fl & ~LINUX_MS_SYNC; - return msync(td, &bsd_args); + return (msync(td, &bsd_args)); } int @@ -647,9 +647,9 @@ linux_time(struct thread *td, struct lin microtime(&tv); tm = tv.tv_sec; if (args->tm && (error = copyout(&tm, args->tm, sizeof(tm)))) - return error; + return (error); td->td_retval[0] = tm; - return 0; + return (0); } struct l_times_argv { @@ -702,12 +702,12 @@ linux_times(struct thread *td, struct li tms.tms_cstime = CONVTCK(cstime); if ((error = copyout(&tms, args->buf, sizeof(tms)))) - return error; + return (error); } microuptime(&tv); td->td_retval[0] = (int)CONVTCK(tv); - return 0; + return (0); } int @@ -766,7 +766,7 @@ linux_utime(struct thread *td, struct li if (args->times) { if ((error = copyin(args->times, &lut, sizeof lut))) { LFREEPATH(fname); - return error; + return (error); } tv[0].tv_sec = lut.l_actime; tv[0].tv_usec = 0; @@ -1003,11 +1003,11 @@ linux_personality(struct thread *td, str printf(ARGS(personality, "%lu"), (unsigned long)args->per); #endif if (args->per != 0) - return EINVAL; + return (EINVAL); /* Yes Jim, it's still a Linux... */ td->td_retval[0] = 0; - return 0; + return (0); } struct l_itimerval { @@ -1085,7 +1085,7 @@ linux_nice(struct thread *td, struct lin bsd_args.which = PRIO_PROCESS; bsd_args.who = 0; /* current process */ bsd_args.prio = args->inc; - return setpriority(td, &bsd_args); + return (setpriority(td, &bsd_args)); } int @@ -1312,12 +1312,12 @@ linux_sched_setscheduler(struct thread * bsd.policy = SCHED_RR; break; default: - return EINVAL; + return (EINVAL); } bsd.pid = args->pid; bsd.param = (struct sched_param *)args->param; - return sched_setscheduler(td, &bsd); + return (sched_setscheduler(td, &bsd)); } int @@ -1347,7 +1347,7 @@ linux_sched_getscheduler(struct thread * break; } - return error; + return (error); } int @@ -1372,9 +1372,9 @@ linux_sched_get_priority_max(struct thre bsd.policy = SCHED_RR; break; default: - return EINVAL; + return (EINVAL); } - return sched_get_priority_max(td, &bsd); + return (sched_get_priority_max(td, &bsd)); } int @@ -1399,9 +1399,9 @@ linux_sched_get_priority_min(struct thre bsd.policy = SCHED_RR; break; default: - return EINVAL; + return (EINVAL); } - return sched_get_priority_min(td, &bsd); + return (sched_get_priority_min(td, &bsd)); } #define REBOOT_CAD_ON 0x89abcdef @@ -1426,7 +1426,7 @@ linux_reboot(struct thread *td, struct l #endif if (args->magic1 != REBOOT_MAGIC1) - return EINVAL; + return (EINVAL); switch (args->magic2) { case REBOOT_MAGIC2: @@ -1434,7 +1434,7 @@ linux_reboot(struct thread *td, struct l case REBOOT_MAGIC2B: break; default: - return EINVAL; + return (EINVAL); } switch (args->cmd) { @@ -1452,9 +1452,9 @@ linux_reboot(struct thread *td, struct l bsd_args.opt = RB_POWEROFF; break; default: - return EINVAL; + return (EINVAL); } - return reboot(td, &bsd_args); + return (reboot(td, &bsd_args)); } @@ -1592,7 +1592,7 @@ linux_getsid(struct thread *td, struct l #endif bsd.pid = args->pid; - return getsid(td, &bsd); + return (getsid(td, &bsd)); } int @@ -1617,7 +1617,7 @@ linux_getpriority(struct thread *td, str bsd_args.who = args->who; error = getpriority(td, &bsd_args); td->td_retval[0] = 20 - td->td_retval[0]; - return error; + return (error); } int From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 19:53:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5AC2B1065672; Fri, 28 Jan 2011 19:53:38 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4AA588FC24; Fri, 28 Jan 2011 19:53:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SJrcMT097734; Fri, 28 Jan 2011 19:53:38 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SJrcNf097732; Fri, 28 Jan 2011 19:53:38 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201101281953.p0SJrcNf097732@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 28 Jan 2011 19:53:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218032 - releng/8.2/sys/i386/i386 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 19:53:38 -0000 Author: jkim Date: Fri Jan 28 19:53:38 2011 New Revision: 218032 URL: http://svn.freebsd.org/changeset/base/218032 Log: MFC: r217587 Fix yet another fallout from r208833. VM86 BIOS call may cause page fault when FPU is in use. Approved by: re (kib) Modified: releng/8.2/sys/i386/i386/vm86bios.s Directory Properties: releng/8.2/sys/ (props changed) releng/8.2/sys/amd64/include/xen/ (props changed) releng/8.2/sys/cddl/contrib/opensolaris/ (props changed) releng/8.2/sys/contrib/dev/acpica/ (props changed) releng/8.2/sys/contrib/pf/ (props changed) Modified: releng/8.2/sys/i386/i386/vm86bios.s ============================================================================== --- releng/8.2/sys/i386/i386/vm86bios.s Fri Jan 28 19:04:15 2011 (r218031) +++ releng/8.2/sys/i386/i386/vm86bios.s Fri Jan 28 19:53:38 2011 (r218032) @@ -73,10 +73,9 @@ ENTRY(vm86_bioscall) je 1f /* no curproc/npxproc */ pushl %edx movl TD_PCB(%ecx),%ecx - addl $PCB_SAVEFPU,%ecx - pushl %ecx + pushl PCB_SAVEFPU(%ecx) call npxsave - popl %ecx + addl $4,%esp popl %edx /* recover our pcb */ 1: popfl From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 20:06:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B5D9106566B; Fri, 28 Jan 2011 20:06:39 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A3548FC12; Fri, 28 Jan 2011 20:06:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SK6dxQ098232; Fri, 28 Jan 2011 20:06:39 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SK6d6S098229; Fri, 28 Jan 2011 20:06:39 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282006.p0SK6d6S098229@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:06:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218033 - stable/8/usr.bin/cpuset X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:06:39 -0000 Author: jhb Date: Fri Jan 28 20:06:39 2011 New Revision: 218033 URL: http://svn.freebsd.org/changeset/base/218033 Log: MFC 217416: Add two more features to cpuset(1): - Add a new -C flag to create a new cpuset and move an existing pid into that set. - Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all) which maps to the list of all CPUs in the system. Modified: stable/8/usr.bin/cpuset/cpuset.1 stable/8/usr.bin/cpuset/cpuset.c Directory Properties: stable/8/usr.bin/cpuset/ (props changed) Modified: stable/8/usr.bin/cpuset/cpuset.1 ============================================================================== --- stable/8/usr.bin/cpuset/cpuset.1 Fri Jan 28 19:53:38 2011 (r218032) +++ stable/8/usr.bin/cpuset/cpuset.1 Fri Jan 28 20:06:39 2011 (r218033) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 14, 2011 .Dt CPUSET 1 .Os .Sh NAME @@ -41,6 +41,11 @@ .Op Fl s Ar setid .Fl p Ar pid .Nm +.Op Fl c +.Op Fl l Ar cpu-list +.Fl C +.Fl p Ar pid +.Nm .Op Fl cr .Op Fl l Ar cpu-list .Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq @@ -98,6 +103,8 @@ for the thread. .Pp The options are as follows: .Bl -tag -width ".Fl l Ar cpu-list" +.It Fl C +Create a new cpuset and assign the target process to that set. .It Fl c The requested operation should reference the cpuset available via the target specifier. @@ -117,6 +124,9 @@ Specifies a jail id as the target of the Specifies a list of CPUs to apply to a target. Specification may include numbers separated by '-' for ranges and commas separating individual numbers. +A special list of +.Dq all +may be specified in which case the list includes all CPUs from the root set. .It Fl p Ar pid Specifies a pid as the target of the operation. .It Fl s Ar setid @@ -168,6 +178,11 @@ into the specified cpuset .Ar setid so it may be managed with other pids in that set: .Dl cpuset -s -p +.Pp +Create a new cpuset that is restricted to CPUs 0 and 2 and move +.Ar pid +into the new set: +.Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO .Xr cpuset 2 .Sh HISTORY Modified: stable/8/usr.bin/cpuset/cpuset.c ============================================================================== --- stable/8/usr.bin/cpuset/cpuset.c Fri Jan 28 19:53:38 2011 (r218032) +++ stable/8/usr.bin/cpuset/cpuset.c Fri Jan 28 20:06:39 2011 (r218033) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +int Cflag; int cflag; int gflag; int iflag; @@ -72,6 +73,12 @@ parselist(char *list, cpuset_t *mask) int curnum; char *l; + if (strcasecmp(list, "all") == 0) { + if (cpuset_getaffinity(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1, + sizeof(*mask), mask) != 0) + err(EXIT_FAILURE, "getaffinity"); + return; + } state = NONE; curnum = lastnum = 0; for (l = list; *l != '\0';) { @@ -199,8 +206,11 @@ main(int argc, char *argv[]) level = CPU_LEVEL_WHICH; which = CPU_WHICH_PID; id = pid = tid = setid = -1; - while ((ch = getopt(argc, argv, "cgij:l:p:rs:t:x:")) != -1) { + while ((ch = getopt(argc, argv, "Ccgij:l:p:rs:t:x:")) != -1) { switch (ch) { + case 'C': + Cflag = 1; + break; case 'c': if (rflag) usage(); @@ -255,7 +265,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; if (gflag) { - if (argc || lflag) + if (argc || Cflag || lflag) usage(); /* Only one identity specifier. */ if (jflag + xflag + sflag + pflag + tflag > 1) @@ -272,7 +282,7 @@ main(int argc, char *argv[]) * The user wants to run a command with a set and possibly cpumask. */ if (argc) { - if (pflag | rflag | tflag | xflag | jflag) + if (Cflag | pflag | rflag | tflag | xflag | jflag) usage(); if (sflag) { if (cpuset_setid(CPU_WHICH_PID, -1, setid)) @@ -293,9 +303,11 @@ main(int argc, char *argv[]) /* * We're modifying something that presently exists. */ + if (Cflag && (sflag || rflag || !pflag || tflag || xflag || jflag)) + usage(); if (!lflag && (cflag || rflag)) usage(); - if (!lflag && !sflag) + if (!lflag && !(Cflag || sflag)) usage(); /* You can only set a mask on a thread. */ if (tflag && (sflag | pflag | xflag | jflag)) @@ -303,6 +315,15 @@ main(int argc, char *argv[]) /* You can only set a mask on an irq. */ if (xflag && (jflag | pflag | sflag | tflag)) usage(); + if (Cflag) { + /* + * Create a new cpuset and move the specified process + * into the set. + */ + if (cpuset(&setid) < 0) + err(EXIT_FAILURE, "newid"); + sflag = 1; + } if (pflag && sflag) { if (cpuset_setid(CPU_WHICH_PID, pid, setid)) err(EXIT_FAILURE, "setid"); @@ -331,6 +352,8 @@ usage(void) fprintf(stderr, " cpuset [-l cpu-list] [-s setid] -p pid\n"); fprintf(stderr, + " cpuset [-c] [-l cpu-list] -C -p pid\n"); + fprintf(stderr, " cpuset [-cr] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); fprintf(stderr, " cpuset [-cgir] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 20:06:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DA6F1065675; Fri, 28 Jan 2011 20:06:51 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C6F18FC0C; Fri, 28 Jan 2011 20:06:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SK6pZX098272; Fri, 28 Jan 2011 20:06:51 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SK6pEq098269; Fri, 28 Jan 2011 20:06:51 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282006.p0SK6pEq098269@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:06:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218034 - stable/7/usr.bin/cpuset X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:06:51 -0000 Author: jhb Date: Fri Jan 28 20:06:51 2011 New Revision: 218034 URL: http://svn.freebsd.org/changeset/base/218034 Log: MFC 217416: Add two more features to cpuset(1): - Add a new -C flag to create a new cpuset and move an existing pid into that set. - Allow 'all' to be specified for a cpu list (e.g. cpuset -s 1 -l all) which maps to the list of all CPUs in the system. Modified: stable/7/usr.bin/cpuset/cpuset.1 stable/7/usr.bin/cpuset/cpuset.c Directory Properties: stable/7/usr.bin/cpuset/ (props changed) Modified: stable/7/usr.bin/cpuset/cpuset.1 ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.1 Fri Jan 28 20:06:39 2011 (r218033) +++ stable/7/usr.bin/cpuset/cpuset.1 Fri Jan 28 20:06:51 2011 (r218034) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 29, 2008 +.Dd January 14, 2011 .Dt CPUSET 1 .Os .Sh NAME @@ -41,6 +41,11 @@ .Op Fl s Ar setid .Fl p Ar pid .Nm +.Op Fl c +.Op Fl l Ar cpu-list +.Fl C +.Fl p Ar pid +.Nm .Op Fl cr .Op Fl l Ar cpu-list .Op Fl j Ar jailid | Fl p Ar pid | Fl t Ar tid | Fl s Ar setid | Fl x Ar irq @@ -98,6 +103,8 @@ for the thread. .Pp The options are as follows: .Bl -tag -width ".Fl l Ar cpu-list" +.It Fl C +Create a new cpuset and assign the target process to that set. .It Fl c The requested operation should reference the cpuset available via the target specifier. @@ -117,6 +124,9 @@ Specifies a jail id as the target of the Specifies a list of CPUs to apply to a target. Specification may include numbers separated by '-' for ranges and commas separating individual numbers. +A special list of +.Dq all +may be specified in which case the list includes all CPUs from the root set. .It Fl p Ar pid Specifies a pid as the target of the operation. .It Fl s Ar setid @@ -168,6 +178,11 @@ into the specified cpuset .Ar setid so it may be managed with other pids in that set: .Dl cpuset -s -p +.Pp +Create a new cpuset that is restricted to CPUs 0 and 2 and move +.Ar pid +into the new set: +.Dl cpuset -C -c -l 0,2 -p .Sh SEE ALSO .Xr cpuset 2 .Sh HISTORY Modified: stable/7/usr.bin/cpuset/cpuset.c ============================================================================== --- stable/7/usr.bin/cpuset/cpuset.c Fri Jan 28 20:06:39 2011 (r218033) +++ stable/7/usr.bin/cpuset/cpuset.c Fri Jan 28 20:06:51 2011 (r218034) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +int Cflag; int cflag; int gflag; int iflag; @@ -72,6 +73,12 @@ parselist(char *list, cpuset_t *mask) int curnum; char *l; + if (strcasecmp(list, "all") == 0) { + if (cpuset_getaffinity(CPU_LEVEL_ROOT, CPU_WHICH_PID, -1, + sizeof(*mask), mask) != 0) + err(EXIT_FAILURE, "getaffinity"); + return; + } state = NONE; curnum = lastnum = 0; for (l = list; *l != '\0';) { @@ -199,8 +206,11 @@ main(int argc, char *argv[]) level = CPU_LEVEL_WHICH; which = CPU_WHICH_PID; id = pid = tid = setid = -1; - while ((ch = getopt(argc, argv, "cgij:l:p:rs:t:x:")) != -1) { + while ((ch = getopt(argc, argv, "Ccgij:l:p:rs:t:x:")) != -1) { switch (ch) { + case 'C': + Cflag = 1; + break; case 'c': if (rflag) usage(); @@ -255,7 +265,7 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; if (gflag) { - if (argc || lflag) + if (argc || Cflag || lflag) usage(); /* Only one identity specifier. */ if (jflag + xflag + sflag + pflag + tflag > 1) @@ -272,7 +282,7 @@ main(int argc, char *argv[]) * The user wants to run a command with a set and possibly cpumask. */ if (argc) { - if (pflag | rflag | tflag | xflag | jflag) + if (Cflag | pflag | rflag | tflag | xflag | jflag) usage(); if (sflag) { if (cpuset_setid(CPU_WHICH_PID, -1, setid)) @@ -293,9 +303,11 @@ main(int argc, char *argv[]) /* * We're modifying something that presently exists. */ + if (Cflag && (sflag || rflag || !pflag || tflag || xflag || jflag)) + usage(); if (!lflag && (cflag || rflag)) usage(); - if (!lflag && !sflag) + if (!lflag && !(Cflag || sflag)) usage(); /* You can only set a mask on a thread. */ if (tflag && (sflag | pflag | xflag | jflag)) @@ -303,6 +315,15 @@ main(int argc, char *argv[]) /* You can only set a mask on an irq. */ if (xflag && (jflag | pflag | sflag | tflag)) usage(); + if (Cflag) { + /* + * Create a new cpuset and move the specified process + * into the set. + */ + if (cpuset(&setid) < 0) + err(EXIT_FAILURE, "newid"); + sflag = 1; + } if (pflag && sflag) { if (cpuset_setid(CPU_WHICH_PID, pid, setid)) err(EXIT_FAILURE, "setid"); @@ -331,6 +352,8 @@ usage(void) fprintf(stderr, " cpuset [-l cpu-list] [-s setid] -p pid\n"); fprintf(stderr, + " cpuset [-c] [-l cpu-list] -C -p pid\n"); + fprintf(stderr, " cpuset [-cr] [-l cpu-list] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); fprintf(stderr, " cpuset [-cgir] [-j jailid | -p pid | -t tid | -s setid | -x irq]\n"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 20:21:42 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4906E106564A; Fri, 28 Jan 2011 20:21:42 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 383508FC17; Fri, 28 Jan 2011 20:21:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SKLgAi098777; Fri, 28 Jan 2011 20:21:42 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SKLg5B098775; Fri, 28 Jan 2011 20:21:42 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282021.p0SKLg5B098775@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:21:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218035 - stable/8/sys/gnu/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:21:42 -0000 Author: jhb Date: Fri Jan 28 20:21:41 2011 New Revision: 218035 URL: http://svn.freebsd.org/changeset/base/218035 Log: MFC 217702: Restore support for the 'async' and 'sync' mount options lost when switching to nmount(2). While here, sort the options. Modified: stable/8/sys/gnu/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:06:51 2011 (r218034) +++ stable/8/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:21:41 2011 (r218035) @@ -114,9 +114,9 @@ static int ext2_check_sb_compat(struct e static int compute_sb_data(struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs); -static const char *ext2_opts[] = { "from", "export", "acls", "noexec", - "noatime", "union", "suiddir", "multilabel", "nosymfollow", - "noclusterr", "noclusterw", "force", NULL }; +static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", + "noclusterw", "noexec", "export", "force", "from", "multilabel", + "suiddir", "nosymfollow", "sync", "union", NULL }; /* * VFS Operations. From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 20:22:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8E5B9106564A; Fri, 28 Jan 2011 20:22:03 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D6228FC14; Fri, 28 Jan 2011 20:22:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SKM3Vo098836; Fri, 28 Jan 2011 20:22:03 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SKM3Y1098834; Fri, 28 Jan 2011 20:22:03 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201101282022.p0SKM3Y1098834@svn.freebsd.org> From: John Baldwin Date: Fri, 28 Jan 2011 20:22:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218036 - stable/7/sys/gnu/fs/ext2fs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:22:03 -0000 Author: jhb Date: Fri Jan 28 20:22:03 2011 New Revision: 218036 URL: http://svn.freebsd.org/changeset/base/218036 Log: MFC 217702: Restore support for the 'async' and 'sync' mount options lost when switching to nmount(2). While here, sort the options. Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c ============================================================================== --- stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:21:41 2011 (r218035) +++ stable/7/sys/gnu/fs/ext2fs/ext2_vfsops.c Fri Jan 28 20:22:03 2011 (r218036) @@ -114,9 +114,9 @@ static int ext2_check_sb_compat(struct e static int compute_sb_data(struct vnode * devvp, struct ext2_super_block * es, struct ext2_sb_info * fs); -static const char *ext2_opts[] = { "from", "export", "acls", "noexec", - "noatime", "union", "suiddir", "multilabel", "nosymfollow", - "noclusterr", "noclusterw", "force", NULL }; +static const char *ext2_opts[] = { "acls", "async", "noatime", "noclusterr", + "noclusterw", "noexec", "export", "force", "from", "multilabel", + "suiddir", "nosymfollow", "sync", "union", NULL }; /* * VFS Operations. From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 20:49:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D0BA2106564A; Fri, 28 Jan 2011 20:49:15 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A6A2C8FC1A; Fri, 28 Jan 2011 20:49:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SKnF0D099579; Fri, 28 Jan 2011 20:49:15 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SKnFBS099576; Fri, 28 Jan 2011 20:49:15 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101282049.p0SKnFBS099576@svn.freebsd.org> From: Randall Stewart Date: Fri, 28 Jan 2011 20:49:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218037 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 20:49:15 -0000 Author: rrs Date: Fri Jan 28 20:49:15 2011 New Revision: 218037 URL: http://svn.freebsd.org/changeset/base/218037 Log: Fix a bug in the way ECN-Echo chunk sends were being accounted for. The counting was such that we counted only when we queued a chunk, not when we sent it. Now keep an additional counter for queuing and one for sending. MFC after: 1 week Modified: head/sys/netinet/sctp_output.c head/sys/netinet/sctp_uio.h Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Fri Jan 28 20:22:03 2011 (r218036) +++ head/sys/netinet/sctp_output.c Fri Jan 28 20:49:15 2011 (r218037) @@ -7809,6 +7809,20 @@ again_one_more_time: if (chk->rec.chunk_id.id == SCTP_COOKIE_ECHO) { cookie = 1; no_out_cnt = 1; + } else if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + /* + * Increment ecne send count + * here this means we may be + * over-zealous in our + * counting if the send + * fails, but its the best + * place to do it (we used + * to do it in the queue of + * the chunk, but that did + * not tell how many times + * it was sent. + */ + SCTP_STAT_INCR(sctps_sendecne); } chk->sent = SCTP_DATAGRAM_SENT; chk->snd_count++; @@ -10751,6 +10765,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb /* found a previous ECN_ECHO update it if needed */ ecne = mtod(chk->data, struct sctp_ecne_chunk *); ecne->tsn = htonl(high_tsn); + SCTP_STAT_INCR(sctps_queue_upd_ecne); return; } } @@ -10760,7 +10775,7 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb return; } chk->copy_by_ref = 0; - SCTP_STAT_INCR(sctps_sendecne); + SCTP_STAT_INCR(sctps_queue_upd_ecne); chk->rec.chunk_id.id = SCTP_ECN_ECHO; chk->rec.chunk_id.can_take_data = 0; chk->asoc = &stcb->asoc; Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Fri Jan 28 20:22:03 2011 (r218036) +++ head/sys/netinet/sctp_uio.h Fri Jan 28 20:49:15 2011 (r218037) @@ -946,8 +946,9 @@ struct sctpstat { * max burst inflight to net */ uint32_t sctps_fwdtsn_map_over; /* number of map array over-runs via * fwd-tsn's */ - - uint32_t sctps_reserved[32]; /* Future ABI compat - remove int's + uint32_t sctps_queue_upd_ecne; /* Number of times we queued or + * updated an ECN chunk on send queue */ + uint32_t sctps_reserved[31]; /* Future ABI compat - remove int's * from here when adding new */ }; From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:03:32 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB800106564A; Fri, 28 Jan 2011 21:03:32 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB6758FC0A; Fri, 28 Jan 2011 21:03:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SL3Wmx099988; Fri, 28 Jan 2011 21:03:32 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SL3Wwv099986; Fri, 28 Jan 2011 21:03:32 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201101282103.p0SL3Wwv099986@svn.freebsd.org> From: Pyun YongHyeon Date: Fri, 28 Jan 2011 21:03:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218038 - head/sys/dev/alc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:03:33 -0000 Author: yongari Date: Fri Jan 28 21:03:32 2011 New Revision: 218038 URL: http://svn.freebsd.org/changeset/base/218038 Log: Fix logic error. Due to the bug, it incorrectly checked TXQ status which in turn can leave TXQ active. Submitted by: Brad ( brad <> comstyle dot com ) MFC after: 3 days Modified: head/sys/dev/alc/if_alc.c Modified: head/sys/dev/alc/if_alc.c ============================================================================== --- head/sys/dev/alc/if_alc.c Fri Jan 28 20:49:15 2011 (r218037) +++ head/sys/dev/alc/if_alc.c Fri Jan 28 21:03:32 2011 (r218038) @@ -3556,7 +3556,7 @@ alc_stop_queue(struct alc_softc *sc) } /* Disable TxQ. */ reg = CSR_READ_4(sc, ALC_TXQ_CFG); - if ((reg & TXQ_CFG_ENB) == 0) { + if ((reg & TXQ_CFG_ENB) != 0) { reg &= ~TXQ_CFG_ENB; CSR_WRITE_4(sc, ALC_TXQ_CFG, reg); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:05:22 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 46F2A106566C; Fri, 28 Jan 2011 21:05:22 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3712D8FC1B; Fri, 28 Jan 2011 21:05:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SL5MjI000170; Fri, 28 Jan 2011 21:05:22 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SL5MHZ000167; Fri, 28 Jan 2011 21:05:22 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101282105.p0SL5MHZ000167@svn.freebsd.org> From: Randall Stewart Date: Fri, 28 Jan 2011 21:05:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218039 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:05:22 -0000 Author: rrs Date: Fri Jan 28 21:05:21 2011 New Revision: 218039 URL: http://svn.freebsd.org/changeset/base/218039 Log: Keep track of the real last RTT on each net. This will be used for Data Center congestion control, we won't want to engage it in the ECN code unless we KNOW that the RTT is less than 500us. MFC after: 1 week Modified: head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Fri Jan 28 21:03:32 2011 (r218038) +++ head/sys/netinet/sctp_structs.h Fri Jan 28 21:05:21 2011 (r218039) @@ -266,7 +266,7 @@ struct sctp_nets { uint32_t tos_flowlabel; struct timeval start_time; /* time when this net was created */ - + struct timeval last_measured_rtt; uint32_t marked_retrans;/* number or DATA chunks marked for timer * based retransmissions */ uint32_t marked_fastretrans; Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Fri Jan 28 21:03:32 2011 (r218038) +++ head/sys/netinet/sctputil.c Fri Jan 28 21:05:21 2011 (r218039) @@ -2500,6 +2500,13 @@ sctp_calculate_rto(struct sctp_tcb *stcb /************************/ /* get the current time */ (void)SCTP_GETTIME_TIMEVAL(&now); + + /* + * Record the real time of the last RTT for use in DC-CC. + */ + net->last_measured_rtt = now; + timevalsub(&net->last_measured_rtt, old); + /* compute the RTT value */ if ((u_long)now.tv_sec > (u_long)old->tv_sec) { calc_time = ((u_long)now.tv_sec - (u_long)old->tv_sec) * 1000; From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:36:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1DF8B106564A; Fri, 28 Jan 2011 21:36:02 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0E1C58FC0C; Fri, 28 Jan 2011 21:36:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLa1KH000889; Fri, 28 Jan 2011 21:36:01 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLa15i000887; Fri, 28 Jan 2011 21:36:01 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282136.p0SLa15i000887@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:36:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218040 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:36:02 -0000 Author: pjd Date: Fri Jan 28 21:36:01 2011 New Revision: 218040 URL: http://svn.freebsd.org/changeset/base/218040 Log: Initialize all global variables on pjdlog_init(). MFC after: 1 week Modified: head/sbin/hastd/pjdlog.c Modified: head/sbin/hastd/pjdlog.c ============================================================================== --- head/sbin/hastd/pjdlog.c Fri Jan 28 21:05:21 2011 (r218039) +++ head/sbin/hastd/pjdlog.c Fri Jan 28 21:36:01 2011 (r218040) @@ -43,8 +43,7 @@ __FBSDID("$FreeBSD$"); #include "pjdlog.h" static bool pjdlog_initialized = false; -static int pjdlog_mode = PJDLOG_MODE_STD; -static int pjdlog_debug_level = 0; +static int pjdlog_mode, pjdlog_debug_level; static char pjdlog_prefix[128]; void @@ -57,6 +56,8 @@ pjdlog_init(int mode) if (mode == PJDLOG_MODE_SYSLOG) openlog(NULL, LOG_PID | LOG_NDELAY, LOG_DAEMON); pjdlog_mode = mode; + pjdlog_debug_level = 0; + bzero(pjdlog_prefix, sizeof(pjdlog_prefix)); pjdlog_initialized = true; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:48:15 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF8E1106564A; Fri, 28 Jan 2011 21:48:15 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 953568FC12; Fri, 28 Jan 2011 21:48:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLmFoc001195; Fri, 28 Jan 2011 21:48:15 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLmF8W001192; Fri, 28 Jan 2011 21:48:15 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282148.p0SLmF8W001192@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:48:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218041 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:48:15 -0000 Author: pjd Date: Fri Jan 28 21:48:15 2011 New Revision: 218041 URL: http://svn.freebsd.org/changeset/base/218041 Log: Add function to close all unneeded descriptors after fork(2). MFC after: 1 week Modified: head/sbin/hastd/hastd.c head/sbin/hastd/hastd.h Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Fri Jan 28 21:36:01 2011 (r218040) +++ head/sbin/hastd/hastd.c Fri Jan 28 21:48:15 2011 (r218041) @@ -1,6 +1,6 @@ /*- * Copyright (c) 2009-2010 The FreeBSD Foundation - * Copyright (c) 2010 Pawel Jakub Dawidek + * Copyright (c) 2010-2011 Pawel Jakub Dawidek * All rights reserved. * * This software was developed by Pawel Jakub Dawidek under sponsorship from @@ -93,6 +93,32 @@ g_gate_load(void) } } +void +descriptors_cleanup(struct hast_resource *res) +{ + struct hast_resource *tres; + + TAILQ_FOREACH(tres, &cfg->hc_resources, hr_next) { + if (tres == res) { + PJDLOG_VERIFY(res->hr_role == HAST_ROLE_SECONDARY || + (res->hr_remotein == NULL && + res->hr_remoteout == NULL)); + continue; + } + if (tres->hr_remotein != NULL) + proto_close(tres->hr_remotein); + if (tres->hr_remoteout != NULL) + proto_close(tres->hr_remoteout); + } + if (cfg->hc_controlin != NULL) + proto_close(cfg->hc_controlin); + proto_close(cfg->hc_controlconn); + proto_close(cfg->hc_listenconn); + (void)pidfile_close(pfh); + hook_fini(); + pjdlog_fini(); +} + static void child_exit_log(unsigned int pid, int status) { Modified: head/sbin/hastd/hastd.h ============================================================================== --- head/sbin/hastd/hastd.h Fri Jan 28 21:36:01 2011 (r218040) +++ head/sbin/hastd/hastd.h Fri Jan 28 21:48:15 2011 (r218041) @@ -43,6 +43,8 @@ extern const char *cfgpath; extern bool sigexit_received; extern struct pidfh *pfh; +void descriptors_cleanup(struct hast_resource *res); + void hastd_primary(struct hast_resource *res); void hastd_secondary(struct hast_resource *res, struct nv *nvin); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:51:41 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 031C6106566B; Fri, 28 Jan 2011 21:51:41 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E73C68FC0A; Fri, 28 Jan 2011 21:51:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLpe5Y001333; Fri, 28 Jan 2011 21:51:40 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLpeSG001331; Fri, 28 Jan 2011 21:51:40 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282151.p0SLpeSG001331@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:51:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218042 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:51:41 -0000 Author: pjd Date: Fri Jan 28 21:51:40 2011 New Revision: 218042 URL: http://svn.freebsd.org/changeset/base/218042 Log: Add comments to places where we treat errors as ciritical, but it is possible to handle them more gracefully. MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jan 28 21:48:15 2011 (r218041) +++ head/sbin/hastd/primary.c Fri Jan 28 21:51:40 2011 (r218042) @@ -796,6 +796,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel between parent and child. */ if (proto_client("socketpair://", &res->hr_ctrl) < 0) { + /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to create control sockets between parent and child"); @@ -804,6 +805,7 @@ hastd_primary(struct hast_resource *res) * Create communication channel between child and parent. */ if (proto_client("socketpair://", &res->hr_event) < 0) { + /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_OSERR, "Unable to create event sockets between child and parent"); @@ -811,6 +813,7 @@ hastd_primary(struct hast_resource *res) pid = fork(); if (pid < 0) { + /* TODO: There's no need for this to be fatal error. */ KEEP_ERRNO((void)pidfile_remove(pfh)); pjdlog_exit(EX_TEMPFAIL, "Unable to fork"); } From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:52:37 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B7D14106564A; Fri, 28 Jan 2011 21:52:37 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8D5928FC23; Fri, 28 Jan 2011 21:52:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLqb0e001392; Fri, 28 Jan 2011 21:52:37 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLqbs1001389; Fri, 28 Jan 2011 21:52:37 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282152.p0SLqbs1001389@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:52:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218043 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:52:37 -0000 Author: pjd Date: Fri Jan 28 21:52:37 2011 New Revision: 218043 URL: http://svn.freebsd.org/changeset/base/218043 Log: Close all unneeded descriptors after fork(2). MFC after: 1 week Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jan 28 21:51:40 2011 (r218042) +++ head/sbin/hastd/primary.c Fri Jan 28 21:52:37 2011 (r218043) @@ -790,7 +790,7 @@ hastd_primary(struct hast_resource *res) { pthread_t td; pid_t pid; - int error; + int error, mode; /* * Create communication channel between parent and child. @@ -822,19 +822,24 @@ hastd_primary(struct hast_resource *res) /* This is parent. */ /* Declare that we are receiver. */ proto_recv(res->hr_event, NULL, 0); + /* Declare that we are sender. */ + proto_send(res->hr_ctrl, NULL, 0); res->hr_workerpid = pid; return; } gres = res; - - (void)pidfile_close(pfh); - hook_fini(); - - setproctitle("%s (primary)", res->hr_name); + mode = pjdlog_mode_get(); /* Declare that we are sender. */ proto_send(res->hr_event, NULL, 0); + /* Declare that we are receiver. */ + proto_recv(res->hr_ctrl, NULL, 0); + descriptors_cleanup(res); + + pjdlog_init(mode); + pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); + setproctitle("%s (primary)", res->hr_name); init_local(res); init_ggate(res); Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jan 28 21:51:40 2011 (r218042) +++ head/sbin/hastd/secondary.c Fri Jan 28 21:52:37 2011 (r218043) @@ -347,7 +347,7 @@ hastd_secondary(struct hast_resource *re sigset_t mask; pthread_t td; pid_t pid; - int error; + int error, mode; /* * Create communication channel between parent and child. @@ -380,23 +380,28 @@ hastd_secondary(struct hast_resource *re res->hr_remoteout = NULL; /* Declare that we are receiver. */ proto_recv(res->hr_event, NULL, 0); + /* Declare that we are sender. */ + proto_send(res->hr_ctrl, NULL, 0); res->hr_workerpid = pid; return; } gres = res; + mode = pjdlog_mode_get(); - (void)pidfile_close(pfh); - hook_fini(); + /* Declare that we are sender. */ + proto_send(res->hr_event, NULL, 0); + /* Declare that we are receiver. */ + proto_recv(res->hr_ctrl, NULL, 0); + descriptors_cleanup(res); + pjdlog_init(mode); + pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); setproctitle("%s (secondary)", res->hr_name); PJDLOG_VERIFY(sigemptyset(&mask) == 0); PJDLOG_VERIFY(sigprocmask(SIG_SETMASK, &mask, NULL) == 0); - /* Declare that we are sender. */ - proto_send(res->hr_event, NULL, 0); - /* Error in setting timeout is not critical, but why should it fail? */ if (proto_timeout(res->hr_remotein, 0) < 0) pjdlog_errno(LOG_WARNING, "Unable to set connection timeout"); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:56:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B2A7B106564A; Fri, 28 Jan 2011 21:56:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 96A7F8FC08; Fri, 28 Jan 2011 21:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLulBF001550; Fri, 28 Jan 2011 21:56:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLulCc001547; Fri, 28 Jan 2011 21:56:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282156.p0SLulCc001547@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218044 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:56:47 -0000 Author: pjd Date: Fri Jan 28 21:56:47 2011 New Revision: 218044 URL: http://svn.freebsd.org/changeset/base/218044 Log: Add function to assert that the only descriptors we have open are the ones we expect to be open. Also assert that they point at expected type. Because openlog(3) API is unable to tell us descriptor number it is using, we have to close syslog socket, remember assert message in local buffer and if we fail on assertion, reopen syslog socket and log the message. MFC after: 1 week Modified: head/sbin/hastd/hastd.c head/sbin/hastd/hastd.h Modified: head/sbin/hastd/hastd.c ============================================================================== --- head/sbin/hastd/hastd.c Fri Jan 28 21:52:37 2011 (r218043) +++ head/sbin/hastd/hastd.c Fri Jan 28 21:56:47 2011 (r218044) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -119,6 +120,146 @@ descriptors_cleanup(struct hast_resource pjdlog_fini(); } +static const char * +dtype2str(mode_t mode) +{ + + if (S_ISBLK(mode)) + return ("block device"); + else if (S_ISCHR(mode)) + return ("character device"); + else if (S_ISDIR(mode)) + return ("directory"); + else if (S_ISFIFO(mode)) + return ("pipe or FIFO"); + else if (S_ISLNK(mode)) + return ("symbolic link"); + else if (S_ISREG(mode)) + return ("regular file"); + else if (S_ISSOCK(mode)) + return ("socket"); + else if (S_ISWHT(mode)) + return ("whiteout"); + else + return ("unknown"); +} + +void +descriptors_assert(const struct hast_resource *res, int pjdlogmode) +{ + char msg[256]; + struct stat sb; + long maxfd; + bool isopen; + mode_t mode; + int fd; + + /* + * At this point descriptor to syslog socket is closed, so if we want + * to log assertion message, we have to first store it in 'msg' local + * buffer and then open syslog socket and log it. + */ + msg[0] = '\0'; + + maxfd = sysconf(_SC_OPEN_MAX); + if (maxfd < 0) { + pjdlog_errno(LOG_WARNING, "sysconf(_SC_OPEN_MAX) failed"); + maxfd = 16384; + } + for (fd = 0; fd <= maxfd; fd++) { + if (fstat(fd, &sb) == 0) { + isopen = true; + mode = sb.st_mode; + } else if (errno == EBADF) { + isopen = false; + mode = 0; + } else { + isopen = true; /* silence gcc */ + mode = 0; /* silence gcc */ + snprintf(msg, sizeof(msg), + "Unable to fstat descriptor %d: %s", fd, + strerror(errno)); + } + if (fd == STDIN_FILENO || fd == STDOUT_FILENO || + fd == STDERR_FILENO) { + if (!isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d (%s) is closed, but should be open.", + fd, (fd == STDIN_FILENO ? "stdin" : + (fd == STDOUT_FILENO ? "stdout" : "stderr"))); + break; + } + } else if (fd == proto_descriptor(res->hr_event)) { + if (!isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d (event) is closed, but should be open.", + fd); + break; + } + if (!S_ISSOCK(mode)) { + snprintf(msg, sizeof(msg), + "Descriptor %d (event) is %s, but should be %s.", + fd, dtype2str(mode), dtype2str(S_IFSOCK)); + break; + } + } else if (fd == proto_descriptor(res->hr_ctrl)) { + if (!isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d (ctrl) is closed, but should be open.", + fd); + break; + } + if (!S_ISSOCK(mode)) { + snprintf(msg, sizeof(msg), + "Descriptor %d (ctrl) is %s, but should be %s.", + fd, dtype2str(mode), dtype2str(S_IFSOCK)); + break; + } + } else if (res->hr_role == HAST_ROLE_SECONDARY && + fd == proto_descriptor(res->hr_remotein)) { + if (!isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d (remote in) is closed, but should be open.", + fd); + break; + } + if (!S_ISSOCK(mode)) { + snprintf(msg, sizeof(msg), + "Descriptor %d (remote in) is %s, but should be %s.", + fd, dtype2str(mode), dtype2str(S_IFSOCK)); + break; + } + } else if (res->hr_role == HAST_ROLE_SECONDARY && + fd == proto_descriptor(res->hr_remoteout)) { + if (!isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d (remote out) is closed, but should be open.", + fd); + break; + } + if (!S_ISSOCK(mode)) { + snprintf(msg, sizeof(msg), + "Descriptor %d (remote out) is %s, but should be %s.", + fd, dtype2str(mode), dtype2str(S_IFSOCK)); + break; + } + } else { + if (isopen) { + snprintf(msg, sizeof(msg), + "Descriptor %d is open (%s), but should be closed.", + fd, dtype2str(mode)); + break; + } + } + } + if (msg[0] != '\0') { + pjdlog_init(pjdlogmode); + pjdlog_prefix_set("[%s] (%s) ", res->hr_name, + role2str(res->hr_role)); + PJDLOG_ABORT("%s", msg); + } +} + static void child_exit_log(unsigned int pid, int status) { Modified: head/sbin/hastd/hastd.h ============================================================================== --- head/sbin/hastd/hastd.h Fri Jan 28 21:52:37 2011 (r218043) +++ head/sbin/hastd/hastd.h Fri Jan 28 21:56:47 2011 (r218044) @@ -44,6 +44,7 @@ extern bool sigexit_received; extern struct pidfh *pfh; void descriptors_cleanup(struct hast_resource *res); +void descriptors_assert(const struct hast_resource *res, int pjdlogmode); void hastd_primary(struct hast_resource *res); void hastd_secondary(struct hast_resource *res, struct nv *nvin); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 21:57:43 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0524E106566C; Fri, 28 Jan 2011 21:57:43 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E96CE8FC13; Fri, 28 Jan 2011 21:57:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SLvgNJ001616; Fri, 28 Jan 2011 21:57:42 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SLvgvI001613; Fri, 28 Jan 2011 21:57:42 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282157.p0SLvgvI001613@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 21:57:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218045 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 21:57:43 -0000 Author: pjd Date: Fri Jan 28 21:57:42 2011 New Revision: 218045 URL: http://svn.freebsd.org/changeset/base/218045 Log: Use newly added descriptors_assert() function to ensure only expected descriptors are open. MFC after: 1 week Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jan 28 21:56:47 2011 (r218044) +++ head/sbin/hastd/primary.c Fri Jan 28 21:57:42 2011 (r218045) @@ -837,6 +837,8 @@ hastd_primary(struct hast_resource *res) proto_recv(res->hr_ctrl, NULL, 0); descriptors_cleanup(res); + descriptors_assert(res, mode); + pjdlog_init(mode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); setproctitle("%s (primary)", res->hr_name); Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jan 28 21:56:47 2011 (r218044) +++ head/sbin/hastd/secondary.c Fri Jan 28 21:57:42 2011 (r218045) @@ -395,6 +395,8 @@ hastd_secondary(struct hast_resource *re proto_recv(res->hr_ctrl, NULL, 0); descriptors_cleanup(res); + descriptors_assert(res, mode); + pjdlog_init(mode); pjdlog_prefix_set("[%s] (%s) ", res->hr_name, role2str(res->hr_role)); setproctitle("%s (secondary)", res->hr_name); From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 22:28:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22758106564A; Fri, 28 Jan 2011 22:28:13 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 129348FC13; Fri, 28 Jan 2011 22:28:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SMSC32002595; Fri, 28 Jan 2011 22:28:12 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SMSCe6002592; Fri, 28 Jan 2011 22:28:12 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282228.p0SMSCe6002592@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 22:28:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218046 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 22:28:13 -0000 Author: pjd Date: Fri Jan 28 22:28:12 2011 New Revision: 218046 URL: http://svn.freebsd.org/changeset/base/218046 Log: Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl) to drop privileges. MFC after: 1 week Modified: head/etc/group head/etc/master.passwd Modified: head/etc/group ============================================================================== --- head/etc/group Fri Jan 28 21:57:42 2011 (r218045) +++ head/etc/group Fri Jan 28 22:28:12 2011 (r218046) @@ -27,5 +27,6 @@ dialer:*:68: network:*:69: audit:*:77: www:*:80: +hast:*:845: nogroup:*:65533: nobody:*:65534: Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Fri Jan 28 21:57:42 2011 (r218045) +++ head/etc/master.passwd Fri Jan 28 22:28:12 2011 (r218046) @@ -20,4 +20,5 @@ _dhcp:*:65:65::0:0:dhcp programs:/var/em uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin +hast:*:845:845::0:0:HAST unprivileged user:/nonexistent:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 22:29:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CC52F1065674; Fri, 28 Jan 2011 22:29:38 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BC9A78FC21; Fri, 28 Jan 2011 22:29:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SMTcxP002665; Fri, 28 Jan 2011 22:29:38 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SMTcUQ002663; Fri, 28 Jan 2011 22:29:38 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282229.p0SMTcUQ002663@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 22:29:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218047 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 22:29:38 -0000 Author: pjd Date: Fri Jan 28 22:29:38 2011 New Revision: 218047 URL: http://svn.freebsd.org/changeset/base/218047 Log: Change hast user home directory to /var/empty. MFC after: 1 week Modified: head/etc/master.passwd Modified: head/etc/master.passwd ============================================================================== --- head/etc/master.passwd Fri Jan 28 22:28:12 2011 (r218046) +++ head/etc/master.passwd Fri Jan 28 22:29:38 2011 (r218047) @@ -20,5 +20,5 @@ _dhcp:*:65:65::0:0:dhcp programs:/var/em uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin -hast:*:845:845::0:0:HAST unprivileged user:/nonexistent:/usr/sbin/nologin +hast:*:845:845::0:0:HAST unprivileged user:/var/empty:/usr/sbin/nologin nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 22:33:48 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E3B881065673; Fri, 28 Jan 2011 22:33:47 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D37EB8FC0C; Fri, 28 Jan 2011 22:33:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SMXlMB002834; Fri, 28 Jan 2011 22:33:47 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SMXl3w002830; Fri, 28 Jan 2011 22:33:47 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282233.p0SMXl3w002830@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 22:33:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218048 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 22:33:48 -0000 Author: pjd Date: Fri Jan 28 22:33:47 2011 New Revision: 218048 URL: http://svn.freebsd.org/changeset/base/218048 Log: Implement function that drops privileges by: - chrooting to /var/empty (user hast home directory), - setting groups to 'hast' (user hast primary group), - setting real group id, effective group id and saved group id to 'hast', - setting real user id, effective user id and saved user id to 'hast'. At the end verify that those operations where successfull. MFC after: 1 week Modified: head/sbin/hastd/hast.h head/sbin/hastd/subr.c head/sbin/hastd/subr.h Modified: head/sbin/hastd/hast.h ============================================================================== --- head/sbin/hastd/hast.h Fri Jan 28 22:29:38 2011 (r218047) +++ head/sbin/hastd/hast.h Fri Jan 28 22:33:47 2011 (r218048) @@ -81,6 +81,7 @@ #define HIO_FLUSH 4 #define HIO_KEEPALIVE 5 +#define HAST_USER "hast" #define HAST_TIMEOUT 5 #define HAST_CONFIG "/etc/hast.conf" #define HAST_CONTROL "/var/run/hastctl" Modified: head/sbin/hastd/subr.c ============================================================================== --- head/sbin/hastd/subr.c Fri Jan 28 22:29:38 2011 (r218047) +++ head/sbin/hastd/subr.c Fri Jan 28 22:33:47 2011 (r218048) @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include @@ -116,3 +118,73 @@ role2str(int role) } return ("unknown"); } + +int +drop_privs(void) +{ + struct passwd *pw; + uid_t ruid, euid, suid; + gid_t rgid, egid, sgid; + gid_t gidset[1]; + + /* + * According to getpwnam(3) we have to clear errno before calling the + * function to be able to distinguish between an error and missing + * entry (with is not treated as error by getpwnam(3)). + */ + errno = 0; + pw = getpwnam(HAST_USER); + if (pw == NULL) { + if (errno != 0) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, + "Unable to find info about '%s' user", HAST_USER)); + return (-1); + } else { + pjdlog_error("'%s' user doesn't exist.", HAST_USER); + errno = ENOENT; + return (-1); + } + } + if (chroot(pw->pw_dir) == -1) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, + "Unable to change root directory to %s", pw->pw_dir)); + return (-1); + } + PJDLOG_VERIFY(chdir("/") == 0); + gidset[0] = pw->pw_gid; + if (setgroups(1, gidset) == -1) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, + "Unable to set groups to gid %u", + (unsigned int)pw->pw_gid)); + return (-1); + } + if (setgid(pw->pw_gid) == -1) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set gid to %u", + (unsigned int)pw->pw_gid)); + return (-1); + } + if (setuid(pw->pw_uid) == -1) { + KEEP_ERRNO(pjdlog_errno(LOG_ERR, "Unable to set uid to %u", + (unsigned int)pw->pw_uid)); + return (-1); + } + + /* + * Better be sure that everything succeeded. + */ + PJDLOG_VERIFY(getresuid(&ruid, &euid, &suid) == 0); + PJDLOG_VERIFY(ruid == pw->pw_uid); + PJDLOG_VERIFY(euid == pw->pw_uid); + PJDLOG_VERIFY(suid == pw->pw_uid); + PJDLOG_VERIFY(getresgid(&rgid, &egid, &sgid) == 0); + PJDLOG_VERIFY(rgid == pw->pw_gid); + PJDLOG_VERIFY(egid == pw->pw_gid); + PJDLOG_VERIFY(sgid == pw->pw_gid); + PJDLOG_VERIFY(getgroups(0, NULL) == 1); + PJDLOG_VERIFY(getgroups(1, gidset) == 1); + PJDLOG_VERIFY(gidset[0] == pw->pw_gid); + + pjdlog_info("Privileges successfully dropped."); + + return (0); +} Modified: head/sbin/hastd/subr.h ============================================================================== --- head/sbin/hastd/subr.h Fri Jan 28 22:29:38 2011 (r218047) +++ head/sbin/hastd/subr.h Fri Jan 28 22:33:47 2011 (r218048) @@ -47,5 +47,6 @@ int provinfo(struct hast_resource *res, bool dowrite); const char *role2str(int role); +int drop_privs(void); #endif /* !_SUBR_H_ */ From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 22:35:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C7191065672; Fri, 28 Jan 2011 22:35:46 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7C5C88FC19; Fri, 28 Jan 2011 22:35:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SMZkoT002923; Fri, 28 Jan 2011 22:35:46 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SMZkeo002920; Fri, 28 Jan 2011 22:35:46 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201101282235.p0SMZkeo002920@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Fri, 28 Jan 2011 22:35:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218049 - head/sbin/hastd X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 22:35:46 -0000 Author: pjd Date: Fri Jan 28 22:35:46 2011 New Revision: 218049 URL: http://svn.freebsd.org/changeset/base/218049 Log: Drop privileges in worker processes. Accepting connections and handshaking in secondary is still done before dropping privileges. It should be implemented by only accepting connections in privileged main process and passing connection descriptors to the worker, but is not implemented yet. MFC after: 1 week Modified: head/sbin/hastd/primary.c head/sbin/hastd/secondary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Fri Jan 28 22:33:47 2011 (r218048) +++ head/sbin/hastd/primary.c Fri Jan 28 22:35:46 2011 (r218049) @@ -847,6 +847,11 @@ hastd_primary(struct hast_resource *res) init_ggate(res); init_environment(res); + if (drop_privs() != 0) { + cleanup(res); + exit(EX_CONFIG); + } + /* * Create the guard thread first, so we can handle signals from the * very begining. Modified: head/sbin/hastd/secondary.c ============================================================================== --- head/sbin/hastd/secondary.c Fri Jan 28 22:33:47 2011 (r218048) +++ head/sbin/hastd/secondary.c Fri Jan 28 22:35:46 2011 (r218049) @@ -413,6 +413,9 @@ hastd_secondary(struct hast_resource *re init_local(res); init_environment(); + if (drop_privs() != 0) + exit(EX_CONFIG); + /* * Create the control thread before sending any event to the parent, * as we can deadlock when parent sends control request to worker, From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 23:40:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F8CB10656BD; Fri, 28 Jan 2011 23:40:13 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E9158FC17; Fri, 28 Jan 2011 23:40:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SNeDh9004818; Fri, 28 Jan 2011 23:40:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SNeDIk004816; Fri, 28 Jan 2011 23:40:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101282340.p0SNeDIk004816@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 28 Jan 2011 23:40:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218050 - head/sys/dev/tsec X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 23:40:13 -0000 Author: marcel Date: Fri Jan 28 23:40:13 2011 New Revision: 218050 URL: http://svn.freebsd.org/changeset/base/218050 Log: Don't use the MAC address in the device tree if it's all zeroes (i.e. 00-00-00-00-00-00). Use the currently programmed address instead. While here, simplify the function. Modified: head/sys/dev/tsec/if_tsec_fdt.c Modified: head/sys/dev/tsec/if_tsec_fdt.c ============================================================================== --- head/sys/dev/tsec/if_tsec_fdt.c Fri Jan 28 22:35:46 2011 (r218049) +++ head/sys/dev/tsec/if_tsec_fdt.c Fri Jan 28 23:40:13 2011 (r218050) @@ -320,17 +320,15 @@ tsec_get_hwaddr(struct tsec_softc *sc, u union { uint32_t reg[2]; uint8_t addr[6]; - } curmac; - uint32_t a[6]; - uint8_t lma[6]; + } hw; int i; - /* - * Retrieve hw address from the device tree. - */ - i = OF_getprop(sc->node, "local-mac-address", (void *)lma, 6); - if (i == 6) { - bcopy(lma, addr, 6); + hw.reg[0] = hw.reg[1] = 0; + + /* Retrieve the hardware address from the device tree. */ + i = OF_getprop(sc->node, "local-mac-address", (void *)hw.addr, 6); + if (i == 6 && (hw.reg[0] != 0 || hw.reg[1] != 0)) { + bcopy(hw.addr, addr, 6); return; } @@ -338,15 +336,8 @@ tsec_get_hwaddr(struct tsec_softc *sc, u * Fall back -- use the currently programmed address in the hope that * it was set be firmware... */ - curmac.reg[0] = TSEC_READ(sc, TSEC_REG_MACSTNADDR1); - curmac.reg[1] = TSEC_READ(sc, TSEC_REG_MACSTNADDR2); + hw.reg[0] = TSEC_READ(sc, TSEC_REG_MACSTNADDR1); + hw.reg[1] = TSEC_READ(sc, TSEC_REG_MACSTNADDR2); for (i = 0; i < 6; i++) - a[5-i] = curmac.addr[i]; - - addr[0] = a[0]; - addr[1] = a[1]; - addr[2] = a[2]; - addr[3] = a[3]; - addr[4] = a[4]; - addr[5] = a[5]; + addr[5-i] = hw.addr[i]; } From owner-svn-src-all@FreeBSD.ORG Fri Jan 28 23:44:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26774106566B; Fri, 28 Jan 2011 23:44:58 +0000 (UTC) (envelope-from kan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 154DD8FC16; Fri, 28 Jan 2011 23:44:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0SNivIa004979; Fri, 28 Jan 2011 23:44:57 GMT (envelope-from kan@svn.freebsd.org) Received: (from kan@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0SNivn9004977; Fri, 28 Jan 2011 23:44:57 GMT (envelope-from kan@svn.freebsd.org) Message-Id: <201101282344.p0SNivn9004977@svn.freebsd.org> From: Alexander Kabaev Date: Fri, 28 Jan 2011 23:44:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218051 - head/libexec/rtld-elf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 23:44:58 -0000 Author: kan Date: Fri Jan 28 23:44:57 2011 New Revision: 218051 URL: http://svn.freebsd.org/changeset/base/218051 Log: Eliminate the use of symlook_needed function in favor of DAGS. Place elements on DAG lists in breadth-first order. This allows us to walk pre-built list in all cases where breadth-first dependency chain enumeration is required. Fix dlsym on special handle obtained by dlopen(NULL, ...) to do what comment claims it does. Take advantage of recently added symlook_global function to iterate over main objects and global DAGs lists properly in search of a symbol. Since rtld itself provides part of the global namespace, search rtld_obj too. Remove recursion from init_dag and symlook_needed functions. Use symlook_needed for ELF filtee processing only and change lookup order used in the function to match the order used by Solaris runtime linker under same circumstances. While there, fix weak symbol handling in the loop so that we return the first weak symbol definition if no strong one was found, instead of the last one. Reviewed by: kib MFC after: 1 month Modified: head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Jan 28 23:40:13 2011 (r218050) +++ head/libexec/rtld-elf/rtld.c Fri Jan 28 23:44:57 2011 (r218051) @@ -93,7 +93,6 @@ static void *fill_search_info(const char static char *find_library(const char *, const Obj_Entry *); static const char *gethints(void); static void init_dag(Obj_Entry *); -static void init_dag1(Obj_Entry *, Obj_Entry *, DoneList *); static void init_rtld(caddr_t, Elf_Auxinfo **); static void initlist_add_neededs(Needed_Entry *, Objlist *); static void initlist_add_objects(Obj_Entry *, Obj_Entry **, Objlist *); @@ -1331,28 +1330,33 @@ gethints(void) static void init_dag(Obj_Entry *root) { + const Needed_Entry *needed; + const Objlist_Entry *elm; DoneList donelist; if (root->dag_inited) return; donelist_init(&donelist); - init_dag1(root, root, &donelist); - root->dag_inited = true; -} -static void -init_dag1(Obj_Entry *root, Obj_Entry *obj, DoneList *dlp) -{ - const Needed_Entry *needed; - - if (donelist_check(dlp, obj)) - return; + /* Root object belongs to own DAG. */ + objlist_push_tail(&root->dldags, root); + objlist_push_tail(&root->dagmembers, root); + donelist_check(&donelist, root); - objlist_push_tail(&obj->dldags, root); - objlist_push_tail(&root->dagmembers, obj); - for (needed = obj->needed; needed != NULL; needed = needed->next) - if (needed->obj != NULL) - init_dag1(root, needed->obj, dlp); + /* + * Add dependencies of root object to DAG in breadth order + * by exploiting the fact that each new object get added + * to the tail of the dagmembers list. + */ + STAILQ_FOREACH(elm, &root->dagmembers, link) { + for (needed = elm->obj->needed; needed != NULL; needed = needed->next) { + if (needed->obj == NULL || donelist_check(&donelist, needed->obj)) + continue; + objlist_push_tail(&needed->obj->dldags, root); + objlist_push_tail(&root->dagmembers, needed->obj); + } + } + root->dag_inited = true; } /* @@ -2320,32 +2324,28 @@ do_dlsym(void *handle, const char *name, donelist_init(&donelist); if (obj->mainprog) { - /* Search main program and all libraries loaded by it. */ - res = symlook_list(&req, &list_main, &donelist); + /* Handle obtained by dlopen(NULL, ...) implies global scope. */ + res = symlook_global(&req, &donelist); if (res == 0) { def = req.sym_out; defobj = req.defobj_out; - } else { - /* - * We do not distinguish between 'main' object and - * global scope. If symbol is not defined by objects - * loaded at startup, continue search among - * dynamically loaded objects with RTLD_GLOBAL scope. - */ - res = symlook_list(&req, &list_global, &donelist); + } + /* + * Search the dynamic linker itself, and possibly resolve the + * symbol from there. This is how the application links to + * dynamic linker services such as dlopen. + */ + if (def == NULL || ELF_ST_BIND(def->st_info) == STB_WEAK) { + res = symlook_obj(&req, &obj_rtld); if (res == 0) { def = req.sym_out; defobj = req.defobj_out; } } - } else { - Needed_Entry fake; - + } + else { /* Search the whole DAG rooted at the given object. */ - fake.next = NULL; - fake.obj = (Obj_Entry *)obj; - fake.name = 0; - res = symlook_needed(&req, &fake, &donelist); + res = symlook_list(&req, &obj->dagmembers, &donelist); if (res == 0) { def = req.sym_out; defobj = req.defobj_out; @@ -2960,53 +2960,33 @@ symlook_list(SymLook *req, const Objlist } /* - * Search the symbol table of a shared object and all objects needed - * by it for a symbol of the given name. Search order is - * breadth-first. Returns a pointer to the symbol, or NULL if no - * definition was found. + * Search the chain of DAGS cointed to by the given Needed_Entry + * for a symbol of the given name. Each DAG is scanned completely + * before advancing to the next one. Returns a pointer to the symbol, + * or NULL if no definition was found. */ static int symlook_needed(SymLook *req, const Needed_Entry *needed, DoneList *dlp) { - const Elf_Sym *def, *def_w; + const Elf_Sym *def; const Needed_Entry *n; - const Obj_Entry *defobj, *defobj1; + const Obj_Entry *defobj; SymLook req1; int res; - def = def_w = NULL; + def = NULL; defobj = NULL; symlook_init_from_req(&req1, req); for (n = needed; n != NULL; n = n->next) { - if (n->obj == NULL || donelist_check(dlp, n->obj) || - (res = symlook_obj(&req1, n->obj)) != 0) + if (n->obj == NULL || + (res = symlook_list(&req1, &n->obj->dagmembers, dlp)) != 0) continue; - def = req1.sym_out; - defobj = req1.defobj_out; - if (ELF_ST_BIND(def->st_info) != STB_WEAK) { - req->defobj_out = defobj; - req->sym_out = def; - return (0); - } - } - /* - * There we come when either symbol definition is not found in - * directly needed objects, or found symbol is weak. - */ - for (n = needed; n != NULL; n = n->next) { - if (n->obj == NULL) - continue; - res = symlook_needed(&req1, n->obj->needed, dlp); - if (res != 0) - continue; - def_w = req1.sym_out; - defobj1 = req1.defobj_out; - if (def == NULL || ELF_ST_BIND(def_w->st_info) != STB_WEAK) { - def = def_w; - defobj = defobj1; + if (def == NULL || ELF_ST_BIND(req1.sym_out->st_info) != STB_WEAK) { + def = req1.sym_out; + defobj = req1.defobj_out; + if (ELF_ST_BIND(def->st_info) != STB_WEAK) + break; } - if (ELF_ST_BIND(def_w->st_info) != STB_WEAK) - break; } if (def != NULL) { req->sym_out = def; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 00:10:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D57E9106564A; Sat, 29 Jan 2011 00:10:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mail.cksoft.de (mail.cksoft.de [IPv6:2001:4068:10::3]) by mx1.freebsd.org (Postfix) with ESMTP id 8968A8FC14; Sat, 29 Jan 2011 00:10:13 +0000 (UTC) Received: from localhost (amavis.fra.cksoft.de [192.168.74.71]) by mail.cksoft.de (Postfix) with ESMTP id C6D4641C705; Sat, 29 Jan 2011 01:10:12 +0100 (CET) X-Virus-Scanned: amavisd-new at cksoft.de Received: from mail.cksoft.de ([192.168.74.103]) by localhost (amavis.fra.cksoft.de [192.168.74.71]) (amavisd-new, port 10024) with ESMTP id rOz9E6-4coyK; Sat, 29 Jan 2011 01:10:12 +0100 (CET) Received: by mail.cksoft.de (Postfix, from userid 66) id 0125341C712; Sat, 29 Jan 2011 01:10:11 +0100 (CET) Received: from maildrop.int.zabbadoz.net (maildrop.int.zabbadoz.net [10.111.66.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.int.zabbadoz.net (Postfix) with ESMTP id BF1B4444900; Sat, 29 Jan 2011 00:10:07 +0000 (UTC) Date: Sat, 29 Jan 2011 00:10:07 +0000 (UTC) From: "Bjoern A. Zeeb" X-X-Sender: bz@maildrop.int.zabbadoz.net To: Pawel Jakub Dawidek In-Reply-To: <201101282228.p0SMSCe6002592@svn.freebsd.org> Message-ID: <20110129000753.R39951@maildrop.int.zabbadoz.net> References: <201101282228.p0SMSCe6002592@svn.freebsd.org> X-OpenPGP-Key: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r218046 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:10:13 -0000 On Fri, 28 Jan 2011, Pawel Jakub Dawidek wrote: > Author: pjd > Date: Fri Jan 28 22:28:12 2011 > New Revision: 218046 > URL: http://svn.freebsd.org/changeset/base/218046 > > Log: > Add 'hast' user and 'hast' group that will be used by hastd (and maybe hastctl) > to drop privileges. Does it really have to be a high number in the 50-1000 range tracked by ports/UIDs ports/GIDs? I am worried that we'll soon end up in a problem with that anyway:( > MFC after: 1 week > > Modified: > head/etc/group > head/etc/master.passwd > > Modified: head/etc/group > ============================================================================== > --- head/etc/group Fri Jan 28 21:57:42 2011 (r218045) > +++ head/etc/group Fri Jan 28 22:28:12 2011 (r218046) > @@ -27,5 +27,6 @@ dialer:*:68: > network:*:69: > audit:*:77: > www:*:80: > +hast:*:845: > nogroup:*:65533: > nobody:*:65534: > > Modified: head/etc/master.passwd > ============================================================================== > --- head/etc/master.passwd Fri Jan 28 21:57:42 2011 (r218045) > +++ head/etc/master.passwd Fri Jan 28 22:28:12 2011 (r218046) > @@ -20,4 +20,5 @@ _dhcp:*:65:65::0:0:dhcp programs:/var/em > uucp:*:66:66::0:0:UUCP pseudo-user:/var/spool/uucppublic:/usr/local/libexec/uucp/uucico > pop:*:68:6::0:0:Post Office Owner:/nonexistent:/usr/sbin/nologin > www:*:80:80::0:0:World Wide Web Owner:/nonexistent:/usr/sbin/nologin > +hast:*:845:845::0:0:HAST unprivileged user:/nonexistent:/usr/sbin/nologin > nobody:*:65534:65534::0:0:Unprivileged user:/nonexistent:/usr/sbin/nologin > -- Bjoern A. Zeeb You have to have visions! Going to jail sucks -- All my daemons like it! http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/jails.html From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 00:39:54 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2489D1065673; Sat, 29 Jan 2011 00:39:54 +0000 (UTC) (envelope-from andy@fud.org.nz) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 6D79F8FC0C; Sat, 29 Jan 2011 00:39:53 +0000 (UTC) Received: by wyf19 with SMTP id 19so3893486wyf.13 for ; Fri, 28 Jan 2011 16:39:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.227.156.67 with SMTP id v3mr3455013wbw.80.1296260222130; Fri, 28 Jan 2011 16:17:02 -0800 (PST) Sender: andy@fud.org.nz Received: by 10.227.156.149 with HTTP; Fri, 28 Jan 2011 16:17:02 -0800 (PST) In-Reply-To: <20110129000753.R39951@maildrop.int.zabbadoz.net> References: <201101282228.p0SMSCe6002592@svn.freebsd.org> <20110129000753.R39951@maildrop.int.zabbadoz.net> Date: Sat, 29 Jan 2011 13:17:02 +1300 X-Google-Sender-Auth: nfftMKjkzQDLYScazpBAhYc8vDM Message-ID: From: Andrew Thompson To: "Bjoern A. Zeeb" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pawel Jakub Dawidek Subject: Re: svn commit: r218046 - head/etc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:39:54 -0000 On 29 January 2011 13:10, Bjoern A. Zeeb wrote: > On Fri, 28 Jan 2011, Pawel Jakub Dawidek wrote: > >> Author: pjd >> Date: Fri Jan 28 22:28:12 2011 >> New Revision: 218046 >> URL: http://svn.freebsd.org/changeset/base/218046 >> >> Log: >> =A0Add 'hast' user and 'hast' group that will be used by hastd (and mayb= e >> hastctl) >> =A0to drop privileges. > > Does it really have to be a high number in the 50-1000 range tracked > by ports/UIDs ports/GIDs? =A0I am worried that we'll soon end up in a > problem with that anyway:( It could be also noted in /usr/ports/UIDS From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 00:46:12 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21E1C1065672; Sat, 29 Jan 2011 00:46:12 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 115C88FC15; Sat, 29 Jan 2011 00:46:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T0kBaM007048; Sat, 29 Jan 2011 00:46:11 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T0kBfM007046; Sat, 29 Jan 2011 00:46:11 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201101290046.p0T0kBfM007046@svn.freebsd.org> From: Andrew Turner Date: Sat, 29 Jan 2011 00:46:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218054 - head/sys/arm/s3c2xx0 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:46:12 -0000 Author: andrew Date: Sat Jan 29 00:46:11 2011 New Revision: 218054 URL: http://svn.freebsd.org/changeset/base/218054 Log: Move the load address of the kernel to the start of KVA as the s3c24x0 copy of initarm expects the kernel to be loaded there. Approved by: imp (mentor) Modified: head/sys/arm/s3c2xx0/std.ln2410sbc Modified: head/sys/arm/s3c2xx0/std.ln2410sbc ============================================================================== --- head/sys/arm/s3c2xx0/std.ln2410sbc Sat Jan 29 00:33:04 2011 (r218053) +++ head/sys/arm/s3c2xx0/std.ln2410sbc Sat Jan 29 00:46:11 2011 (r218054) @@ -1,10 +1,10 @@ #$FreeBSD$ include "../s3c2xx0/std.s3c2410" -makeoptions KERNPHYSADDR=0x30408000 -makeoptions KERNVIRTADDR=0xc0408000 -options KERNPHYSADDR=0x30408000 -options KERNVIRTADDR=0xc0408000 +makeoptions KERNPHYSADDR=0x30000000 +makeoptions KERNVIRTADDR=0xc0000000 +options KERNPHYSADDR=0x30000000 +options KERNVIRTADDR=0xc0000000 options PHYSADDR=0x30000000 options STARTUP_PAGETABLE_ADDR=0x30800000 From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 00:53:58 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7B3310656AB; Sat, 29 Jan 2011 00:53:58 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BD0DD8FC13; Sat, 29 Jan 2011 00:53:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T0rwsN007254; Sat, 29 Jan 2011 00:53:58 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T0rwg2007250; Sat, 29 Jan 2011 00:53:58 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201101290053.p0T0rwg2007250@svn.freebsd.org> From: Andrew Turner Date: Sat, 29 Jan 2011 00:53:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218055 - head/sys/dev/cs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 00:53:59 -0000 Author: andrew Date: Sat Jan 29 00:53:58 2011 New Revision: 218055 URL: http://svn.freebsd.org/changeset/base/218055 Log: Use bus space functions rather than inw/outw to help a future port of the driver to ARM. Approved by: imp (mentor) Modified: head/sys/dev/cs/if_cs.c head/sys/dev/cs/if_csreg.h head/sys/dev/cs/if_csvar.h Modified: head/sys/dev/cs/if_cs.c ============================================================================== --- head/sys/dev/cs/if_cs.c Sat Jan 29 00:46:11 2011 (r218054) +++ head/sys/dev/cs/if_cs.c Sat Jan 29 00:53:58 2011 (r218055) @@ -272,8 +272,6 @@ cs_cs89x0_probe(device_t dev) if (error) return (error); - sc->nic_addr = rman_get_start(sc->port_res); - if ((cs_inw(sc, ADD_PORT) & ADD_MASK) != ADD_SIG) { /* Chip not detected. Let's try to reset it */ if (bootverbose) @@ -704,7 +702,7 @@ static int cs_get_packet(struct cs_softc *sc) { struct ifnet *ifp = sc->ifp; - int iobase = sc->nic_addr, status, length; + int status, length; struct ether_header *eh; struct mbuf *m; @@ -746,7 +744,8 @@ cs_get_packet(struct cs_softc *sc) m->m_len = length; /* Get the data */ - insw(iobase + RX_FRAME_PORT, m->m_data, (length+1)>>1); + bus_read_multi_2(sc->port_res, RX_FRAME_PORT, mtod(m, uint16_t *), + (length + 1) >> 1); eh = mtod(m, struct ether_header *); @@ -869,7 +868,8 @@ cs_write_mbufs( struct cs_softc *sc, str static void cs_xmit_buf( struct cs_softc *sc ) { - outsw(sc->nic_addr+TX_FRAME_PORT, sc->buffer, (sc->buf_len+1)>>1); + bus_write_multi_2(sc->port_res, TX_FRAME_PORT, (uint16_t *)sc->buffer, + (sc->buf_len + 1) >> 1); sc->buf_len = 0; } Modified: head/sys/dev/cs/if_csreg.h ============================================================================== --- head/sys/dev/cs/if_csreg.h Sat Jan 29 00:46:11 2011 (r218054) +++ head/sys/dev/cs/if_csreg.h Sat Jan 29 00:53:58 2011 (r218055) @@ -30,6 +30,8 @@ * $FreeBSD$ */ +#include + #define CS_89x0_IO_PORTS 0x0020 #define PP_ChipID 0x0000 /* offset 0h -> Corp -ID */ @@ -541,21 +543,21 @@ cs_inw(struct cs_softc *sc, int off) { if (off & 1) device_printf(sc->dev, "BUG: inw to an odd address.\n"); - return ((inb(sc->nic_addr + off) & 0xff) | - (inb(sc->nic_addr + off + 1) << 8)); + return ((bus_read_1(sc->port_res, off)) | + (bus_read_1(sc->port_res, off + 1) << 8)); } #else static __inline uint16_t cs_inw(struct cs_softc *sc, int off) { - return (inw(sc->nic_addr + off)); + return (bus_read_2(sc->port_res, off)); } #endif static __inline void cs_outw(struct cs_softc *sc, int off, uint16_t val) { - outw(sc->nic_addr + off, val); + bus_write_2(sc->port_res, off, val); } static __inline uint16_t Modified: head/sys/dev/cs/if_csvar.h ============================================================================== --- head/sys/dev/cs/if_csvar.h Sat Jan 29 00:46:11 2011 (r218054) +++ head/sys/dev/cs/if_csvar.h Sat Jan 29 00:53:58 2011 (r218055) @@ -57,7 +57,6 @@ struct cs_softc { int flags; #define CS_NO_IRQ 0x1 - int nic_addr; /* Base IO address of card */ int send_cmd; int line_ctl; /* */ int send_underrun; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 02:36:45 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D95BB1065701; Sat, 29 Jan 2011 02:36:45 +0000 (UTC) (envelope-from gibbs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C97408FC19; Sat, 29 Jan 2011 02:36:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T2ajJL011619; Sat, 29 Jan 2011 02:36:45 GMT (envelope-from gibbs@svn.freebsd.org) Received: (from gibbs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T2ajMn011617; Sat, 29 Jan 2011 02:36:45 GMT (envelope-from gibbs@svn.freebsd.org) Message-Id: <201101290236.p0T2ajMn011617@svn.freebsd.org> From: "Justin T. Gibbs" Date: Sat, 29 Jan 2011 02:36:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218056 - head/sys/dev/xen/netfront X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 02:36:45 -0000 Author: gibbs Date: Sat Jan 29 02:36:45 2011 New Revision: 218056 URL: http://svn.freebsd.org/changeset/base/218056 Log: Fix bug in the netfront driver that caused excessive packet drops during receive processing. Remove unnecessary restrictions on the mbuf chain length built during an LRO receive. This restriction was copied from the Linux netfront driver where the LRO implementation cannot handle more than 18 discontinuities. The FreeBSD implementation has no such restriction. MFC after: 1 week Modified: head/sys/dev/xen/netfront/netfront.c Modified: head/sys/dev/xen/netfront/netfront.c ============================================================================== --- head/sys/dev/xen/netfront/netfront.c Sat Jan 29 00:53:58 2011 (r218055) +++ head/sys/dev/xen/netfront/netfront.c Sat Jan 29 02:36:45 2011 (r218056) @@ -1273,7 +1273,6 @@ xennet_get_responses(struct netfront_inf struct mbuf *m, *m0, *m_prev; grant_ref_t ref = xennet_get_rx_ref(np, *cons); RING_IDX ref_cons = *cons; - int max = 5 /* MAX_TX_REQ_FRAGS + (rx->status <= RX_COPY_THRESHOLD) */; int frags = 1; int err = 0; u_long ret; @@ -1416,20 +1415,10 @@ next_skip_queue: frags++; } *list = m0; - - if (unlikely(frags > max)) { - if (net_ratelimit()) - WPRINTK("Too many frags\n"); - printf("%s: too many frags %d > max %d\n", __func__, frags, - max); - err = E2BIG; - } - *cons += frags; - *pages_flipped_p = pages_flipped; - return err; + return (err); } static void From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 04:34:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41774106564A; Sat, 29 Jan 2011 04:34:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3219D8FC08; Sat, 29 Jan 2011 04:34:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T4YVFB018070; Sat, 29 Jan 2011 04:34:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T4YVem018068; Sat, 29 Jan 2011 04:34:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101290434.p0T4YVem018068@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 04:34:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218057 - head/tools/tools/ath/athpow X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 04:34:31 -0000 Author: adrian Date: Sat Jan 29 04:34:30 2011 New Revision: 218057 URL: http://svn.freebsd.org/changeset/base/218057 Log: Keep this in sync with the ar5212 power rate table size. This doesn't yet know about the 802.11n radios or rates. Modified: head/tools/tools/ath/athpow/athpow.c Modified: head/tools/tools/ath/athpow/athpow.c ============================================================================== --- head/tools/tools/ath/athpow/athpow.c Sat Jan 29 02:36:45 2011 (r218056) +++ head/tools/tools/ath/athpow/athpow.c Sat Jan 29 04:34:30 2011 (r218057) @@ -78,7 +78,7 @@ main(int argc, char *argv[]) const char *ifname; HAL_REVS revs; u_int16_t pcdacTable[MAX(PWR_TABLE_SIZE,PWR_TABLE_SIZE_2413)]; - u_int16_t ratesArray[16]; + u_int16_t ratesArray[37]; u_int nrates, npcdac; s = socket(AF_INET, SOCK_DGRAM, 0); From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 05:08:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C0EF106566C; Sat, 29 Jan 2011 05:08:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B15A8FC12; Sat, 29 Jan 2011 05:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T58LPG018935; Sat, 29 Jan 2011 05:08:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T58Lnl018929; Sat, 29 Jan 2011 05:08:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101290508.p0T58Lnl018929@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 05:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218058 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 05:08:21 -0000 Author: adrian Date: Sat Jan 29 05:08:21 2011 New Revision: 218058 URL: http://svn.freebsd.org/changeset/base/218058 Log: Break out the debug macros from if_ath.c into if_ath_debug.[ch] . This is prep work for breaking out the TX path into a separate set of source files. Added: head/sys/dev/ath/if_ath_debug.c (contents, props changed) head/sys/dev/ath/if_ath_debug.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 29 04:34:30 2011 (r218057) +++ head/sys/conf/files Sat Jan 29 05:08:21 2011 (r218058) @@ -566,6 +566,8 @@ dev/ata/atapi-cam.c optional atapicam # dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_debug.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_pci.c optional ath pci \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 29 04:34:30 2011 (r218057) +++ head/sys/dev/ath/if_ath.c Sat Jan 29 05:08:21 2011 (r218058) @@ -89,6 +89,8 @@ __FBSDID("$FreeBSD$"); #include /* XXX for softled */ #include +#include + #ifdef ATH_TX99_DIAG #include #endif @@ -291,65 +293,6 @@ static int ath_bstuck_threshold = 4; /* SYSCTL_INT(_hw_ath, OID_AUTO, bstuck, CTLFLAG_RW, &ath_bstuck_threshold, 0, "max missed beacon xmits before chip reset"); -#ifdef ATH_DEBUG -enum { - ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ - ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ - ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */ - ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ - ATH_DEBUG_RATE = 0x00000010, /* rate control */ - ATH_DEBUG_RESET = 0x00000020, /* reset processing */ - ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */ - ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */ - ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */ - ATH_DEBUG_INTR = 0x00001000, /* ISR */ - ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */ - ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */ - ATH_DEBUG_BEACON_PROC = 0x00008000, /* beacon ISR proc */ - ATH_DEBUG_CALIBRATE = 0x00010000, /* periodic calibration */ - ATH_DEBUG_KEYCACHE = 0x00020000, /* key cache management */ - ATH_DEBUG_STATE = 0x00040000, /* 802.11 state transitions */ - ATH_DEBUG_NODE = 0x00080000, /* node management */ - ATH_DEBUG_LED = 0x00100000, /* led management */ - ATH_DEBUG_FF = 0x00200000, /* fast frames */ - ATH_DEBUG_DFS = 0x00400000, /* DFS processing */ - ATH_DEBUG_TDMA = 0x00800000, /* TDMA processing */ - ATH_DEBUG_TDMA_TIMER = 0x01000000, /* TDMA timer processing */ - ATH_DEBUG_REGDOMAIN = 0x02000000, /* regulatory processing */ - ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ - ATH_DEBUG_ANY = 0xffffffff -}; -static int ath_debug = 0; -SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, - 0, "control debugging printfs"); -TUNABLE_INT("hw.ath.debug", &ath_debug); - -#define IFF_DUMPPKTS(sc, m) \ - ((sc->sc_debug & (m)) || \ - (sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) -#define DPRINTF(sc, m, fmt, ...) do { \ - if (sc->sc_debug & (m)) \ - device_printf(sc->sc_dev, fmt, __VA_ARGS__); \ -} while (0) -#define KEYPRINTF(sc, ix, hk, mac) do { \ - if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ - ath_keyprint(sc, __func__, ix, hk, mac); \ -} while (0) -static void ath_printrxbuf(struct ath_softc *, const struct ath_buf *bf, - u_int ix, int); -static void ath_printtxbuf(struct ath_softc *, const struct ath_buf *bf, - u_int qnum, u_int ix, int done); -#else -#define IFF_DUMPPKTS(sc, m) \ - ((sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) -#define DPRINTF(sc, m, fmt, ...) do { \ - (void) sc; \ -} while (0) -#define KEYPRINTF(sc, k, ix, mac) do { \ - (void) sc; \ -} while (0) -#endif - MALLOC_DEFINE(M_ATHDEV, "athdev", "ath driver dma buffers"); int @@ -6089,65 +6032,6 @@ ath_setcurmode(struct ath_softc *sc, enu #undef N } -#ifdef ATH_DEBUG -static void -ath_printrxbuf(struct ath_softc *sc, const struct ath_buf *bf, - u_int ix, int done) -{ - const struct ath_rx_status *rs = &bf->bf_status.ds_rxstat; - struct ath_hal *ah = sc->sc_ah; - const struct ath_desc *ds; - int i; - - for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { - printf("R[%2u] (DS.V:%p DS.P:%p) L:%08x D:%08x%s\n" - " %08x %08x %08x %08x\n", - ix, ds, (const struct ath_desc *)bf->bf_daddr + i, - ds->ds_link, ds->ds_data, - !done ? "" : (rs->rs_status == 0) ? " *" : " !", - ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1]); - if (ah->ah_magic == 0x20065416) { - printf(" %08x %08x %08x %08x %08x %08x %08x\n", - ds->ds_hw[2], ds->ds_hw[3], ds->ds_hw[4], - ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], - ds->ds_hw[8]); - } - } -} - -static void -ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *bf, - u_int qnum, u_int ix, int done) -{ - const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; - struct ath_hal *ah = sc->sc_ah; - const struct ath_desc *ds; - int i; - - printf("Q%u[%3u]", qnum, ix); - for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { - printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:04%x%s\n" - " %08x %08x %08x %08x %08x %08x\n", - ds, (const struct ath_desc *)bf->bf_daddr + i, - ds->ds_link, ds->ds_data, bf->bf_txflags, - !done ? "" : (ts->ts_status == 0) ? " *" : " !", - ds->ds_ctl0, ds->ds_ctl1, - ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); - if (ah->ah_magic == 0x20065416) { - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", - ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], - ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], - ds->ds_hw[10],ds->ds_hw[11]); - printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", - ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14], - ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17], - ds->ds_hw[18], ds->ds_hw[19]); - } - } -} -#endif /* ATH_DEBUG */ - static void ath_watchdog(void *arg) { Added: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_debug.c Sat Jan 29 05:08:21 2011 (r218058) @@ -0,0 +1,156 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_inet.h" +#include "opt_ath.h" +#include "opt_wlan.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 +#ifdef IEEE80211_SUPPORT_SUPERG +#include +#endif +#ifdef IEEE80211_SUPPORT_TDMA +#include +#endif + +#include + +#ifdef INET +#include +#include +#endif + +#include +#include /* XXX for softled */ +#include + +#ifdef ATH_TX99_DIAG +#include +#endif + +#ifdef ATH_DEBUG +#include + +int ath_debug = 0; + +SYSCTL_DECL(_hw_ath); +SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug, + 0, "control debugging printfs"); +TUNABLE_INT("hw.ath.debug", &ath_debug); + +void +ath_printrxbuf(struct ath_softc *sc, const struct ath_buf *bf, + u_int ix, int done) +{ + const struct ath_rx_status *rs = &bf->bf_status.ds_rxstat; + struct ath_hal *ah = sc->sc_ah; + const struct ath_desc *ds; + int i; + + for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { + printf("R[%2u] (DS.V:%p DS.P:%p) L:%08x D:%08x%s\n" + " %08x %08x %08x %08x\n", + ix, ds, (const struct ath_desc *)bf->bf_daddr + i, + ds->ds_link, ds->ds_data, + !done ? "" : (rs->rs_status == 0) ? " *" : " !", + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1]); + if (ah->ah_magic == 0x20065416) { + printf(" %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[2], ds->ds_hw[3], ds->ds_hw[4], + ds->ds_hw[5], ds->ds_hw[6], ds->ds_hw[7], + ds->ds_hw[8]); + } + } +} + +void +ath_printtxbuf(struct ath_softc *sc, const struct ath_buf *bf, + u_int qnum, u_int ix, int done) +{ + const struct ath_tx_status *ts = &bf->bf_status.ds_txstat; + struct ath_hal *ah = sc->sc_ah; + const struct ath_desc *ds; + int i; + + printf("Q%u[%3u]", qnum, ix); + for (i = 0, ds = bf->bf_desc; i < bf->bf_nseg; i++, ds++) { + printf(" (DS.V:%p DS.P:%p) L:%08x D:%08x F:04%x%s\n" + " %08x %08x %08x %08x %08x %08x\n", + ds, (const struct ath_desc *)bf->bf_daddr + i, + ds->ds_link, ds->ds_data, bf->bf_txflags, + !done ? "" : (ts->ts_status == 0) ? " *" : " !", + ds->ds_ctl0, ds->ds_ctl1, + ds->ds_hw[0], ds->ds_hw[1], ds->ds_hw[2], ds->ds_hw[3]); + if (ah->ah_magic == 0x20065416) { + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[4], ds->ds_hw[5], ds->ds_hw[6], + ds->ds_hw[7], ds->ds_hw[8], ds->ds_hw[9], + ds->ds_hw[10],ds->ds_hw[11]); + printf(" %08x %08x %08x %08x %08x %08x %08x %08x\n", + ds->ds_hw[12],ds->ds_hw[13],ds->ds_hw[14], + ds->ds_hw[15],ds->ds_hw[16],ds->ds_hw[17], + ds->ds_hw[18], ds->ds_hw[19]); + } + } +} + +#endif /* ATH_DEBUG */ Added: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/ath/if_ath_debug.h Sat Jan 29 05:08:21 2011 (r218058) @@ -0,0 +1,93 @@ +/*- + * Copyright (c) 2002-2009 Sam Leffler, Errno Consulting + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any + * redistribution must be conditioned upon including a substantially + * similar Disclaimer requirement for further binary redistribution. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF + * THE POSSIBILITY OF SUCH DAMAGES. + * + * $FreeBSD$ + */ +#ifndef __IF_ATH_DEBUG_H__ +#define __IF_ATH_DEBUG_H__ + +#ifdef ATH_DEBUG + +enum { + ATH_DEBUG_XMIT = 0x00000001, /* basic xmit operation */ + ATH_DEBUG_XMIT_DESC = 0x00000002, /* xmit descriptors */ + ATH_DEBUG_RECV = 0x00000004, /* basic recv operation */ + ATH_DEBUG_RECV_DESC = 0x00000008, /* recv descriptors */ + ATH_DEBUG_RATE = 0x00000010, /* rate control */ + ATH_DEBUG_RESET = 0x00000020, /* reset processing */ + ATH_DEBUG_MODE = 0x00000040, /* mode init/setup */ + ATH_DEBUG_BEACON = 0x00000080, /* beacon handling */ + ATH_DEBUG_WATCHDOG = 0x00000100, /* watchdog timeout */ + ATH_DEBUG_INTR = 0x00001000, /* ISR */ + ATH_DEBUG_TX_PROC = 0x00002000, /* tx ISR proc */ + ATH_DEBUG_RX_PROC = 0x00004000, /* rx ISR proc */ + ATH_DEBUG_BEACON_PROC = 0x00008000, /* beacon ISR proc */ + ATH_DEBUG_CALIBRATE = 0x00010000, /* periodic calibration */ + ATH_DEBUG_KEYCACHE = 0x00020000, /* key cache management */ + ATH_DEBUG_STATE = 0x00040000, /* 802.11 state transitions */ + ATH_DEBUG_NODE = 0x00080000, /* node management */ + ATH_DEBUG_LED = 0x00100000, /* led management */ + ATH_DEBUG_FF = 0x00200000, /* fast frames */ + ATH_DEBUG_DFS = 0x00400000, /* DFS processing */ + ATH_DEBUG_TDMA = 0x00800000, /* TDMA processing */ + ATH_DEBUG_TDMA_TIMER = 0x01000000, /* TDMA timer processing */ + ATH_DEBUG_REGDOMAIN = 0x02000000, /* regulatory processing */ + ATH_DEBUG_FATAL = 0x80000000, /* fatal errors */ + ATH_DEBUG_ANY = 0xffffffff +}; + +extern int ath_debug; + +#define IFF_DUMPPKTS(sc, m) \ + ((sc->sc_debug & (m)) || \ + (sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) +#define DPRINTF(sc, m, fmt, ...) do { \ + if (sc->sc_debug & (m)) \ + device_printf(sc->sc_dev, fmt, __VA_ARGS__); \ +} while (0) +#define KEYPRINTF(sc, ix, hk, mac) do { \ + if (sc->sc_debug & ATH_DEBUG_KEYCACHE) \ + ath_keyprint(sc, __func__, ix, hk, mac); \ +} while (0) + +extern void ath_printrxbuf(struct ath_softc *, const struct ath_buf *bf, + u_int ix, int); +extern void ath_printtxbuf(struct ath_softc *, const struct ath_buf *bf, + u_int qnum, u_int ix, int done); +#else /* ATH_DEBUG */ +#define IFF_DUMPPKTS(sc, m) \ + ((sc->sc_ifp->if_flags & (IFF_DEBUG|IFF_LINK2)) == (IFF_DEBUG|IFF_LINK2)) +#define DPRINTF(sc, m, fmt, ...) do { \ + (void) sc; \ +} while (0) +#define KEYPRINTF(sc, k, ix, mac) do { \ + (void) sc; \ +} while (0) +#endif /* ATH_DEBUG */ + +#endif Modified: head/sys/modules/ath/Makefile ============================================================================== --- head/sys/modules/ath/Makefile Sat Jan 29 04:34:30 2011 (r218057) +++ head/sys/modules/ath/Makefile Sat Jan 29 05:08:21 2011 (r218058) @@ -35,7 +35,7 @@ ATH_RATE?= sample # tx rate control alg .PATH: ${.CURDIR}/../../dev/ath/ath_hal KMOD= if_ath -SRCS= if_ath.c if_ath_pci.c +SRCS= if_ath.c if_ath_pci.c if_ath_debug.c # NB: v3 eeprom support used by both AR5211 and AR5212; just include it SRCS+= ah_osdep.c ah.c ah_regdomain.c ah_eeprom_v3.c SRCS+= device_if.h bus_if.h pci_if.h opt_inet.h opt_ath.h opt_ah.h opt_wlan.h From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 07:22:34 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27C40106566C; Sat, 29 Jan 2011 07:22:34 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 18EE38FC17; Sat, 29 Jan 2011 07:22:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T7MXo0022250; Sat, 29 Jan 2011 07:22:33 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T7MXoI022248; Sat, 29 Jan 2011 07:22:33 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201101290722.p0T7MXoI022248@svn.freebsd.org> From: Dmitry Chagin Date: Sat, 29 Jan 2011 07:22:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218059 - head/sys/amd64/linux32 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 07:22:34 -0000 Author: dchagin Date: Sat Jan 29 07:22:33 2011 New Revision: 218059 URL: http://svn.freebsd.org/changeset/base/218059 Log: My style(9) bug. Pointed out by: kib MFC after: 1 Month. Modified: head/sys/amd64/linux32/linux32_machdep.c Modified: head/sys/amd64/linux32/linux32_machdep.c ============================================================================== --- head/sys/amd64/linux32/linux32_machdep.c Sat Jan 29 05:08:21 2011 (r218058) +++ head/sys/amd64/linux32/linux32_machdep.c Sat Jan 29 07:22:33 2011 (r218059) @@ -108,8 +108,10 @@ bsd_to_linux_sigaltstack(int bsa) return (lsa); } -static void bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru) +static void +bsd_to_linux_rusage(struct rusage *ru, struct l_rusage *lru) { + lru->ru_utime.tv_sec = ru->ru_utime.tv_sec; lru->ru_utime.tv_usec = ru->ru_utime.tv_usec; lru->ru_stime.tv_sec = ru->ru_stime.tv_sec; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 08:14:47 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8D963106564A; Sat, 29 Jan 2011 08:14:47 +0000 (UTC) (envelope-from alfred@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DC1D8FC15; Sat, 29 Jan 2011 08:14:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T8ElNW023550; Sat, 29 Jan 2011 08:14:47 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T8ElWG023548; Sat, 29 Jan 2011 08:14:47 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201101290814.p0T8ElWG023548@svn.freebsd.org> From: Alfred Perlstein Date: Sat, 29 Jan 2011 08:14:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218060 - stable/8/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 08:14:48 -0000 Author: alfred Date: Sat Jan 29 08:14:47 2011 New Revision: 218060 URL: http://svn.freebsd.org/changeset/base/218060 Log: MFC: 'alfred' command. Modified: stable/8/usr.sbin/portsnap/portsnap/portsnap.sh Modified: stable/8/usr.sbin/portsnap/portsnap/portsnap.sh ============================================================================== --- stable/8/usr.sbin/portsnap/portsnap/portsnap.sh Sat Jan 29 07:22:33 2011 (r218059) +++ stable/8/usr.sbin/portsnap/portsnap/portsnap.sh Sat Jan 29 08:14:47 2011 (r218060) @@ -140,7 +140,7 @@ parse_cmdline() { if [ ! -z "${SERVERNAME}" ]; then usage; fi shift; SERVERNAME="$1" ;; - cron | extract | fetch | update) + cron | extract | fetch | update | alfred) COMMANDS="${COMMANDS} $1" ;; *) @@ -1040,6 +1040,22 @@ cmd_update() { update_run || exit 1 } +# Alfred command. Run 'fetch' or 'cron' depending on +# whether stdin is a terminal; then run 'update' or +# 'extract' depending on whether ${PORTSDIR} exists. +cmd_alfred() { + if [ -t 0 ]; then + cmd_fetch + else + cmd_cron + fi + if [ -d ${PORTSDIR} ]; then + cmd_update + else + cmd_extract + fi +} + #### Entry point # Make sure we find utilities from the base system From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 08:52:06 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE6FB106564A; Sat, 29 Jan 2011 08:52:06 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 84A678FC08; Sat, 29 Jan 2011 08:52:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0T8q6AY024536; Sat, 29 Jan 2011 08:52:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0T8q6fF024533; Sat, 29 Jan 2011 08:52:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101290852.p0T8q6fF024533@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 08:52:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218061 - in head/sys/dev/ath/ath_hal: ar5416 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 08:52:06 -0000 Author: adrian Date: Sat Jan 29 08:52:06 2011 New Revision: 218061 URL: http://svn.freebsd.org/changeset/base/218061 Log: Add a check for the AR9285E; I have no idea what this is. The only other changes in ath9k for the AR9285E revolve around sleep modes which are not fully implemented here yet. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sat Jan 29 08:14:47 2011 (r218060) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416reg.h Sat Jan 29 08:52:06 2011 (r218061) @@ -634,4 +634,8 @@ #define AR_SREV_KITE_12_OR_LATER(_ah) \ (AR_SREV_KITE_12(_ah) || \ AH_PRIVATE((_ah))->ah_macRev >= AR_XSREV_REVISION_KITE_12) +#define AR_SREV_9285E_20(_ah) \ + (AR_SREV_KITE_12_OR_LATER(_ah) && \ + ((OS_REG_READ(_ah, AR_AN_SYNTH9) & 0x7) == 0x1)) + #endif /* _DEV_ATH_AR5416REG_H */ Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Sat Jan 29 08:14:47 2011 (r218060) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Sat Jan 29 08:52:06 2011 (r218061) @@ -221,15 +221,27 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s HAL_INI_INIT(&ahp9285->ah_ini_rxgain, ar9280Modes_original_rxgain_v2, 6); + + if (AR_SREV_9285E_20(ah)) + ath_hal_printf(ah, "[ath] AR9285E_20 detected; using XE TX gain tables\n"); + /* setup txgain table */ switch (ath_hal_eepromGet(ah, AR_EEP_TXGAIN_TYPE, AH_NULL)) { case AR5416_EEP_TXGAIN_HIGH_POWER: - HAL_INI_INIT(&ahp9285->ah_ini_txgain, - ar9285Modes_high_power_tx_gain_v2, 6); + if (AR_SREV_9285E_20(ah)) + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_XE2_0_high_power, 6); + else + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_high_power_tx_gain_v2, 6); break; case AR5416_EEP_TXGAIN_ORIG: - HAL_INI_INIT(&ahp9285->ah_ini_txgain, - ar9285Modes_original_tx_gain_v2, 6); + if (AR_SREV_9285E_20(ah)) + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_XE2_0_normal_power, 6); + else + HAL_INI_INIT(&ahp9285->ah_ini_txgain, + ar9285Modes_original_tx_gain_v2, 6); break; default: HALASSERT(AH_FALSE); From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 10:32:01 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0571D106566C; Sat, 29 Jan 2011 10:32:01 +0000 (UTC) (envelope-from jchandra@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EA61E8FC0A; Sat, 29 Jan 2011 10:32:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TAW0gO027128; Sat, 29 Jan 2011 10:32:00 GMT (envelope-from jchandra@svn.freebsd.org) Received: (from jchandra@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TAW0hw027126; Sat, 29 Jan 2011 10:32:00 GMT (envelope-from jchandra@svn.freebsd.org) Message-Id: <201101291032.p0TAW0hw027126@svn.freebsd.org> From: "Jayachandran C." Date: Sat, 29 Jan 2011 10:32:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218064 - head/gnu/lib/libgcc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 10:32:01 -0000 Author: jchandra Date: Sat Jan 29 10:32:00 2011 New Revision: 218064 URL: http://svn.freebsd.org/changeset/base/218064 Log: Rewrite the ARCH check another way for backward compatibility. Compilation fails now, if TARGET_ARCH=mips instead of mipsel/mipseb. Modified: head/gnu/lib/libgcc/Makefile Modified: head/gnu/lib/libgcc/Makefile ============================================================================== --- head/gnu/lib/libgcc/Makefile Sat Jan 29 09:42:31 2011 (r218063) +++ head/gnu/lib/libgcc/Makefile Sat Jan 29 10:32:00 2011 (r218064) @@ -122,7 +122,8 @@ LIB2FUNCS_EXTRA = floatunsidf.c floatuns .if ${TARGET_CPUARCH} == mips LIB2FUNCS_EXTRA = floatunsidf.c floatunsisf.c # ABIs other than o32 need this -.if ${TARGET_ARCH:Mmipse[lb]} == "" +.if ${TARGET_ARCH:Mmips64*} != "" || \ + ${TARGET_ARCH:Mmipsn32*} != "" LIB2FUNCS_EXTRA+= floatdidf.c fixunsdfsi.c LIB2FUNCS_EXTRA+= floatdisf.c floatundidf.c LIB2FUNCS_EXTRA+= fixsfdi.c floatundisf.c From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 11:35:23 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4434106564A; Sat, 29 Jan 2011 11:35:23 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D36BB8FC0A; Sat, 29 Jan 2011 11:35:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TBZN98030332; Sat, 29 Jan 2011 11:35:23 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TBZNqf030328; Sat, 29 Jan 2011 11:35:23 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101291135.p0TBZNqf030328@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 11:35:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218065 - in head/sys: conf dev/ath modules/ath X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 11:35:24 -0000 Author: adrian Date: Sat Jan 29 11:35:23 2011 New Revision: 218065 URL: http://svn.freebsd.org/changeset/base/218065 Log: Migrate the TX path code out of if_ath and into a separate source file. There's two reasons for this: * the raw and non-raw TX path shares a lot of duplicate code which should be refactored; * the 11n-ready chip TX path needs a little reworking. Added: head/sys/dev/ath/if_ath_misc.h (contents, props changed) head/sys/dev/ath/if_ath_tx.c (contents, props changed) head/sys/dev/ath/if_ath_tx.h (contents, props changed) Modified: head/sys/conf/files head/sys/dev/ath/if_ath.c head/sys/modules/ath/Makefile Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Sat Jan 29 10:32:00 2011 (r218064) +++ head/sys/conf/files Sat Jan 29 11:35:23 2011 (r218065) @@ -568,6 +568,8 @@ dev/ath/if_ath.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_debug.c optional ath \ compile-with "${NORMAL_C} -I$S/dev/ath" +dev/ath/if_ath_tx.c optional ath \ + compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/if_ath_pci.c optional ath pci \ compile-with "${NORMAL_C} -I$S/dev/ath" dev/ath/ah_osdep.c optional ath \ Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Jan 29 10:32:00 2011 (r218064) +++ head/sys/dev/ath/if_ath.c Sat Jan 29 11:35:23 2011 (r218065) @@ -90,6 +90,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include +#include #ifdef ATH_TX99_DIAG #include @@ -111,15 +113,6 @@ __FBSDID("$FreeBSD$"); */ CTASSERT(ATH_BCBUF <= 8); -/* unaligned little endian access */ -#define LE_READ_2(p) \ - ((u_int16_t) \ - ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8))) -#define LE_READ_4(p) \ - ((u_int32_t) \ - ((((u_int8_t *)(p))[0] ) | (((u_int8_t *)(p))[1] << 8) | \ - (((u_int8_t *)(p))[2] << 16) | (((u_int8_t *)(p))[3] << 24))) - static struct ieee80211vap *ath_vap_create(struct ieee80211com *, const char name[IFNAMSIZ], int unit, int opmode, int flags, const uint8_t bssid[IEEE80211_ADDR_LEN], @@ -184,9 +177,6 @@ static int ath_tx_setup(struct ath_softc static int ath_wme_update(struct ieee80211com *); static void ath_tx_cleanupq(struct ath_softc *, struct ath_txq *); static void ath_tx_cleanup(struct ath_softc *); -static void ath_freetx(struct mbuf *); -static int ath_tx_start(struct ath_softc *, struct ieee80211_node *, - struct ath_buf *, struct mbuf *); static void ath_tx_proc_q0(void *, int); static void ath_tx_proc_q0123(void *, int); static void ath_tx_proc(void *, int); @@ -215,8 +205,6 @@ static int ath_rate_setup(struct ath_sof static void ath_setcurmode(struct ath_softc *, enum ieee80211_phymode); static void ath_sysctlattach(struct ath_softc *); -static int ath_raw_xmit(struct ieee80211_node *, - struct mbuf *, const struct ieee80211_bpf_params *); static void ath_announce(struct ath_softc *); static void ath_sysctl_stats_attach(struct ath_softc *sc); @@ -1670,7 +1658,7 @@ ath_reset_vap(struct ieee80211vap *vap, return ath_reset(ifp); } -static struct ath_buf * +struct ath_buf * _ath_getbuf_locked(struct ath_softc *sc) { struct ath_buf *bf; @@ -1690,7 +1678,7 @@ _ath_getbuf_locked(struct ath_softc *sc) return bf; } -static struct ath_buf * +struct ath_buf * ath_getbuf(struct ath_softc *sc) { struct ath_buf *bf; @@ -1708,54 +1696,6 @@ ath_getbuf(struct ath_softc *sc) return bf; } -/* - * Cleanup driver resources when we run out of buffers - * while processing fragments; return the tx buffers - * allocated and drop node references. - */ -static void -ath_txfrag_cleanup(struct ath_softc *sc, - ath_bufhead *frags, struct ieee80211_node *ni) -{ - struct ath_buf *bf, *next; - - ATH_TXBUF_LOCK_ASSERT(sc); - - STAILQ_FOREACH_SAFE(bf, frags, bf_list, next) { - /* NB: bf assumed clean */ - STAILQ_REMOVE_HEAD(frags, bf_list); - STAILQ_INSERT_HEAD(&sc->sc_txbuf, bf, bf_list); - ieee80211_node_decref(ni); - } -} - -/* - * Setup xmit of a fragmented frame. Allocate a buffer - * for each frag and bump the node reference count to - * reflect the held reference to be setup by ath_tx_start. - */ -static int -ath_txfrag_setup(struct ath_softc *sc, ath_bufhead *frags, - struct mbuf *m0, struct ieee80211_node *ni) -{ - struct mbuf *m; - struct ath_buf *bf; - - ATH_TXBUF_LOCK(sc); - for (m = m0->m_nextpkt; m != NULL; m = m->m_nextpkt) { - bf = _ath_getbuf_locked(sc); - if (bf == NULL) { /* out of buffers, cleanup */ - ath_txfrag_cleanup(sc, frags, ni); - break; - } - ieee80211_node_incref(ni); - STAILQ_INSERT_TAIL(frags, bf, bf_list); - } - ATH_TXBUF_UNLOCK(sc); - - return !STAILQ_EMPTY(frags); -} - static void ath_start(struct ifnet *ifp) { @@ -4227,7 +4167,7 @@ ath_tx_cleanup(struct ath_softc *sc) * Return h/w rate index for an IEEE rate (w/o basic rate bit) * using the current rates in sc_rixmap. */ -static __inline int +int ath_tx_findrix(const struct ath_softc *sc, uint8_t rate) { int rix = sc->sc_rixmap[rate]; @@ -4236,623 +4176,6 @@ ath_tx_findrix(const struct ath_softc *s } /* - * Reclaim mbuf resources. For fragmented frames we - * need to claim each frag chained with m_nextpkt. - */ -static void -ath_freetx(struct mbuf *m) -{ - struct mbuf *next; - - do { - next = m->m_nextpkt; - m->m_nextpkt = NULL; - m_freem(m); - } while ((m = next) != NULL); -} - -static int -ath_tx_dmasetup(struct ath_softc *sc, struct ath_buf *bf, struct mbuf *m0) -{ - struct mbuf *m; - int error; - - /* - * Load the DMA map so any coalescing is done. This - * also calculates the number of descriptors we need. - */ - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m0, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error == EFBIG) { - /* XXX packet requires too many descriptors */ - bf->bf_nseg = ATH_TXDESC+1; - } else if (error != 0) { - sc->sc_stats.ast_tx_busdma++; - ath_freetx(m0); - return error; - } - /* - * Discard null packets and check for packets that - * require too many TX descriptors. We try to convert - * the latter to a cluster. - */ - if (bf->bf_nseg > ATH_TXDESC) { /* too many desc's, linearize */ - sc->sc_stats.ast_tx_linear++; - m = m_collapse(m0, M_DONTWAIT, ATH_TXDESC); - if (m == NULL) { - ath_freetx(m0); - sc->sc_stats.ast_tx_nombuf++; - return ENOMEM; - } - m0 = m; - error = bus_dmamap_load_mbuf_sg(sc->sc_dmat, bf->bf_dmamap, m0, - bf->bf_segs, &bf->bf_nseg, - BUS_DMA_NOWAIT); - if (error != 0) { - sc->sc_stats.ast_tx_busdma++; - ath_freetx(m0); - return error; - } - KASSERT(bf->bf_nseg <= ATH_TXDESC, - ("too many segments after defrag; nseg %u", bf->bf_nseg)); - } else if (bf->bf_nseg == 0) { /* null packet, discard */ - sc->sc_stats.ast_tx_nodata++; - ath_freetx(m0); - return EIO; - } - DPRINTF(sc, ATH_DEBUG_XMIT, "%s: m %p len %u\n", - __func__, m0, m0->m_pkthdr.len); - bus_dmamap_sync(sc->sc_dmat, bf->bf_dmamap, BUS_DMASYNC_PREWRITE); - bf->bf_m = m0; - - return 0; -} - -static void -ath_tx_handoff(struct ath_softc *sc, struct ath_txq *txq, struct ath_buf *bf) -{ - struct ath_hal *ah = sc->sc_ah; - struct ath_desc *ds, *ds0; - int i; - - /* - * Fillin the remainder of the descriptor info. - */ - ds0 = ds = bf->bf_desc; - for (i = 0; i < bf->bf_nseg; i++, ds++) { - ds->ds_data = bf->bf_segs[i].ds_addr; - if (i == bf->bf_nseg - 1) - ds->ds_link = 0; - else - ds->ds_link = bf->bf_daddr + sizeof(*ds) * (i + 1); - ath_hal_filltxdesc(ah, ds - , bf->bf_segs[i].ds_len /* segment length */ - , i == 0 /* first segment */ - , i == bf->bf_nseg - 1 /* last segment */ - , ds0 /* first descriptor */ - ); - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: %d: %08x %08x %08x %08x %08x %08x\n", - __func__, i, ds->ds_link, ds->ds_data, - ds->ds_ctl0, ds->ds_ctl1, ds->ds_hw[0], ds->ds_hw[1]); - } - /* - * Insert the frame on the outbound list and pass it on - * to the hardware. Multicast frames buffered for power - * save stations and transmit from the CAB queue are stored - * on a s/w only queue and loaded on to the CAB queue in - * the SWBA handler since frames only go out on DTIM and - * to avoid possible races. - */ - ATH_TXQ_LOCK(txq); - KASSERT((bf->bf_flags & ATH_BUF_BUSY) == 0, - ("busy status 0x%x", bf->bf_flags)); - if (txq->axq_qnum != ATH_TXQ_SWQ) { -#ifdef IEEE80211_SUPPORT_TDMA - int qbusy; - - ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); - qbusy = ath_hal_txqenabled(ah, txq->axq_qnum); - if (txq->axq_link == NULL) { - /* - * Be careful writing the address to TXDP. If - * the tx q is enabled then this write will be - * ignored. Normally this is not an issue but - * when tdma is in use and the q is beacon gated - * this race can occur. If the q is busy then - * defer the work to later--either when another - * packet comes along or when we prepare a beacon - * frame at SWBA. - */ - if (!qbusy) { - ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); - txq->axq_flags &= ~ATH_TXQ_PUTPENDING; - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: TXDP[%u] = %p (%p) depth %d\n", - __func__, txq->axq_qnum, - (caddr_t)bf->bf_daddr, bf->bf_desc, - txq->axq_depth); - } else { - txq->axq_flags |= ATH_TXQ_PUTPENDING; - DPRINTF(sc, ATH_DEBUG_TDMA | ATH_DEBUG_XMIT, - "%s: Q%u busy, defer enable\n", __func__, - txq->axq_qnum); - } - } else { - *txq->axq_link = bf->bf_daddr; - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: link[%u](%p)=%p (%p) depth %d\n", __func__, - txq->axq_qnum, txq->axq_link, - (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); - if ((txq->axq_flags & ATH_TXQ_PUTPENDING) && !qbusy) { - /* - * The q was busy when we previously tried - * to write the address of the first buffer - * in the chain. Since it's not busy now - * handle this chore. We are certain the - * buffer at the front is the right one since - * axq_link is NULL only when the buffer list - * is/was empty. - */ - ath_hal_puttxbuf(ah, txq->axq_qnum, - STAILQ_FIRST(&txq->axq_q)->bf_daddr); - txq->axq_flags &= ~ATH_TXQ_PUTPENDING; - DPRINTF(sc, ATH_DEBUG_TDMA | ATH_DEBUG_XMIT, - "%s: Q%u restarted\n", __func__, - txq->axq_qnum); - } - } -#else - ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); - if (txq->axq_link == NULL) { - ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: TXDP[%u] = %p (%p) depth %d\n", - __func__, txq->axq_qnum, - (caddr_t)bf->bf_daddr, bf->bf_desc, - txq->axq_depth); - } else { - *txq->axq_link = bf->bf_daddr; - DPRINTF(sc, ATH_DEBUG_XMIT, - "%s: link[%u](%p)=%p (%p) depth %d\n", __func__, - txq->axq_qnum, txq->axq_link, - (caddr_t)bf->bf_daddr, bf->bf_desc, txq->axq_depth); - } -#endif /* IEEE80211_SUPPORT_TDMA */ - txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; - ath_hal_txstart(ah, txq->axq_qnum); - } else { - if (txq->axq_link != NULL) { - struct ath_buf *last = ATH_TXQ_LAST(txq); - struct ieee80211_frame *wh; - - /* mark previous frame */ - wh = mtod(last->bf_m, struct ieee80211_frame *); - wh->i_fc[1] |= IEEE80211_FC1_MORE_DATA; - bus_dmamap_sync(sc->sc_dmat, last->bf_dmamap, - BUS_DMASYNC_PREWRITE); - - /* link descriptor */ - *txq->axq_link = bf->bf_daddr; - } - ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); - txq->axq_link = &bf->bf_desc[bf->bf_nseg - 1].ds_link; - } - ATH_TXQ_UNLOCK(txq); -} - -static int -ath_tx_start(struct ath_softc *sc, struct ieee80211_node *ni, struct ath_buf *bf, - struct mbuf *m0) -{ - struct ieee80211vap *vap = ni->ni_vap; - struct ath_vap *avp = ATH_VAP(vap); - struct ath_hal *ah = sc->sc_ah; - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - const struct chanAccParams *cap = &ic->ic_wme.wme_chanParams; - int error, iswep, ismcast, isfrag, ismrr; - int keyix, hdrlen, pktlen, try0; - u_int8_t rix, txrate, ctsrate; - u_int8_t cix = 0xff; /* NB: silence compiler */ - struct ath_desc *ds; - struct ath_txq *txq; - struct ieee80211_frame *wh; - u_int subtype, flags, ctsduration; - HAL_PKT_TYPE atype; - const HAL_RATE_TABLE *rt; - HAL_BOOL shortPreamble; - struct ath_node *an; - u_int pri; - - wh = mtod(m0, struct ieee80211_frame *); - iswep = wh->i_fc[1] & IEEE80211_FC1_WEP; - ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); - isfrag = m0->m_flags & M_FRAG; - hdrlen = ieee80211_anyhdrsize(wh); - /* - * Packet length must not include any - * pad bytes; deduct them here. - */ - pktlen = m0->m_pkthdr.len - (hdrlen & 3); - - if (iswep) { - const struct ieee80211_cipher *cip; - struct ieee80211_key *k; - - /* - * Construct the 802.11 header+trailer for an encrypted - * frame. The only reason this can fail is because of an - * unknown or unsupported cipher/key type. - */ - k = ieee80211_crypto_encap(ni, m0); - if (k == NULL) { - /* - * This can happen when the key is yanked after the - * frame was queued. Just discard the frame; the - * 802.11 layer counts failures and provides - * debugging/diagnostics. - */ - ath_freetx(m0); - return EIO; - } - /* - * Adjust the packet + header lengths for the crypto - * additions and calculate the h/w key index. When - * a s/w mic is done the frame will have had any mic - * added to it prior to entry so m0->m_pkthdr.len will - * account for it. Otherwise we need to add it to the - * packet length. - */ - cip = k->wk_cipher; - hdrlen += cip->ic_header; - pktlen += cip->ic_header + cip->ic_trailer; - /* NB: frags always have any TKIP MIC done in s/w */ - if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0 && !isfrag) - pktlen += cip->ic_miclen; - keyix = k->wk_keyix; - - /* packet header may have moved, reset our local pointer */ - wh = mtod(m0, struct ieee80211_frame *); - } else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { - /* - * Use station key cache slot, if assigned. - */ - keyix = ni->ni_ucastkey.wk_keyix; - if (keyix == IEEE80211_KEYIX_NONE) - keyix = HAL_TXKEYIX_INVALID; - } else - keyix = HAL_TXKEYIX_INVALID; - - pktlen += IEEE80211_CRC_LEN; - - /* - * Load the DMA map so any coalescing is done. This - * also calculates the number of descriptors we need. - */ - error = ath_tx_dmasetup(sc, bf, m0); - if (error != 0) - return error; - bf->bf_node = ni; /* NB: held reference */ - m0 = bf->bf_m; /* NB: may have changed */ - wh = mtod(m0, struct ieee80211_frame *); - - /* setup descriptors */ - ds = bf->bf_desc; - rt = sc->sc_currates; - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); - - /* - * NB: the 802.11 layer marks whether or not we should - * use short preamble based on the current mode and - * negotiated parameters. - */ - if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) && - (ni->ni_capinfo & IEEE80211_CAPINFO_SHORT_PREAMBLE)) { - shortPreamble = AH_TRUE; - sc->sc_stats.ast_tx_shortpre++; - } else { - shortPreamble = AH_FALSE; - } - - an = ATH_NODE(ni); - flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ - ismrr = 0; /* default no multi-rate retry*/ - pri = M_WME_GETAC(m0); /* honor classification */ - /* XXX use txparams instead of fixed values */ - /* - * Calculate Atheros packet type from IEEE80211 packet header, - * setup for rate calculations, and select h/w transmit queue. - */ - switch (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) { - case IEEE80211_FC0_TYPE_MGT: - subtype = wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK; - if (subtype == IEEE80211_FC0_SUBTYPE_BEACON) - atype = HAL_PKT_TYPE_BEACON; - else if (subtype == IEEE80211_FC0_SUBTYPE_PROBE_RESP) - atype = HAL_PKT_TYPE_PROBE_RESP; - else if (subtype == IEEE80211_FC0_SUBTYPE_ATIM) - atype = HAL_PKT_TYPE_ATIM; - else - atype = HAL_PKT_TYPE_NORMAL; /* XXX */ - rix = an->an_mgmtrix; - txrate = rt->info[rix].rateCode; - if (shortPreamble) - txrate |= rt->info[rix].shortPreamble; - try0 = ATH_TXMGTTRY; - flags |= HAL_TXDESC_INTREQ; /* force interrupt */ - break; - case IEEE80211_FC0_TYPE_CTL: - atype = HAL_PKT_TYPE_PSPOLL; /* stop setting of duration */ - rix = an->an_mgmtrix; - txrate = rt->info[rix].rateCode; - if (shortPreamble) - txrate |= rt->info[rix].shortPreamble; - try0 = ATH_TXMGTTRY; - flags |= HAL_TXDESC_INTREQ; /* force interrupt */ - break; - case IEEE80211_FC0_TYPE_DATA: - atype = HAL_PKT_TYPE_NORMAL; /* default */ - /* - * Data frames: multicast frames go out at a fixed rate, - * EAPOL frames use the mgmt frame rate; otherwise consult - * the rate control module for the rate to use. - */ - if (ismcast) { - rix = an->an_mcastrix; - txrate = rt->info[rix].rateCode; - if (shortPreamble) - txrate |= rt->info[rix].shortPreamble; - try0 = 1; - } else if (m0->m_flags & M_EAPOL) { - /* XXX? maybe always use long preamble? */ - rix = an->an_mgmtrix; - txrate = rt->info[rix].rateCode; - if (shortPreamble) - txrate |= rt->info[rix].shortPreamble; - try0 = ATH_TXMAXTRY; /* XXX?too many? */ - } else { - ath_rate_findrate(sc, an, shortPreamble, pktlen, - &rix, &try0, &txrate); - sc->sc_txrix = rix; /* for LED blinking */ - sc->sc_lastdatarix = rix; /* for fast frames */ - if (try0 != ATH_TXMAXTRY) - ismrr = 1; - } - if (cap->cap_wmeParams[pri].wmep_noackPolicy) - flags |= HAL_TXDESC_NOACK; - break; - default: - if_printf(ifp, "bogus frame type 0x%x (%s)\n", - wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK, __func__); - /* XXX statistic */ - ath_freetx(m0); - return EIO; - } - txq = sc->sc_ac2q[pri]; - - /* - * When servicing one or more stations in power-save mode - * (or) if there is some mcast data waiting on the mcast - * queue (to prevent out of order delivery) multicast - * frames must be buffered until after the beacon. - */ - if (ismcast && (vap->iv_ps_sta || avp->av_mcastq.axq_depth)) - txq = &avp->av_mcastq; - - /* - * Calculate miscellaneous flags. - */ - if (ismcast) { - flags |= HAL_TXDESC_NOACK; /* no ack on broad/multicast */ - } else if (pktlen > vap->iv_rtsthreshold && - (ni->ni_ath_flags & IEEE80211_NODE_FF) == 0) { - flags |= HAL_TXDESC_RTSENA; /* RTS based on frame length */ - cix = rt->info[rix].controlRate; - sc->sc_stats.ast_tx_rts++; - } - if (flags & HAL_TXDESC_NOACK) /* NB: avoid double counting */ - sc->sc_stats.ast_tx_noack++; -#ifdef IEEE80211_SUPPORT_TDMA - if (sc->sc_tdma && (flags & HAL_TXDESC_NOACK) == 0) { - DPRINTF(sc, ATH_DEBUG_TDMA, - "%s: discard frame, ACK required w/ TDMA\n", __func__); - sc->sc_stats.ast_tdma_ack++; - ath_freetx(m0); - return EIO; - } -#endif - - /* - * If 802.11g protection is enabled, determine whether - * to use RTS/CTS or just CTS. Note that this is only - * done for OFDM unicast frames. - */ - if ((ic->ic_flags & IEEE80211_F_USEPROT) && - rt->info[rix].phy == IEEE80211_T_OFDM && - (flags & HAL_TXDESC_NOACK) == 0) { - /* XXX fragments must use CCK rates w/ protection */ - if (ic->ic_protmode == IEEE80211_PROT_RTSCTS) - flags |= HAL_TXDESC_RTSENA; - else if (ic->ic_protmode == IEEE80211_PROT_CTSONLY) - flags |= HAL_TXDESC_CTSENA; - if (isfrag) { - /* - * For frags it would be desirable to use the - * highest CCK rate for RTS/CTS. But stations - * farther away may detect it at a lower CCK rate - * so use the configured protection rate instead - * (for now). - */ - cix = rt->info[sc->sc_protrix].controlRate; - } else - cix = rt->info[sc->sc_protrix].controlRate; - sc->sc_stats.ast_tx_protect++; - } - - /* - * Calculate duration. This logically belongs in the 802.11 - * layer but it lacks sufficient information to calculate it. - */ - if ((flags & HAL_TXDESC_NOACK) == 0 && - (wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK) != IEEE80211_FC0_TYPE_CTL) { - u_int16_t dur; - if (shortPreamble) - dur = rt->info[rix].spAckDuration; - else - dur = rt->info[rix].lpAckDuration; - if (wh->i_fc[1] & IEEE80211_FC1_MORE_FRAG) { - dur += dur; /* additional SIFS+ACK */ - KASSERT(m0->m_nextpkt != NULL, ("no fragment")); - /* - * Include the size of next fragment so NAV is - * updated properly. The last fragment uses only - * the ACK duration - */ - dur += ath_hal_computetxtime(ah, rt, - m0->m_nextpkt->m_pkthdr.len, - rix, shortPreamble); - } - if (isfrag) { - /* - * Force hardware to use computed duration for next - * fragment by disabling multi-rate retry which updates - * duration based on the multi-rate duration table. - */ - ismrr = 0; - try0 = ATH_TXMGTTRY; /* XXX? */ - } - *(u_int16_t *)wh->i_dur = htole16(dur); - } - - /* - * Calculate RTS/CTS rate and duration if needed. - */ - ctsduration = 0; - if (flags & (HAL_TXDESC_RTSENA|HAL_TXDESC_CTSENA)) { - /* - * CTS transmit rate is derived from the transmit rate - * by looking in the h/w rate table. We must also factor - * in whether or not a short preamble is to be used. - */ - /* NB: cix is set above where RTS/CTS is enabled */ - KASSERT(cix != 0xff, ("cix not setup")); - ctsrate = rt->info[cix].rateCode; - /* - * Compute the transmit duration based on the frame - * size and the size of an ACK frame. We call into the - * HAL to do the computation since it depends on the - * characteristics of the actual PHY being used. - * - * NB: CTS is assumed the same size as an ACK so we can - * use the precalculated ACK durations. - */ - if (shortPreamble) { - ctsrate |= rt->info[cix].shortPreamble; - if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ - ctsduration += rt->info[cix].spAckDuration; - ctsduration += ath_hal_computetxtime(ah, - rt, pktlen, rix, AH_TRUE); - if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ - ctsduration += rt->info[rix].spAckDuration; - } else { - if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ - ctsduration += rt->info[cix].lpAckDuration; - ctsduration += ath_hal_computetxtime(ah, - rt, pktlen, rix, AH_FALSE); - if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ - ctsduration += rt->info[rix].lpAckDuration; - } - /* - * Must disable multi-rate retry when using RTS/CTS. - */ - ismrr = 0; - try0 = ATH_TXMGTTRY; /* XXX */ - } else - ctsrate = 0; - - /* - * At this point we are committed to sending the frame - * and we don't need to look at m_nextpkt; clear it in - * case this frame is part of frag chain. - */ - m0->m_nextpkt = NULL; - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) - ieee80211_dump_pkt(ic, mtod(m0, const uint8_t *), m0->m_len, - sc->sc_hwmap[rix].ieeerate, -1); - - if (ieee80211_radiotap_active_vap(vap)) { - u_int64_t tsf = ath_hal_gettsf64(ah); - - sc->sc_tx_th.wt_tsf = htole64(tsf); - sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; - if (iswep) - sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; - if (isfrag) - sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; - sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_tx_th.wt_txpower = ni->ni_txpower; - sc->sc_tx_th.wt_antenna = sc->sc_txantenna; - - ieee80211_radiotap_tx(vap, m0); - } - - /* - * Determine if a tx interrupt should be generated for - * this descriptor. We take a tx interrupt to reap - * descriptors when the h/w hits an EOL condition or - * when the descriptor is specifically marked to generate - * an interrupt. We periodically mark descriptors in this - * way to insure timely replenishing of the supply needed - * for sending frames. Defering interrupts reduces system - * load and potentially allows more concurrent work to be - * done but if done to aggressively can cause senders to - * backup. - * - * NB: use >= to deal with sc_txintrperiod changing - * dynamically through sysctl. - */ - if (flags & HAL_TXDESC_INTREQ) { - txq->axq_intrcnt = 0; - } else if (++txq->axq_intrcnt >= sc->sc_txintrperiod) { - flags |= HAL_TXDESC_INTREQ; - txq->axq_intrcnt = 0; - } - - /* - * Formulate first tx descriptor with tx controls. - */ - /* XXX check return value? */ - ath_hal_setuptxdesc(ah, ds - , pktlen /* packet length */ - , hdrlen /* header length */ - , atype /* Atheros packet type */ - , ni->ni_txpower /* txpower */ - , txrate, try0 /* series 0 rate/tries */ - , keyix /* key cache index */ - , sc->sc_txantenna /* antenna mode */ - , flags /* flags */ - , ctsrate /* rts/cts rate */ - , ctsduration /* rts/cts duration */ - ); - bf->bf_txflags = flags; - /* - * Setup the multi-rate retry state only when we're - * going to use it. This assumes ath_hal_setuptxdesc - * initializes the descriptors (so we don't have to) - * when the hardware supports multi-rate retry and - * we don't use it. - */ - if (ismrr) - ath_rate_setupxtxdesc(sc, an, ds, shortPreamble, rix); - - ath_tx_handoff(sc, txq, bf); - return 0; -} - -/* * Process completed xmit descriptors from the specified queue. */ static int @@ -6586,276 +5909,6 @@ ath_sysctlattach(struct ath_softc *sc) #endif } -static int -ath_tx_raw_start(struct ath_softc *sc, struct ieee80211_node *ni, - struct ath_buf *bf, struct mbuf *m0, - const struct ieee80211_bpf_params *params) -{ - struct ifnet *ifp = sc->sc_ifp; - struct ieee80211com *ic = ifp->if_l2com; - struct ath_hal *ah = sc->sc_ah; - struct ieee80211vap *vap = ni->ni_vap; - int error, ismcast, ismrr; - int keyix, hdrlen, pktlen, try0, txantenna; - u_int8_t rix, cix, txrate, ctsrate, rate1, rate2, rate3; - struct ieee80211_frame *wh; - u_int flags, ctsduration; - HAL_PKT_TYPE atype; - const HAL_RATE_TABLE *rt; - struct ath_desc *ds; - u_int pri; - - wh = mtod(m0, struct ieee80211_frame *); - ismcast = IEEE80211_IS_MULTICAST(wh->i_addr1); - hdrlen = ieee80211_anyhdrsize(wh); - /* - * Packet length must not include any - * pad bytes; deduct them here. - */ - /* XXX honor IEEE80211_BPF_DATAPAD */ - pktlen = m0->m_pkthdr.len - (hdrlen & 3) + IEEE80211_CRC_LEN; - - if (params->ibp_flags & IEEE80211_BPF_CRYPTO) { - const struct ieee80211_cipher *cip; - struct ieee80211_key *k; - - /* - * Construct the 802.11 header+trailer for an encrypted - * frame. The only reason this can fail is because of an - * unknown or unsupported cipher/key type. - */ - k = ieee80211_crypto_encap(ni, m0); - if (k == NULL) { - /* - * This can happen when the key is yanked after the - * frame was queued. Just discard the frame; the - * 802.11 layer counts failures and provides - * debugging/diagnostics. - */ - ath_freetx(m0); - return EIO; - } - /* - * Adjust the packet + header lengths for the crypto - * additions and calculate the h/w key index. When - * a s/w mic is done the frame will have had any mic - * added to it prior to entry so m0->m_pkthdr.len will - * account for it. Otherwise we need to add it to the - * packet length. - */ - cip = k->wk_cipher; - hdrlen += cip->ic_header; - pktlen += cip->ic_header + cip->ic_trailer; - /* NB: frags always have any TKIP MIC done in s/w */ - if ((k->wk_flags & IEEE80211_KEY_SWMIC) == 0) - pktlen += cip->ic_miclen; - keyix = k->wk_keyix; - - /* packet header may have moved, reset our local pointer */ - wh = mtod(m0, struct ieee80211_frame *); - } else if (ni->ni_ucastkey.wk_cipher == &ieee80211_cipher_none) { - /* - * Use station key cache slot, if assigned. - */ - keyix = ni->ni_ucastkey.wk_keyix; - if (keyix == IEEE80211_KEYIX_NONE) - keyix = HAL_TXKEYIX_INVALID; - } else - keyix = HAL_TXKEYIX_INVALID; - - error = ath_tx_dmasetup(sc, bf, m0); - if (error != 0) - return error; - m0 = bf->bf_m; /* NB: may have changed */ - wh = mtod(m0, struct ieee80211_frame *); - bf->bf_node = ni; /* NB: held reference */ - - flags = HAL_TXDESC_CLRDMASK; /* XXX needed for crypto errs */ - flags |= HAL_TXDESC_INTREQ; /* force interrupt */ - if (params->ibp_flags & IEEE80211_BPF_RTS) - flags |= HAL_TXDESC_RTSENA; - else if (params->ibp_flags & IEEE80211_BPF_CTS) - flags |= HAL_TXDESC_CTSENA; - /* XXX leave ismcast to injector? */ - if ((params->ibp_flags & IEEE80211_BPF_NOACK) || ismcast) - flags |= HAL_TXDESC_NOACK; - - rt = sc->sc_currates; - KASSERT(rt != NULL, ("no rate table, mode %u", sc->sc_curmode)); - rix = ath_tx_findrix(sc, params->ibp_rate0); - txrate = rt->info[rix].rateCode; - if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) - txrate |= rt->info[rix].shortPreamble; - sc->sc_txrix = rix; - try0 = params->ibp_try0; - ismrr = (params->ibp_try1 != 0); - txantenna = params->ibp_pri >> 2; - if (txantenna == 0) /* XXX? */ - txantenna = sc->sc_txantenna; - ctsduration = 0; - if (flags & (HAL_TXDESC_CTSENA | HAL_TXDESC_RTSENA)) { - cix = ath_tx_findrix(sc, params->ibp_ctsrate); - ctsrate = rt->info[cix].rateCode; - if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) { - ctsrate |= rt->info[cix].shortPreamble; - if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ - ctsduration += rt->info[cix].spAckDuration; - ctsduration += ath_hal_computetxtime(ah, - rt, pktlen, rix, AH_TRUE); - if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ - ctsduration += rt->info[rix].spAckDuration; - } else { - if (flags & HAL_TXDESC_RTSENA) /* SIFS + CTS */ - ctsduration += rt->info[cix].lpAckDuration; - ctsduration += ath_hal_computetxtime(ah, - rt, pktlen, rix, AH_FALSE); - if ((flags & HAL_TXDESC_NOACK) == 0) /* SIFS + ACK */ - ctsduration += rt->info[rix].lpAckDuration; - } - ismrr = 0; /* XXX */ - } else - ctsrate = 0; - pri = params->ibp_pri & 3; - /* - * NB: we mark all packets as type PSPOLL so the h/w won't - * set the sequence number, duration, etc. - */ - atype = HAL_PKT_TYPE_PSPOLL; - - if (IFF_DUMPPKTS(sc, ATH_DEBUG_XMIT)) - ieee80211_dump_pkt(ic, mtod(m0, caddr_t), m0->m_len, - sc->sc_hwmap[rix].ieeerate, -1); - - if (ieee80211_radiotap_active_vap(vap)) { - u_int64_t tsf = ath_hal_gettsf64(ah); - - sc->sc_tx_th.wt_tsf = htole64(tsf); - sc->sc_tx_th.wt_flags = sc->sc_hwmap[rix].txflags; - if (wh->i_fc[1] & IEEE80211_FC1_WEP) - sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_WEP; - if (m0->m_flags & M_FRAG) - sc->sc_tx_th.wt_flags |= IEEE80211_RADIOTAP_F_FRAG; - sc->sc_tx_th.wt_rate = sc->sc_hwmap[rix].ieeerate; - sc->sc_tx_th.wt_txpower = ni->ni_txpower; - sc->sc_tx_th.wt_antenna = sc->sc_txantenna; - - ieee80211_radiotap_tx(vap, m0); - } - - /* - * Formulate first tx descriptor with tx controls. - */ - ds = bf->bf_desc; - /* XXX check return value? */ - ath_hal_setuptxdesc(ah, ds - , pktlen /* packet length */ - , hdrlen /* header length */ - , atype /* Atheros packet type */ - , params->ibp_power /* txpower */ - , txrate, try0 /* series 0 rate/tries */ - , keyix /* key cache index */ - , txantenna /* antenna mode */ - , flags /* flags */ - , ctsrate /* rts/cts rate */ - , ctsduration /* rts/cts duration */ - ); - bf->bf_txflags = flags; - - if (ismrr) { - rix = ath_tx_findrix(sc, params->ibp_rate1); - rate1 = rt->info[rix].rateCode; - if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) - rate1 |= rt->info[rix].shortPreamble; - if (params->ibp_try2) { - rix = ath_tx_findrix(sc, params->ibp_rate2); - rate2 = rt->info[rix].rateCode; - if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) - rate2 |= rt->info[rix].shortPreamble; - } else - rate2 = 0; - if (params->ibp_try3) { - rix = ath_tx_findrix(sc, params->ibp_rate3); - rate3 = rt->info[rix].rateCode; - if (params->ibp_flags & IEEE80211_BPF_SHORTPRE) - rate3 |= rt->info[rix].shortPreamble; - } else - rate3 = 0; - ath_hal_setupxtxdesc(ah, ds - , rate1, params->ibp_try1 /* series 1 */ - , rate2, params->ibp_try2 /* series 2 */ - , rate3, params->ibp_try3 /* series 3 */ - ); - } - - /* NB: no buffered multicast in power save support */ - ath_tx_handoff(sc, sc->sc_ac2q[pri], bf); - return 0; -} - -static int -ath_raw_xmit(struct ieee80211_node *ni, struct mbuf *m, - const struct ieee80211_bpf_params *params) -{ - struct ieee80211com *ic = ni->ni_ic; - struct ifnet *ifp = ic->ic_ifp; - struct ath_softc *sc = ifp->if_softc; - struct ath_buf *bf; - int error; - - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) { - DPRINTF(sc, ATH_DEBUG_XMIT, "%s: discard frame, %s", __func__, - (ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 ? - "!running" : "invalid"); - m_freem(m); - error = ENETDOWN; - goto bad; - } - /* - * Grab a TX buffer and associated resources. - */ - bf = ath_getbuf(sc); - if (bf == NULL) { - sc->sc_stats.ast_tx_nobuf++; - m_freem(m); - error = ENOBUFS; - goto bad; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 12:16:27 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D0C0106566B; Sat, 29 Jan 2011 12:16:27 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2CB498FC1B; Sat, 29 Jan 2011 12:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TCGRRg031382; Sat, 29 Jan 2011 12:16:27 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TCGR9R031376; Sat, 29 Jan 2011 12:16:27 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101291216.p0TCGR9R031376@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 12:16:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218066 - in head/sys/dev/ath: . ath_hal ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 12:16:27 -0000 Author: adrian Date: Sat Jan 29 12:16:26 2011 New Revision: 218066 URL: http://svn.freebsd.org/changeset/base/218066 Log: Link in the 11n specific TX methods into the HAL. Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sat Jan 29 11:35:23 2011 (r218065) +++ head/sys/dev/ath/ath_hal/ah.h Sat Jan 29 12:16:26 2011 (r218066) @@ -793,6 +793,32 @@ struct ath_hal { const HAL_BEACON_STATE *); void __ahdecl(*ah_resetStationBeaconTimers)(struct ath_hal*); + /* 802.11n Functions */ + HAL_BOOL __ahdecl(*ah_chainTxDesc)(struct ath_hal *, + struct ath_desc *, u_int, u_int, HAL_PKT_TYPE, + u_int, HAL_CIPHER, uint8_t, u_int, HAL_BOOL, + HAL_BOOL); + HAL_BOOL __ahdecl(*ah_setupFirstTxDesc)(struct ath_hal *, + struct ath_desc *, u_int, u_int, u_int, + u_int, u_int, u_int, u_int, u_int); + HAL_BOOL __ahdecl(*ah_setupLastTxDesc)(struct ath_hal *, + struct ath_desc *, const struct ath_desc *); + void __ahdecl(*ah_set11nRateScenario)(struct ath_hal *, + struct ath_desc *, u_int, u_int, + HAL_11N_RATE_SERIES [], u_int, u_int); + void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *, + struct ath_desc *, u_int); + void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, + struct ath_desc *); + void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, + struct ath_desc *, u_int); + uint32_t __ahdecl(*ah_get11nExtBusy)(struct ath_hal *); + void __ahdecl(*ah_set11nMac2040)(struct ath_hal *, + HAL_HT_MACMODE); + HAL_HT_RXCLEAR __ahdecl(*ah_get11nRxClear)(struct ath_hal *ah); + void __ahdecl(*ah_set11nRxClear)(struct ath_hal *, + HAL_HT_RXCLEAR); + /* Interrupt functions */ HAL_BOOL __ahdecl(*ah_isInterruptPending)(struct ath_hal*); HAL_BOOL __ahdecl(*ah_getPendingInterrupts)(struct ath_hal*, HAL_INT*); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 11:35:23 2011 (r218065) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 12:16:26 2011 (r218066) @@ -223,5 +223,23 @@ extern HAL_STATUS ar5416ProcTxDesc(struc extern HAL_BOOL ar5416GetTxCompletionRates(struct ath_hal *ah, const struct ath_desc *ds0, int *rates, int *tries); +extern HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds, + u_int pktLen, u_int hdrLen, HAL_PKT_TYPE type, u_int keyIx, + HAL_CIPHER cipher, uint8_t delims, u_int segLen, HAL_BOOL firstSeg, + HAL_BOOL lastSeg); +extern HAL_BOOL ar5416SetupFirstTxDesc(struct ath_hal *ah, struct ath_desc *ds, + u_int aggrLen, u_int flags, u_int txPower, u_int txRate0, u_int txTries0, + u_int antMode, u_int rtsctsRate, u_int rtsctsDuration); +extern HAL_BOOL ar5416SetupLastTxDesc(struct ath_hal *ah, struct ath_desc *ds, + const struct ath_desc *ds0); +extern HAL_BOOL ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu); +extern u_int ar5416GetGlobalTxTimeout(struct ath_hal *ah); +extern void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds, + u_int durUpdateEn, u_int rtsctsRate, HAL_11N_RATE_SERIES series[], + u_int nseries); +extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); +extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); +extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); + extern const HAL_RATE_TABLE *ar5416GetRateTable(struct ath_hal *, u_int mode); #endif /* _ATH_AR5416_H_ */ Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 11:35:23 2011 (r218065) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 12:16:26 2011 (r218066) @@ -136,8 +136,7 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_setStationBeaconTimers = ar5416SetStaBeaconTimers; ah->ah_resetStationBeaconTimers = ar5416ResetStaBeaconTimers; - /* XXX 802.11n Functions */ -#if 0 + /* 802.11n Functions */ ah->ah_chainTxDesc = ar5416ChainTxDesc; ah->ah_setupFirstTxDesc = ar5416SetupFirstTxDesc; ah->ah_setupLastTxDesc = ar5416SetupLastTxDesc; @@ -149,7 +148,6 @@ ar5416InitState(struct ath_hal_5416 *ahp ah->ah_set11nMac2040 = ar5416Set11nMac2040; ah->ah_get11nRxClear = ar5416Get11nRxClear; ah->ah_set11nRxClear = ar5416Set11nRxClear; -#endif /* Interrupt functions */ ah->ah_isInterruptPending = ar5416IsInterruptPending; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 11:35:23 2011 (r218065) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 12:16:26 2011 (r218066) @@ -311,8 +311,6 @@ ar5416FillTxDesc(struct ath_hal *ah, str return AH_TRUE; } -#if 0 - HAL_BOOL ar5416ChainTxDesc(struct ath_hal *ah, struct ath_desc *ds, u_int pktLen, @@ -327,6 +325,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st { struct ar5416_desc *ads = AR5416DESC(ds); uint32_t *ds_txstatus = AR5416_DS_TXSTATUS(ah,ads); + struct ath_hal_5416 *ahp = AH5416(ah); int isaggr = 0; @@ -342,7 +341,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st } if (!firstSeg) { - ath_hal_memzero(ds->ds_hw, AR5416_DESC_TX_CTL_SZ); + OS_MEMZERO(ds->ds_hw, AR5416_DESC_TX_CTL_SZ); } ads->ds_ctl0 = (pktLen & AR_FrameLen); @@ -356,7 +355,7 @@ ar5416ChainTxDesc(struct ath_hal *ah, st ads->ds_ctl0 |= AR_DestIdxValid; } - ads->ds_ctl6 = SM(keyType[cipher], AR_EncrType); + ads->ds_ctl6 = SM(ahp->ah_keytype[cipher], AR_EncrType); if (isaggr) { ads->ds_ctl6 |= SM(delims, AR_PadDelim); } @@ -456,7 +455,6 @@ ar5416SetupLastTxDesc(struct ath_hal *ah return AH_TRUE; } -#endif /* 0 */ #ifdef AH_NEED_DESC_SWAP /* Swap transmit descriptor */ @@ -588,7 +586,6 @@ ar5416ProcTxDesc(struct ath_hal *ah, return HAL_OK; } -#if 0 HAL_BOOL ar5416SetGlobalTxTimeout(struct ath_hal *ah, u_int tu) { @@ -706,7 +703,6 @@ ar5416Set11nBurstDuration(struct ath_hal ads->ds_ctl2 &= ~AR_BurstDur; ads->ds_ctl2 |= SM(burstDuration, AR_BurstDur); } -#endif /* * Retrieve the rate table from the given TX completion descriptor Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jan 29 11:35:23 2011 (r218065) +++ head/sys/dev/ath/if_athvar.h Sat Jan 29 12:16:26 2011 (r218066) @@ -654,6 +654,29 @@ void ath_intr(void *); #define ath_hal_gettxcompletionrates(_ah, _ds, _rates, _tries) \ ((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) +#define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \ + _ cipher, _delims, _seglen, _first, _last) \ + ((*(_ah)->ah_chainTxDesc((_ah), (_ds), (_pktlen), (_hdrlen), \ + (_type), (_keyix), (_cipher), (_delims), (_seglen), \ + (_first), (_last)))) +#define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ + _txr0, _txtr0, _antm, _rcr, _rcd) \ + ((*(_ah)->ah_setupFirstTxDesc)((_ah), (_ds), (_aggrlen), (_flags), \ + (_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd))) +#define ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \ + ((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0))) +#define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns) \ + ((*(_ah)->ah_set11nRateScenario)((_ah), (_ds), (_dur), (_rt), \ + (_series), (_ns))) +#define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ + ((*(_ah)->ah_set11nAggrMiddle((_ah), (_ds), (_num)))) +#define ath_hal_set11nburstduration(_ah, _ds, _dur) \ + ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) + + #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ + ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) + #define ath_hal_gpioset(_ah, _gpio, _b) \ + #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) #define ath_hal_gpioset(_ah, _gpio, _b) \ From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 12:30:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5FC321065674; Sat, 29 Jan 2011 12:30:13 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F7648FC13; Sat, 29 Jan 2011 12:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TCUDVt031868; Sat, 29 Jan 2011 12:30:13 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TCUDnQ031864; Sat, 29 Jan 2011 12:30:13 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101291230.p0TCUDnQ031864@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 12:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218067 - in head/sys/dev/ath: . ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 12:30:13 -0000 Author: adrian Date: Sat Jan 29 12:30:13 2011 New Revision: 218067 URL: http://svn.freebsd.org/changeset/base/218067 Log: Fix some errors introduced w/ the last commit; fix setting RTS/CTS in the 11n rate scenario. * I messed up a couple of things in if_athvar.h; so fix that. * Undo some guesswork done in ar5416Set11nRateScenario() and introduce a flags parameter which lets the caller set a few things. To begin with, this includes whether to do RTS or CTS protection. * If both RTS and CTS is set, only do RTS. Both RTS and CTS shouldn't be set on a frame. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 12:16:26 2011 (r218066) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 12:30:13 2011 (r218067) @@ -236,7 +236,7 @@ extern HAL_BOOL ar5416SetGlobalTxTimeout extern u_int ar5416GetGlobalTxTimeout(struct ath_hal *ah); extern void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds, u_int durUpdateEn, u_int rtsctsRate, HAL_11N_RATE_SERIES series[], - u_int nseries); + u_int nseries, u_int flags); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Clr11nAggr(struct ath_hal *ah, struct ath_desc *ds); extern void ar5416Set11nBurstDuration(struct ath_hal *ah, struct ath_desc *ds, u_int burstDuration); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 12:16:26 2011 (r218066) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Jan 29 12:30:13 2011 (r218067) @@ -612,13 +612,36 @@ ar5416GetGlobalTxTimeout(struct ath_hal void ar5416Set11nRateScenario(struct ath_hal *ah, struct ath_desc *ds, u_int durUpdateEn, u_int rtsctsRate, - HAL_11N_RATE_SERIES series[], u_int nseries) + HAL_11N_RATE_SERIES series[], u_int nseries, u_int flags) { struct ar5416_desc *ads = AR5416DESC(ds); + uint32_t ds_ctl0; HALASSERT(nseries == 4); (void)nseries; + /* + * Only one of RTS and CTS enable must be set. + * If a frame has both set, just do RTS protection - + * that's enough to satisfy legacy protection. + */ + if (flags & (HAL_TXDESC_RTSENA | HAL_TXDESC_CTSENA)) { + ds_ctl0 = ads->ds_ctl0; + + if (flags & HAL_TXDESC_RTSENA) { + ds_ctl0 &= ~AR_CTSEnable; + ds_ctl0 |= AR_RTSEnable; + } else { + ds_ctl0 &= ~AR_RTSEnable; + ds_ctl0 |= AR_CTSEnable; + } + + ads->ds_ctl0 = ds_ctl0; + } else { + ads->ds_ctl0 = + (ads->ds_ctl0 & ~(AR_RTSEnable | AR_CTSEnable)); + } + ads->ds_ctl2 = set11nTries(series, 0) | set11nTries(series, 1) @@ -642,27 +665,6 @@ ar5416Set11nRateScenario(struct ath_hal | set11nRateFlags(series, 2) | set11nRateFlags(series, 3) | SM(rtsctsRate, AR_RTSCTSRate); - - /* - * Enable RTSCTS if any of the series is flagged for RTSCTS, - * but only if CTS is not enabled. - */ - /* - * FIXME : the entire RTS/CTS handling should be moved to this - * function (by passing the global RTS/CTS flags to this function). - * currently it is split between this function and the - * setupFiirstDescriptor. with this current implementation there - * is an implicit assumption that setupFirstDescriptor is called - * before this function. - */ - if (((series[0].RateFlags & HAL_RATESERIES_RTS_CTS) || - (series[1].RateFlags & HAL_RATESERIES_RTS_CTS) || - (series[2].RateFlags & HAL_RATESERIES_RTS_CTS) || - (series[3].RateFlags & HAL_RATESERIES_RTS_CTS) ) && - (ads->ds_ctl0 & AR_CTSEnable) == 0) { - ads->ds_ctl0 |= AR_RTSEnable; - ads->ds_ctl0 &= ~AR_CTSEnable; - } } void Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Jan 29 12:16:26 2011 (r218066) +++ head/sys/dev/ath/if_athvar.h Sat Jan 29 12:30:13 2011 (r218067) @@ -655,7 +655,7 @@ void ath_intr(void *); ((*(_ah)->ah_getTxCompletionRates)((_ah), (_ds), (_rates), (_tries))) #define ath_hal_chaintxdesc(_ah, _ds, _pktlen, _hdrlen, _type, _keyix, \ - _ cipher, _delims, _seglen, _first, _last) \ + _cipher, _delims, _seglen, _first, _last) \ ((*(_ah)->ah_chainTxDesc((_ah), (_ds), (_pktlen), (_hdrlen), \ (_type), (_keyix), (_cipher), (_delims), (_seglen), \ (_first), (_last)))) @@ -665,18 +665,14 @@ void ath_intr(void *); (_txpower), (_txr0), (_txtr0), (_antm), (_rcr), (_rcd))) #define ath_hal_setuplasttxdesc(_ah, _ds, _ds0) \ ((*(_ah)->ah_setupLastTxDesc)((_ah), (_ds), (_ds0))) -#define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns) \ +#define ath_hal_set11nratescenario(_ah, _ds, _dur, _rt, _series, _ns, _flags) \ ((*(_ah)->ah_set11nRateScenario)((_ah), (_ds), (_dur), (_rt), \ - (_series), (_ns))) + (_series), (_ns), (_flags))) #define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ ((*(_ah)->ah_set11nAggrMiddle((_ah), (_ds), (_num)))) #define ath_hal_set11nburstduration(_ah, _ds, _dur) \ ((*(_ah)->ah_set11nBurstDuration)((_ah), (_ds), (_dur))) - #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ - ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) - #define ath_hal_gpioset(_ah, _gpio, _b) \ - #define ath_hal_gpioCfgOutput(_ah, _gpio, _type) \ ((*(_ah)->ah_gpioCfgOutput)((_ah), (_gpio), (_type))) #define ath_hal_gpioset(_ah, _gpio, _b) \ From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 14:27:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68C4A1065694; Sat, 29 Jan 2011 14:27:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57FEF8FC13; Sat, 29 Jan 2011 14:27:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TERLjc034758; Sat, 29 Jan 2011 14:27:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TERLGn034748; Sat, 29 Jan 2011 14:27:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101291427.p0TERLGn034748@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 14:27:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218068 - in head/sys/dev/ath/ath_hal: ar5416 ar9001 ar9002 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 14:27:21 -0000 Author: adrian Date: Sat Jan 29 14:27:20 2011 New Revision: 218068 URL: http://svn.freebsd.org/changeset/base/218068 Log: Bring over some NF calibration changes from ath9k. Each different radio chipset has a different "good" range of CCA (clear channel access) parameters where, if you write something out of range, it's possible the radio will go deaf. Also, since apparently occasionally reading the NF calibration returns "wrong" values, so enforce those limits on what is being written into the CCA register. Write a default value if there's no history available. This isn't the case right now but it may be later on when "off-channel" scanning occurs without init'ing or changing the NF history buffer. (As each channel may have a different noise floor; so scanning or other off-channel activity shouldn't affect the NF history of the current channel.) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280.h head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285.h head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Jan 29 14:27:20 2011 (r218068) @@ -49,6 +49,12 @@ typedef struct { #define AR5416_SPUR_RSSI_THRESH 40 +struct ar5416NfLimits { + int16_t max; + int16_t min; + int16_t nominal; +}; + struct ath_hal_5416 { struct ath_hal_5212 ah_5212; @@ -82,6 +88,9 @@ struct ath_hal_5416 { uint32_t ah_tx_chainmask; struct ar5416PerCal ah_cal; /* periodic calibration state */ + + struct ar5416NfLimits nf_2g; + struct ar5416NfLimits nf_5g; }; #define AH5416(_ah) ((struct ath_hal_5416 *)(_ah)) Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Sat Jan 29 14:27:20 2011 (r218068) @@ -356,6 +356,14 @@ ar5416Attach(uint16_t devid, HAL_SOFTC s } ar5416AniSetup(ah); /* Anti Noise Immunity */ + + AH5416(ah)->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_5416_2GHZ; + AH5416(ah)->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_5416_2GHZ; + AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_5416_2GHZ; + AH5416(ah)->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_5416_5GHZ; + AH5416(ah)->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_5416_5GHZ; + AH5416(ah)->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_5416_5GHZ; + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jan 29 14:27:20 2011 (r218068) @@ -37,6 +37,9 @@ static void ar5416StartNFCal(struct ath_ static void ar5416LoadNF(struct ath_hal *ah, const struct ieee80211_channel *); static int16_t ar5416GetNf(struct ath_hal *, struct ieee80211_channel *); +static uint16_t ar5416GetDefaultNF(struct ath_hal *ah, const struct ieee80211_channel *chan); +static void ar5416SanitizeNF(struct ath_hal *ah, int16_t *nf); + /* * Determine if calibration is supported by device and channel flags */ @@ -548,6 +551,7 @@ ar5416LoadNF(struct ath_hal *ah, const s int i; int32_t val; uint8_t chainmask; + int16_t default_nf = ar5416GetDefaultNF(ah, chan); /* * Force NF calibration for all chains. @@ -567,13 +571,24 @@ ar5416LoadNF(struct ath_hal *ah, const s * so we can load below. */ h = AH5416(ah)->ah_cal.nfCalHist; - for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) + HALDEBUG(ah, HAL_DEBUG_NFCAL, "CCA: "); + for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) { if (chainmask & (1 << i)) { + int16_t nf_val; + + if (h) + nf_val = h[i].privNF; + else + nf_val = default_nf; + val = OS_REG_READ(ah, ar5416_cca_regs[i]); val &= 0xFFFFFE00; - val |= (((uint32_t)(h[i].privNF) << 1) & 0x1ff); + val |= (((uint32_t) nf_val << 1) & 0x1ff); + HALDEBUG(ah, HAL_DEBUG_NFCAL, "[%d: %d]", i, nf_val); OS_REG_WRITE(ah, ar5416_cca_regs[i], val); } + } + HALDEBUG(ah, HAL_DEBUG_NFCAL, "\n"); /* Load software filtered NF value into baseband internal minCCApwr variable. */ OS_REG_CLR_BIT(ah, AR_PHY_AGC_CONTROL, AR_PHY_AGC_CONTROL_ENABLE_NF); @@ -611,6 +626,11 @@ ar5416LoadNF(struct ath_hal *ah, const s } } +/* + * This just initialises the "good" values for AR5416 which + * may not be right; it'lll be overridden by ar5416SanitizeNF() + * to nominal values. + */ void ar5416InitNfHistBuff(struct ar5212NfCalHist *h) { @@ -652,6 +672,50 @@ ar5416UpdateNFHistBuff(struct ar5212NfCa } } +static uint16_t +ar5416GetDefaultNF(struct ath_hal *ah, const struct ieee80211_channel *chan) +{ + struct ar5416NfLimits *limit; + + if (!chan || IEEE80211_IS_CHAN_2GHZ(chan)) + limit = &AH5416(ah)->nf_2g; + else + limit = &AH5416(ah)->nf_5g; + + return limit->nominal; +} + +static void +ar5416SanitizeNF(struct ath_hal *ah, int16_t *nf) +{ + + struct ar5416NfLimits *limit; + int i; + + if (IEEE80211_IS_CHAN_2GHZ(AH_PRIVATE(ah)->ah_curchan)) + limit = &AH5416(ah)->nf_2g; + else + limit = &AH5416(ah)->nf_5g; + + for (i = 0; i < AR5416_NUM_NF_READINGS; i++) { + if (!nf[i]) + continue; + + if (nf[i] > limit->max) { + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF[%d] (%d) > MAX (%d), correcting to MAX\n", + i, nf[i], limit->max); + nf[i] = limit->max; + } else if (nf[i] < limit->min) { + HALDEBUG(ah, HAL_DEBUG_NFCAL, + "NF[%d] (%d) < MIN (%d), correcting to NOM\n", + i, nf[i], limit->min); + nf[i] = limit->nominal; + } + } +} + + /* * Read the NF and check it against the noise floor threshhold */ @@ -672,6 +736,7 @@ ar5416GetNf(struct ath_hal *ah, struct i /* TODO - enhance for multiple chains and ext ch */ ath_hal_getNoiseFloor(ah, nfarray); nf = nfarray[0]; + ar5416SanitizeNF(ah, nfarray); if (ar5416GetEepromNoiseFloorThresh(ah, chan, &nfThresh)) { if (nf > nfThresh) { HALDEBUG(ah, HAL_DEBUG_ANY, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416phy.h Sat Jan 29 14:27:20 2011 (r218068) @@ -269,4 +269,13 @@ #define AR_PHY_CL_CAL_CTL 0xA358 /* carrier leak cal control */ #define AR_PHY_CL_CAL_ENABLE 0x00000002 #define AR_PHY_PARALLEL_CAL_ENABLE 0x00000001 + +/* empirically determined "good" CCA value ranges from atheros */ +#define AR_PHY_CCA_NOM_VAL_5416_2GHZ -90 +#define AR_PHY_CCA_NOM_VAL_5416_5GHZ -100 +#define AR_PHY_CCA_MIN_GOOD_VAL_5416_2GHZ -100 +#define AR_PHY_CCA_MIN_GOOD_VAL_5416_5GHZ -110 +#define AR_PHY_CCA_MAX_GOOD_VAL_5416_2GHZ -80 +#define AR_PHY_CCA_MAX_GOOD_VAL_5416_5GHZ -90 + #endif /* _DEV_ATH_AR5416PHY_H_ */ Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Sat Jan 29 14:27:20 2011 (r218068) @@ -250,6 +250,15 @@ ar9160Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9160AniSetup(ah); /* Anti Noise Immunity */ + + /* This just uses the AR5416 NF values */ + AH5416(ah)->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_5416_2GHZ; + AH5416(ah)->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_5416_2GHZ; + AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_5416_2GHZ; + AH5416(ah)->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_5416_5GHZ; + AH5416(ah)->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_5416_5GHZ; + AH5416(ah)->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_5416_5GHZ; + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280.h Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280.h Sat Jan 29 14:27:20 2011 (r218068) @@ -34,6 +34,13 @@ struct ath_hal_9280 { #define AR9280_DEFAULT_TXCHAINMASK 1 #define AR9285_DEFAULT_TXCHAINMASK 1 +#define AR_PHY_CCA_NOM_VAL_9280_2GHZ -112 +#define AR_PHY_CCA_NOM_VAL_9280_5GHZ -112 +#define AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ -127 +#define AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ -122 +#define AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ -97 +#define AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ -102 + HAL_BOOL ar9280RfAttach(struct ath_hal *, HAL_STATUS *); struct ath_hal; Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Sat Jan 29 14:27:20 2011 (r218068) @@ -280,6 +280,15 @@ ar9280Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9280AniSetup(ah); /* Anti Noise Immunity */ + + /* Setup noise floor min/max/nominal values */ + AH5416(ah)->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9280_2GHZ; + AH5416(ah)->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9280_2GHZ; + AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9280_2GHZ; + AH5416(ah)->nf_5g.max = AR_PHY_CCA_MAX_GOOD_VAL_9280_5GHZ; + AH5416(ah)->nf_5g.min = AR_PHY_CCA_MIN_GOOD_VAL_9280_5GHZ; + AH5416(ah)->nf_5g.nominal = AR_PHY_CCA_NOM_VAL_9280_5GHZ; + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285.h Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285.h Sat Jan 29 14:27:20 2011 (r218068) @@ -31,6 +31,9 @@ struct ath_hal_9285 { #define AR9285_DEFAULT_RXCHAINMASK 1 #define AR9285_DEFAULT_TXCHAINMASK 1 +#define AR_PHY_CCA_NOM_VAL_9285_2GHZ -118 +#define AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ -127 +#define AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ -108 HAL_BOOL ar9285SetAntennaSwitch(struct ath_hal *, HAL_ANT_SETTING); HAL_BOOL ar9285RfAttach(struct ath_hal *, HAL_STATUS *); Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Sat Jan 29 12:30:13 2011 (r218067) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Sat Jan 29 14:27:20 2011 (r218068) @@ -281,6 +281,13 @@ ar9285Attach(uint16_t devid, HAL_SOFTC s OS_REG_WRITE(ah, AR_MISC_MODE, ahp->ah_miscMode); ar9285AniSetup(ah); /* Anti Noise Immunity */ + + /* Setup noise floor min/max/nominal values */ + AH5416(ah)->nf_2g.max = AR_PHY_CCA_MAX_GOOD_VAL_9285_2GHZ; + AH5416(ah)->nf_2g.min = AR_PHY_CCA_MIN_GOOD_VAL_9285_2GHZ; + AH5416(ah)->nf_2g.nominal = AR_PHY_CCA_NOM_VAL_9285_2GHZ; + /* XXX no 5ghz values? */ + ar5416InitNfHistBuff(AH5416(ah)->ah_cal.nfCalHist); HALDEBUG(ah, HAL_DEBUG_ATTACH, "%s: return\n", __func__); From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 14:36:31 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D2B91065670; Sat, 29 Jan 2011 14:36:31 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E0358FC0A; Sat, 29 Jan 2011 14:36:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TEaVXG035098; Sat, 29 Jan 2011 14:36:31 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TEaVU4035096; Sat, 29 Jan 2011 14:36:31 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201101291436.p0TEaVU4035096@svn.freebsd.org> From: Adrian Chadd Date: Sat, 29 Jan 2011 14:36:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218069 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 14:36:31 -0000 Author: adrian Date: Sat Jan 29 14:36:31 2011 New Revision: 218069 URL: http://svn.freebsd.org/changeset/base/218069 Log: Avoid writing CCA threshold values for the EXT radios for non-HT40 channels. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jan 29 14:27:20 2011 (r218068) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_cal.c Sat Jan 29 14:36:31 2011 (r218069) @@ -573,6 +573,12 @@ ar5416LoadNF(struct ath_hal *ah, const s h = AH5416(ah)->ah_cal.nfCalHist; HALDEBUG(ah, HAL_DEBUG_NFCAL, "CCA: "); for (i = 0; i < AR5416_NUM_NF_READINGS; i ++) { + + /* Don't write to EXT radio CCA registers */ + /* XXX this check should really be cleaner! */ + if (i >= 3 && !IEEE80211_IS_CHAN_HT40(chan)) + continue; + if (chainmask & (1 << i)) { int16_t nf_val; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 15:23:02 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8339106566B; Sat, 29 Jan 2011 15:23:02 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D961B8FC13; Sat, 29 Jan 2011 15:23:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TFN2IS036285; Sat, 29 Jan 2011 15:23:02 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TFN2dd036283; Sat, 29 Jan 2011 15:23:02 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201101291523.p0TFN2dd036283@svn.freebsd.org> From: Alan Cox Date: Sat, 29 Jan 2011 15:23:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218070 - head/sys/vm X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 15:23:03 -0000 Author: alc Date: Sat Jan 29 15:23:02 2011 New Revision: 218070 URL: http://svn.freebsd.org/changeset/base/218070 Log: Reenable the call to vm_map_simplify_entry() from vm_map_insert() for non- MAP_STACK_* entries. (See r71983 and r74235.) In some cases, performing this call to vm_map_simplify_entry() halves the number of vm map entries used by the Sun JDK. Modified: head/sys/vm/vm_map.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Jan 29 14:36:31 2011 (r218069) +++ head/sys/vm/vm_map.c Sat Jan 29 15:23:02 2011 (r218070) @@ -1293,17 +1293,13 @@ charged: vm_map_entry_link(map, prev_entry, new_entry); map->size += new_entry->end - new_entry->start; -#if 0 /* - * Temporarily removed to avoid MAP_STACK panic, due to - * MAP_STACK being a huge hack. Will be added back in - * when MAP_STACK (and the user stack mapping) is fixed. + * It may be possible to merge the new entry with the next and/or + * previous entries. However, due to MAP_STACK_* being a hack, a + * panic can result from merging such entries. */ - /* - * It may be possible to simplify the entry - */ - vm_map_simplify_entry(map, new_entry); -#endif + if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) == 0) + vm_map_simplify_entry(map, new_entry); if (cow & (MAP_PREFAULT|MAP_PREFAULT_PARTIAL)) { vm_map_pmap_enter(map, start, prot, From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 15:56:40 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E52011065673; Sat, 29 Jan 2011 15:56:40 +0000 (UTC) (envelope-from kensmith@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D606F8FC28; Sat, 29 Jan 2011 15:56:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TFueur037074; Sat, 29 Jan 2011 15:56:40 GMT (envelope-from kensmith@svn.freebsd.org) Received: (from kensmith@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TFuewV037072; Sat, 29 Jan 2011 15:56:40 GMT (envelope-from kensmith@svn.freebsd.org) Message-Id: <201101291556.p0TFuewV037072@svn.freebsd.org> From: Ken Smith Date: Sat, 29 Jan 2011 15:56:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-releng@freebsd.org X-SVN-Group: releng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218071 - releng/8.2/sys/conf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 15:56:41 -0000 Author: kensmith Date: Sat Jan 29 15:56:40 2011 New Revision: 218071 URL: http://svn.freebsd.org/changeset/base/218071 Log: Ready for 8.2-RC3. Approved by: re (implicit) Modified: releng/8.2/sys/conf/newvers.sh Modified: releng/8.2/sys/conf/newvers.sh ============================================================================== --- releng/8.2/sys/conf/newvers.sh Sat Jan 29 15:23:02 2011 (r218070) +++ releng/8.2/sys/conf/newvers.sh Sat Jan 29 15:56:40 2011 (r218071) @@ -32,7 +32,7 @@ TYPE="FreeBSD" REVISION="8.2" -BRANCH="RC2" +BRANCH="RC3" if [ "X${BRANCH_OVERRIDE}" != "X" ]; then BRANCH=${BRANCH_OVERRIDE} fi From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 19:55:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68137106573E; Sat, 29 Jan 2011 19:55:29 +0000 (UTC) (envelope-from rrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 576618FC08; Sat, 29 Jan 2011 19:55:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TJtTgR043372; Sat, 29 Jan 2011 19:55:29 GMT (envelope-from rrs@svn.freebsd.org) Received: (from rrs@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TJtTWt043362; Sat, 29 Jan 2011 19:55:29 GMT (envelope-from rrs@svn.freebsd.org) Message-Id: <201101291955.p0TJtTWt043362@svn.freebsd.org> From: Randall Stewart Date: Sat, 29 Jan 2011 19:55:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218072 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 19:55:29 -0000 Author: rrs Date: Sat Jan 29 19:55:29 2011 New Revision: 218072 URL: http://svn.freebsd.org/changeset/base/218072 Log: Fixes to ECN in SCTP. 1) ECN was on an association basis, this is incorrect and will not work with CMT or for that matter if the user is sending to multiple addresses. This commit makes ECN on a per path basis. 2) Adopt the new format for the ECN internet draft. This also maintains compatability with old format chunks as well. 3) Keep track of the real time of a RTT down to micro seconds. For some future conditional features (for like a data center this is good information to have). MFC after: 1 month Modified: head/sys/netinet/sctp.h head/sys/netinet/sctp_header.h head/sys/netinet/sctp_indata.c head/sys/netinet/sctp_input.c head/sys/netinet/sctp_output.c head/sys/netinet/sctp_output.h head/sys/netinet/sctp_pcb.c head/sys/netinet/sctp_structs.h head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctp.h ============================================================================== --- head/sys/netinet/sctp.h Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp.h Sat Jan 29 19:55:29 2011 (r218072) @@ -417,6 +417,10 @@ struct sctp_error_unrecognized_chunk { #define SCTP_BADCRC 0x02 #define SCTP_PACKET_TRUNCATED 0x04 +/* Flag for ECN -CWR */ +#define SCTP_CWR_REDUCE_OVERRIDE 0x01 +#define SCTP_CWR_IN_SAME_WINDOW 0x02 + #define SCTP_SAT_NETWORK_MIN 400 /* min ms for RTT to set satellite * time */ #define SCTP_SAT_NETWORK_BURST_INCR 2 /* how many times to multiply maxburst Modified: head/sys/netinet/sctp_header.h ============================================================================== --- head/sys/netinet/sctp_header.h Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_header.h Sat Jan 29 19:55:29 2011 (r218072) @@ -360,9 +360,15 @@ struct sctp_cookie_ack_chunk { } SCTP_PACKED; /* Explicit Congestion Notification Echo (ECNE) */ +struct old_sctp_ecne_chunk { + struct sctp_chunkhdr ch; + uint32_t tsn; +} SCTP_PACKED; + struct sctp_ecne_chunk { struct sctp_chunkhdr ch; uint32_t tsn; + uint32_t num_pkts_since_cwr; } SCTP_PACKED; /* Congestion Window Reduced (CWR) */ Modified: head/sys/netinet/sctp_indata.c ============================================================================== --- head/sys/netinet/sctp_indata.c Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_indata.c Sat Jan 29 19:55:29 2011 (r218072) @@ -3829,6 +3829,10 @@ sctp_express_handle_sack(struct sctp_tcb } /* First setup for CC stuff */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cumack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cumack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; @@ -4522,6 +4526,10 @@ sctp_handle_sack(struct mbuf *m, int off * destination address basis. */ TAILQ_FOREACH(net, &asoc->nets, sctp_next) { + if (SCTP_TSN_GT(cum_ack, net->cwr_window_tsn)) { + /* Drag along the window_tsn for cwr's */ + net->cwr_window_tsn = cum_ack; + } net->prev_cwnd = net->cwnd; net->net_ack = 0; net->net_ack2 = 0; Modified: head/sys/netinet/sctp_input.c ============================================================================== --- head/sys/netinet/sctp_input.c Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_input.c Sat Jan 29 19:55:29 2011 (r218072) @@ -1678,8 +1678,6 @@ sctp_process_cookie_existing(struct mbuf asoc->my_rwnd = ntohl(initack_cp->init.a_rwnd); asoc->pre_open_streams = ntohs(initack_cp->init.num_outbound_streams); - /* Note last_cwr_tsn? where is this used? */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; if (ntohl(init_cp->init.initiate_tag) != asoc->peer_vtag) { /* * Ok the peer probably discarded our data (if we @@ -1835,7 +1833,6 @@ sctp_process_cookie_existing(struct mbuf asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2073,7 +2070,6 @@ sctp_process_cookie_new(struct mbuf *m, asoc->init_seq_number = ntohl(initack_cp->init.initial_tsn); asoc->sending_seq = asoc->asconf_seq_out = asoc->str_reset_seq_out = asoc->init_seq_number; asoc->asconf_seq_out_acked = asoc->asconf_seq_out - 1; - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->asconf_seq_in = asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->str_reset_seq_in = asoc->init_seq_number; @@ -2915,25 +2911,38 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch { struct sctp_nets *net; struct sctp_tmit_chunk *lchk; - uint32_t tsn; - - if (ntohs(cp->ch.chunk_length) != sizeof(struct sctp_ecne_chunk)) { + struct sctp_ecne_chunk bkup; + uint8_t override_bit = 0; + uint32_t tsn, window_data_tsn; + int len; + int pkt_cnt; + + len = ntohs(cp->ch.chunk_length); + if ((len != sizeof(struct sctp_ecne_chunk)) && + (len != sizeof(struct old_sctp_ecne_chunk))) { return; } + if (len == sizeof(struct old_sctp_ecne_chunk)) { + /* Its the old format */ + memcpy(&bkup, cp, sizeof(struct old_sctp_ecne_chunk)); + bkup.num_pkts_since_cwr = htonl(1); + cp = &bkup; + } SCTP_STAT_INCR(sctps_recvecne); tsn = ntohl(cp->tsn); + pkt_cnt = ntohl(cp->num_pkts_since_cwr); /* ECN Nonce stuff: need a resync and disable the nonce sum check */ /* Also we make sure we disable the nonce_wait */ - lchk = TAILQ_FIRST(&stcb->asoc.send_queue); + lchk = TAILQ_LAST(&stcb->asoc.send_queue, sctpchunk_listhead); if (lchk == NULL) { - stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = stcb->asoc.sending_seq - 1; } else { - stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; + window_data_tsn = stcb->asoc.nonce_resync_tsn = lchk->rec.data.TSN_seq; } stcb->asoc.nonce_wait_for_ecne = 0; stcb->asoc.nonce_sum_check = 0; - /* Find where it was sent, if possible */ + /* Find where it was sent to if possible. */ net = NULL; TAILQ_FOREACH(lchk, &stcb->asoc.sent_queue, sctp_next) { if (lchk->rec.data.TSN_seq == tsn) { @@ -2944,32 +2953,71 @@ sctp_handle_ecn_echo(struct sctp_ecne_ch break; } } - if (net == NULL) - /* default is we use the primary */ - net = stcb->asoc.primary_destination; - - if (SCTP_TSN_GT(tsn, stcb->asoc.last_cwr_tsn)) { + if (net == NULL) { + /* + * What to do. A previous send of a CWR was possibly lost. + * See how old it is, we may have it marked on the actual + * net. + */ + TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) { + if (tsn == net->last_cwr_tsn) { + /* Found him, send it off */ + goto out; + } + } + /* + * If we reach here, we need to send a special CWR that says + * hey, we did this a long time ago and you lost the + * response. + */ + net = TAILQ_FIRST(&stcb->asoc.nets); + override_bit = SCTP_CWR_REDUCE_OVERRIDE; + } +out: + if (SCTP_TSN_GT(tsn, net->cwr_window_tsn)) { /* * JRS - Use the congestion control given in the pluggable * CC module */ + int ocwnd; + + ocwnd = net->cwnd; stcb->asoc.cc_functions.sctp_cwnd_update_after_ecn_echo(stcb, net); /* - * we reduce once every RTT. So we will only lower cwnd at - * the next sending seq i.e. the resync_tsn. + * We reduce once every RTT. So we will only lower cwnd at + * the next sending seq i.e. the window_data_tsn */ - stcb->asoc.last_cwr_tsn = stcb->asoc.nonce_resync_tsn; + net->cwr_window_tsn = window_data_tsn; + net->ecn_ce_pkt_cnt += pkt_cnt; + net->lost_cnt = pkt_cnt; + net->last_cwr_tsn = tsn; + } else { + override_bit |= SCTP_CWR_IN_SAME_WINDOW; + if (SCTP_TSN_GT(tsn, net->last_cwr_tsn)) { + /* + * Another loss in the same window update how man + * marks we have had + */ + + if (pkt_cnt > net->lost_cnt) { + /* Should be the case */ + net->ecn_ce_pkt_cnt += (pkt_cnt - net->lost_cnt); + net->lost_cnt = pkt_cnt; + } + net->last_cwr_tsn = tsn; + } } /* * We always send a CWR this way if our previous one was lost our * peer will get an update, or if it is not time again to reduce we - * still get the cwr to the peer. + * still get the cwr to the peer. Note we set the override when we + * could not find the TSN on the chunk or the destination network. */ - sctp_send_cwr(stcb, net, tsn); + sctp_send_cwr(stcb, net, net->last_cwr_tsn, override_bit); } static void -sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb) +sctp_handle_ecn_cwr(struct sctp_cwr_chunk *cp, struct sctp_tcb *stcb, struct sctp_nets *net) { /* * Here we get a CWR from the peer. We must look in the outqueue and @@ -2978,18 +3026,22 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun */ struct sctp_tmit_chunk *chk; struct sctp_ecne_chunk *ecne; + int override; + uint32_t cwr_tsn; + + cwr_tsn = ntohl(cp->tsn); + override = cp->ch.chunk_flags & SCTP_CWR_REDUCE_OVERRIDE; TAILQ_FOREACH(chk, &stcb->asoc.control_send_queue, sctp_next) { if (chk->rec.chunk_id.id != SCTP_ECN_ECHO) { continue; } - /* - * Look for and remove if it is the right TSN. Since there - * is only ONE ECNE on the control queue at any one time we - * don't need to worry about more than one! - */ + if ((override == 0) && (chk->whoTo != net)) { + /* Must be from the right src unless override is set */ + continue; + } ecne = mtod(chk->data, struct sctp_ecne_chunk *); - if (SCTP_TSN_GE(ntohl(cp->tsn), ntohl(ecne->tsn))) { + if (SCTP_TSN_GE(cwr_tsn, ntohl(ecne->tsn))) { /* this covers this ECNE, we can remove it */ stcb->asoc.ecn_echo_cnt_onq--; TAILQ_REMOVE(&stcb->asoc.control_send_queue, chk, @@ -3000,7 +3052,9 @@ sctp_handle_ecn_cwr(struct sctp_cwr_chun } stcb->asoc.ctrl_queue_cnt--; sctp_free_a_chunk(stcb, chk); - break; + if (override == 0) { + break; + } } } } @@ -5041,7 +5095,7 @@ process_control_chunks: __LINE__); } stcb->asoc.overall_error_count = 0; - sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb); + sctp_handle_ecn_cwr((struct sctp_cwr_chunk *)ch, stcb, *netp); } break; case SCTP_SHUTDOWN_COMPLETE: Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_output.c Sat Jan 29 19:55:29 2011 (r218072) @@ -7274,7 +7274,7 @@ sctp_med_chunk_output(struct sctp_inpcb * fomulate and send the low level chunks. Making sure to combine * any control in the control chunk queue also. */ - struct sctp_nets *net, *start_at, *old_start_at = NULL; + struct sctp_nets *net, *start_at, *sack_goes_to = NULL, *old_start_at = NULL; struct mbuf *outchain, *endoutchain; struct sctp_tmit_chunk *chk, *nchk; @@ -7327,10 +7327,12 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 0; /* Nothing to possible to send? */ - if (TAILQ_EMPTY(&asoc->control_send_queue) && + if ((TAILQ_EMPTY(&asoc->control_send_queue) || + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) && TAILQ_EMPTY(&asoc->asconf_send_queue) && TAILQ_EMPTY(&asoc->send_queue) && stcb->asoc.ss_functions.sctp_ss_is_empty(stcb, asoc)) { +nothing_to_send: *reason_code = 9; return (0); } @@ -7342,6 +7344,21 @@ sctp_med_chunk_output(struct sctp_inpcb no_data_chunks = 1; } } + if (stcb->asoc.ecn_echo_cnt_onq) { + /* Record where a sack goes, if any */ + if (no_data_chunks && + (asoc->ctrl_queue_cnt == stcb->asoc.ecn_echo_cnt_onq)) { + /* Nothing but ECNe to send - we don't do that */ + goto nothing_to_send; + } + TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { + if ((chk->rec.chunk_id.id == SCTP_SELECTIVE_ACK) || + (chk->rec.chunk_id.id == SCTP_NR_SELECTIVE_ACK)) { + sack_goes_to = chk->whoTo; + break; + } + } + } max_rwnd_per_dest = ((asoc->peers_rwnd + asoc->total_flight) / asoc->numnets); if (stcb->sctp_socket) max_send_per_dest = SCTP_SB_LIMIT_SND(stcb->sctp_socket) / asoc->numnets; @@ -7685,6 +7702,28 @@ again_one_more_time: /************************/ /* Now first lets go through the control queue */ TAILQ_FOREACH_SAFE(chk, &asoc->control_send_queue, sctp_next, nchk) { + if ((sack_goes_to) && + (chk->rec.chunk_id.id == SCTP_ECN_ECHO) && + (chk->whoTo != sack_goes_to)) { + /* + * if we have a sack in queue, and we are + * looking at an ecn echo that is NOT queued + * to where the sack is going.. + */ + if (chk->whoTo == net) { + /* + * Don't transmit it to where its + * going (current net) + */ + continue; + } else if (sack_goes_to == net) { + /* + * But do transmit it to this + * address + */ + goto skip_net_check; + } + } if (chk->whoTo != net) { /* * No, not sent to the network we are @@ -7692,6 +7731,7 @@ again_one_more_time: */ continue; } + skip_net_check: if (chk->data == NULL) { continue; } @@ -10761,11 +10801,19 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_ECHO) { + if ((chk->rec.chunk_id.id == SCTP_ECN_ECHO) && (net == chk->whoTo)) { /* found a previous ECN_ECHO update it if needed */ + uint32_t cnt, ctsn; + ecne = mtod(chk->data, struct sctp_ecne_chunk *); - ecne->tsn = htonl(high_tsn); - SCTP_STAT_INCR(sctps_queue_upd_ecne); + ctsn = ntohl(ecne->tsn); + if (SCTP_TSN_GT(high_tsn, ctsn)) { + ecne->tsn = htonl(high_tsn); + cnt = ntohl(ecne->num_pkts_since_cwr); + cnt++; + ecne->num_pkts_since_cwr = htonl(cnt); + SCTP_STAT_INCR(sctps_queue_upd_ecne); + } return; } } @@ -10797,7 +10845,8 @@ sctp_send_ecn_echo(struct sctp_tcb *stcb ecne->ch.chunk_flags = 0; ecne->ch.chunk_length = htons(sizeof(struct sctp_ecne_chunk)); ecne->tsn = htonl(high_tsn); - TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); + ecne->num_pkts_since_cwr = htonl(1); + TAILQ_INSERT_HEAD(&stcb->asoc.control_send_queue, chk, sctp_next); asoc->ctrl_queue_cnt++; } @@ -10975,7 +11024,7 @@ jump_out: } void -sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn) +sctp_send_cwr(struct sctp_tcb *stcb, struct sctp_nets *net, uint32_t high_tsn, uint8_t override) { struct sctp_association *asoc; struct sctp_cwr_chunk *cwr; @@ -10983,17 +11032,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str asoc = &stcb->asoc; SCTP_TCB_LOCK_ASSERT(stcb); - TAILQ_FOREACH(chk, &asoc->control_send_queue, sctp_next) { - if (chk->rec.chunk_id.id == SCTP_ECN_CWR) { - /* found a previous ECN_CWR update it if needed */ - cwr = mtod(chk->data, struct sctp_cwr_chunk *); - if (SCTP_TSN_GT(high_tsn, ntohl(cwr->tsn))) { - cwr->tsn = htonl(high_tsn); - } - return; - } - } - /* nope could not find one to update so we must build one */ + sctp_alloc_a_chunk(stcb, chk); if (chk == NULL) { return; @@ -11016,7 +11055,7 @@ sctp_send_cwr(struct sctp_tcb *stcb, str atomic_add_int(&chk->whoTo->ref_count, 1); cwr = mtod(chk->data, struct sctp_cwr_chunk *); cwr->ch.chunk_type = SCTP_ECN_CWR; - cwr->ch.chunk_flags = 0; + cwr->ch.chunk_flags = override; cwr->ch.chunk_length = htons(sizeof(struct sctp_cwr_chunk)); cwr->tsn = htonl(high_tsn); TAILQ_INSERT_TAIL(&stcb->asoc.control_send_queue, chk, sctp_next); Modified: head/sys/netinet/sctp_output.h ============================================================================== --- head/sys/netinet/sctp_output.h Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_output.h Sat Jan 29 19:55:29 2011 (r218072) @@ -163,7 +163,7 @@ sctp_send_packet_dropped(struct sctp_tcb -void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t); +void sctp_send_cwr(struct sctp_tcb *, struct sctp_nets *, uint32_t, uint8_t); void Modified: head/sys/netinet/sctp_pcb.c ============================================================================== --- head/sys/netinet/sctp_pcb.c Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_pcb.c Sat Jan 29 19:55:29 2011 (r218072) @@ -3854,6 +3854,7 @@ sctp_add_remote_addr(struct sctp_tcb *st net->RTO_measured = 0; stcb->asoc.numnets++; *(&net->ref_count) = 1; + net->cwr_window_tsn = net->last_cwr_tsn = stcb->asoc.sending_seq - 1; net->tos_flowlabel = 0; if (SCTP_BASE_SYSCTL(sctp_udp_tunneling_for_client_enable)) { net->port = htons(SCTP_BASE_SYSCTL(sctp_udp_tunneling_port)); Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctp_structs.h Sat Jan 29 19:55:29 2011 (r218072) @@ -211,7 +211,10 @@ struct sctp_nets { /* mtu discovered so far */ uint32_t mtu; uint32_t ssthresh; /* not sure about this one for split */ - + uint32_t last_cwr_tsn; + uint32_t cwr_window_tsn; + uint32_t ecn_ce_pkt_cnt; + uint32_t lost_cnt; /* smoothed average things for RTT and RTO itself */ int lastsa; int lastsv; @@ -864,7 +867,6 @@ struct sctp_association { uint32_t highest_tsn_inside_nr_map; uint32_t last_echo_tsn; - uint32_t last_cwr_tsn; uint32_t fast_recovery_tsn; uint32_t sat_t3_recovery_tsn; uint32_t tsn_last_delivered; @@ -1048,7 +1050,6 @@ struct sctp_association { uint16_t ecn_echo_cnt_onq; uint16_t free_chunk_cnt; - uint8_t stream_locked; uint8_t authenticated; /* packet authenticated ok */ /* Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Sat Jan 29 15:56:40 2011 (r218071) +++ head/sys/netinet/sctputil.c Sat Jan 29 19:55:29 2011 (r218072) @@ -971,7 +971,6 @@ sctp_init_asoc(struct sctp_inpcb *m, str asoc->last_net_cmt_send_started = NULL; /* This will need to be adjusted */ - asoc->last_cwr_tsn = asoc->init_seq_number - 1; asoc->last_acked_seq = asoc->init_seq_number - 1; asoc->advanced_peer_ack_point = asoc->last_acked_seq; asoc->asconf_seq_in = asoc->last_acked_seq; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 20:25:20 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A1E2D1065674; Sat, 29 Jan 2011 20:25:20 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 773138FC16; Sat, 29 Jan 2011 20:25:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TKPKLU044178; Sat, 29 Jan 2011 20:25:20 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TKPK35044174; Sat, 29 Jan 2011 20:25:20 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101292025.p0TKPK35044174@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Jan 2011 20:25:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218073 - in head/sys: arm/include dev/fdt powerpc/include X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 20:25:20 -0000 Author: marcel Date: Sat Jan 29 20:25:20 2011 New Revision: 218073 URL: http://svn.freebsd.org/changeset/base/218073 Log: Introduce macro FDT_MAP_IRQ to map from an interrupt controller and interrupt pin pair to a global IRQ number. When multiple PICs exist on a board, the interrupt pin alone is not unique. Modified: head/sys/arm/include/fdt.h head/sys/dev/fdt/fdt_common.c head/sys/powerpc/include/fdt.h Modified: head/sys/arm/include/fdt.h ============================================================================== --- head/sys/arm/include/fdt.h Sat Jan 29 19:55:29 2011 (r218072) +++ head/sys/arm/include/fdt.h Sat Jan 29 20:25:20 2011 (r218073) @@ -44,6 +44,9 @@ /* Max interrupt number */ #define FDT_INTR_MAX NIRQ +/* Map phandle/intpin pair to global IRQ number */ +#define FDT_MAP_IRQ(node, pin) (pin) + /* * Bus space tag. XXX endianess info needs to be derived from the blob. */ Modified: head/sys/dev/fdt/fdt_common.c ============================================================================== --- head/sys/dev/fdt/fdt_common.c Sat Jan 29 19:55:29 2011 (r218072) +++ head/sys/dev/fdt/fdt_common.c Sat Jan 29 20:25:20 2011 (r218073) @@ -480,7 +480,7 @@ fdt_intr_to_rl(phandle_t node, struct re pcell_t *intr; pcell_t intr_cells; int interrupt, trig, pol; - int i, intr_num, rv; + int i, intr_num, irq, rv; if (OF_getproplen(node, "interrupts") <= 0) /* Node does not have 'interrupts' property. */ @@ -532,7 +532,8 @@ fdt_intr_to_rl(phandle_t node, struct re intr_sl[i].trig = trig; intr_sl[i].pol = pol; - resource_list_add(rl, SYS_RES_IRQ, i, interrupt, interrupt, 1); + irq = FDT_MAP_IRQ(intr_par, interrupt); + resource_list_add(rl, SYS_RES_IRQ, i, irq, irq, 1); } out: Modified: head/sys/powerpc/include/fdt.h ============================================================================== --- head/sys/powerpc/include/fdt.h Sat Jan 29 19:55:29 2011 (r218072) +++ head/sys/powerpc/include/fdt.h Sat Jan 29 20:25:20 2011 (r218073) @@ -38,6 +38,9 @@ /* Max interrupt number */ #define FDT_INTR_MAX INTR_VECTORS +/* Map phandle/intpin pair to global IRQ number */ +#define FDT_MAP_IRQ(node, pin) powerpc_get_irq(node, pin) + /* * Bus space tag. XXX endianess info needs to be derived from the blob. */ From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 20:28:18 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A747106566B; Sat, 29 Jan 2011 20:28:18 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 009628FC16; Sat, 29 Jan 2011 20:28:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TKSHgA044304; Sat, 29 Jan 2011 20:28:17 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TKSHXB044302; Sat, 29 Jan 2011 20:28:17 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101292028.p0TKSHXB044302@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Jan 2011 20:28:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218074 - head/sys/powerpc/mpc85xx X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 20:28:18 -0000 Author: marcel Date: Sat Jan 29 20:28:17 2011 New Revision: 218074 URL: http://svn.freebsd.org/changeset/base/218074 Log: Have nexus behave the same as the one on ARM (marvell SoCs), so as to prevent warnings during boot WRT to the fdtbus attachment. Modified: head/sys/powerpc/mpc85xx/nexus.c Modified: head/sys/powerpc/mpc85xx/nexus.c ============================================================================== --- head/sys/powerpc/mpc85xx/nexus.c Sat Jan 29 20:25:20 2011 (r218073) +++ head/sys/powerpc/mpc85xx/nexus.c Sat Jan 29 20:28:17 2011 (r218074) @@ -69,6 +69,7 @@ __FBSDID("$FreeBSD$"); * Device interface */ static int nexus_probe(device_t); +static int nexus_attach(device_t); static int nexus_activate_resource(device_t, device_t, int, int, struct resource *); static int nexus_deactivate_resource(device_t, device_t, int, int, @@ -77,14 +78,14 @@ static int nexus_deactivate_resource(dev static device_method_t nexus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, nexus_probe), - DEVMETHOD(device_attach, bus_generic_attach), + DEVMETHOD(device_attach, nexus_attach), DEVMETHOD(device_detach, bus_generic_detach), DEVMETHOD(device_shutdown, bus_generic_shutdown), DEVMETHOD(device_suspend, bus_generic_suspend), DEVMETHOD(device_resume, bus_generic_resume), /* Bus interface. Resource management is business of the children... */ - DEVMETHOD(bus_add_child, NULL), + DEVMETHOD(bus_add_child, bus_generic_add_child), DEVMETHOD(bus_print_child, bus_generic_print_child), DEVMETHOD(bus_probe_nomatch, NULL), DEVMETHOD(bus_read_ivar, NULL), @@ -109,17 +110,25 @@ static devclass_t nexus_devclass; DRIVER_MODULE(nexus, root, nexus_driver, nexus_devclass, 0, 0); static int -nexus_probe (device_t dev) +nexus_probe(device_t dev) { - device_add_child(dev, "fdtbus", 0); - device_quiet(dev); - + if (!bootverbose) + device_quiet(dev); return (BUS_PROBE_DEFAULT); } static int -nexus_activate_resource (device_t bus, device_t child, int type, int rid, +nexus_attach(device_t dev) +{ + + bus_generic_probe(dev); + bus_generic_attach(dev); + return (0); +} + +static int +nexus_activate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { @@ -128,7 +137,7 @@ nexus_activate_resource (device_t bus, d } static int -nexus_deactivate_resource (device_t bus, device_t child, int type, int rid, +nexus_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res) { From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 20:58:38 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B17711065672; Sat, 29 Jan 2011 20:58:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9FC608FC19; Sat, 29 Jan 2011 20:58:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TKwc4c045150; Sat, 29 Jan 2011 20:58:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TKwcRZ045134; Sat, 29 Jan 2011 20:58:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101292058.p0TKwcRZ045134@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Jan 2011 20:58:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218075 - in head/sys/powerpc: include mambo mpc85xx powermac powerpc ps3 psim X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 20:58:38 -0000 Author: marcel Date: Sat Jan 29 20:58:38 2011 New Revision: 218075 URL: http://svn.freebsd.org/changeset/base/218075 Log: Fix the interrupt code, broken 7 months ago. The interrupt framework already supported nested PICs, but was limited to having a nested AT-PIC only. With G5 support the need for nested OpenPIC controllers needed to be added. This was done the wrong way and broke the MPC8555 eval system in the process. OFW, as well as FDT, describe the interrupt routing in terms of a controller and an interrupt pin on it. This needs to be mapped to a flat and global resource: the IRQ. The IRQ is the same as the PCI intline and as such needs to be representable in 8 bits. Secondly, ISA support pretty much dictates that IRQ 0-15 should be reserved for ISA interrupts, because of the internal workins of south bridges. Both were broken. This change reverts revision 209298 for a big part and re-implements it simpler. In particular: o The id() method of the PIC I/F is removed again. It's not needed. o The openpic_attach() function has been changed to take the OFW or FDT phandle of the controller as a second argument. All bus attachments that previously used openpic_attach() as the attach method of the device I/F now implement as bus-specific method and pass the phandle_t to the renamed openpic_attach(). o Change powerpc_register_pic() to take a few more arguments. In particular: - Pass the number of IPIs specificly. The number of IRQs carved out for a PIC is the sum of the number of int. pins and IPIs. - Pass a flag indicating whether the PIC is an AT-PIC or not. This tells the interrupt framework whether to assign IRQ 0-15 or some other range. o Until we implement proper multi-pass bus enumeration, we have to handle the case where we need to map from PIC+pin to IRQ *before* the PIC gets registered. This is done in a similar way as before, but rather than carving out 256 IRQs per PIC, we carve out 128 IRQs (124 pins + 4 IPIs). This is supposed to handle the G5 case, but should really be fixed properly using multiple passes. o Have the interrupt framework set root_pic in most cases and not put that burden in PIC drivers (for the most part). o Remove powerpc_ign_lookup() and replace it with powerpc_get_irq(). Remove IGN_SHIFT, INTR_INTLINE and INTR_IGN. Related to the above, fix the Freescale PCI controller driver, broken by the FDT code. Besides not attaching properly, bus numbers were assigned improperly and enumeration was broken in general. This prevented the AT PIC from being discovered and interrupt routing to work properly. Consequently, the ata(4) controller stopped functioning. Fix the driver, and FDT PCI support, enough to get the MPC8555CDS going again. The FDT PCI code needs a whole lot more work. No breakages are expected, but lackiong G5 hardware, it's possible that there are unpleasant side-effects. At least MPC85xx support is back to where it was 7 months ago -- it's amazing how badly support can be broken in just 7 months... Sponsored by: Juniper Networks Modified: head/sys/powerpc/include/intr_machdep.h head/sys/powerpc/include/openpicvar.h head/sys/powerpc/mambo/mambo_openpic.c head/sys/powerpc/mpc85xx/atpic.c head/sys/powerpc/mpc85xx/isa.c head/sys/powerpc/mpc85xx/openpic_fdt.c head/sys/powerpc/mpc85xx/pci_fdt.c head/sys/powerpc/powermac/cpcht.c head/sys/powerpc/powermac/hrowpic.c head/sys/powerpc/powermac/openpic_macio.c head/sys/powerpc/powerpc/intr_machdep.c head/sys/powerpc/powerpc/openpic.c head/sys/powerpc/powerpc/pic_if.m head/sys/powerpc/ps3/ps3pic.c head/sys/powerpc/psim/openpic_iobus.c Modified: head/sys/powerpc/include/intr_machdep.h ============================================================================== --- head/sys/powerpc/include/intr_machdep.h Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/include/intr_machdep.h Sat Jan 29 20:58:38 2011 (r218075) @@ -29,13 +29,9 @@ #define _MACHINE_INTR_MACHDEP_H_ #define INTR_VECTORS 256 -#define MAX_PICS 5 -#define IGN_SHIFT 8 -#define INTR_INTLINE(irq) (irq & ((1 << IGN_SHIFT) - 1)) -#define INTR_IGN(irq) (irq >> IGN_SHIFT) - -#define INTR_VEC(pic_id, irq) ((powerpc_ign_lookup(pic_id) << IGN_SHIFT) | (irq)) +#define MAX_PICS 5 +#define INTR_VEC(node, pin) powerpc_get_irq(node, pin) /* * Default base address for MSI messages on PowerPC @@ -50,8 +46,8 @@ driver_filter_t powerpc_ipi_handler; void intrcnt_add(const char *name, u_long **countp); -void powerpc_register_pic(device_t, u_int); -int powerpc_ign_lookup(uint32_t pic_id); +void powerpc_register_pic(device_t, uint32_t, u_int, u_int, u_int); +u_int powerpc_get_irq(uint32_t, u_int); void powerpc_dispatch_intr(u_int, struct trapframe *); int powerpc_enable_intr(void); Modified: head/sys/powerpc/include/openpicvar.h ============================================================================== --- head/sys/powerpc/include/openpicvar.h Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/include/openpicvar.h Sat Jan 29 20:58:38 2011 (r218075) @@ -52,7 +52,7 @@ extern devclass_t openpic_devclass; /* * Bus-independent attach i/f */ -int openpic_attach(device_t); +int openpic_common_attach(device_t, uint32_t); /* * PIC interface. Modified: head/sys/powerpc/mambo/mambo_openpic.c ============================================================================== --- head/sys/powerpc/mambo/mambo_openpic.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/mambo/mambo_openpic.c Sat Jan 29 20:58:38 2011 (r218075) @@ -56,12 +56,11 @@ __FBSDID("$FreeBSD$"); * Mambo interface */ static int openpic_mambo_probe(device_t); -static uint32_t openpic_mambo_id(device_t dev); +static int openpic_mambo_attach(device_t); static int openpicbus_mambo_probe(device_t dev); static int openpicbus_mambo_attach(device_t dev); -static struct resource *openpicbus_alloc_resource(device_t bus, device_t dev, - int type, int *rid, u_long start, u_long end, u_long count, - u_int flags); +static struct resource *openpicbus_alloc_resource(device_t bus, device_t dev, + int type, int *rid, u_long start, u_long end, u_long count, u_int flags); static device_method_t openpicbus_mambo_methods[] = { /* Device interface */ @@ -87,7 +86,7 @@ static driver_t openpicbus_mambo_driver static device_method_t openpic_mambo_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_mambo_probe), - DEVMETHOD(device_attach, openpic_attach), + DEVMETHOD(device_attach, openpic_mambo_attach), /* PIC interface */ DEVMETHOD(pic_config, openpic_config), @@ -97,7 +96,6 @@ static device_method_t openpic_mambo_me DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), - DEVMETHOD(pic_id, openpic_mambo_id), { 0, 0 }, }; @@ -167,14 +165,15 @@ openpicbus_alloc_resource(device_t bus, static int openpic_mambo_probe(device_t dev) { + device_set_desc(dev, OPENPIC_DEVSTR); - return (0); } -static uint32_t -openpic_mambo_id(device_t dev) +static int +openpic_mambo_attach(device_t dev) { - return (ofw_bus_get_node(device_get_parent(dev))); + + return (openpic_common_attach(dev, + ofw_bus_get_node(device_get_parent(dev)))); } - Modified: head/sys/powerpc/mpc85xx/atpic.c ============================================================================== --- head/sys/powerpc/mpc85xx/atpic.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/mpc85xx/atpic.c Sat Jan 29 20:58:38 2011 (r218075) @@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -79,7 +78,6 @@ static void atpic_eoi(device_t, u_int); static void atpic_ipi(device_t, u_int); static void atpic_mask(device_t, u_int); static void atpic_unmask(device_t, u_int); -static uint32_t atpic_id (device_t dev); static device_method_t atpic_isa_methods[] = { /* Device interface */ @@ -95,7 +93,6 @@ static device_method_t atpic_isa_methods DEVMETHOD(pic_ipi, atpic_ipi), DEVMETHOD(pic_mask, atpic_mask), DEVMETHOD(pic_unmask, atpic_unmask), - DEVMETHOD(pic_id, atpic_id), { 0, 0 }, }; @@ -154,7 +151,7 @@ atpic_isa_identify(driver_t *drv, device bus_set_resource(child, SYS_RES_IOPORT, ATPIC_SLAVE, IO_ICU2, 2); /* ISA interrupts are routed through external interrupt 0. */ - bus_set_resource(child, SYS_RES_IRQ, 0, PIC_IRQ_EXT(0), 1); + bus_set_resource(child, SYS_RES_IRQ, 0, 16, 1); } static int @@ -221,7 +218,7 @@ atpic_isa_attach(device_t dev) atpic_init(sc, ATPIC_SLAVE); atpic_init(sc, ATPIC_MASTER); - powerpc_register_pic(dev, 0x10); + powerpc_register_pic(dev, 0, 16, 0, TRUE); return (0); fail: @@ -328,11 +325,3 @@ atpic_unmask(device_t dev, u_int irq) atpic_write(sc, ATPIC_MASTER, 1, sc->sc_mask[ATPIC_MASTER]); } } - -static uint32_t -atpic_id (device_t dev) -{ - - return (ATPIC_ID); -} - Modified: head/sys/powerpc/mpc85xx/isa.c ============================================================================== --- head/sys/powerpc/mpc85xx/isa.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/mpc85xx/isa.c Sat Jan 29 20:58:38 2011 (r218075) @@ -33,15 +33,12 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include #include -#include "ocpbus.h" - void isa_init(device_t dev) { @@ -62,10 +59,7 @@ isa_alloc_resource(device_t bus, device_ resource_list_find(rl, type, *rid) == NULL) { switch (type) { case SYS_RES_IOPORT: rids = ISA_PNP_NPORT; break; - case SYS_RES_IRQ: - rids = ISA_PNP_NIRQ; - start = ISA_IRQ(start); - break; + case SYS_RES_IRQ: rids = ISA_PNP_NIRQ; break; case SYS_RES_MEMORY: rids = ISA_PNP_NMEM; break; default: rids = 0; break; } Modified: head/sys/powerpc/mpc85xx/openpic_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/openpic_fdt.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/mpc85xx/openpic_fdt.c Sat Jan 29 20:58:38 2011 (r218075) @@ -45,12 +45,12 @@ __FBSDID("$FreeBSD$"); #include "pic_if.h" static int openpic_fdt_probe(device_t); -static uint32_t openpic_fdt_id(device_t); +static int openpic_fdt_attach(device_t); static device_method_t openpic_fdt_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_fdt_probe), - DEVMETHOD(device_attach, openpic_attach), + DEVMETHOD(device_attach, openpic_fdt_attach), /* PIC interface */ DEVMETHOD(pic_bind, openpic_bind), @@ -61,7 +61,6 @@ static device_method_t openpic_fdt_metho DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), - DEVMETHOD(pic_id, openpic_fdt_id), { 0, 0 }, }; @@ -85,9 +84,9 @@ openpic_fdt_probe(device_t dev) return (BUS_PROBE_DEFAULT); } -static uint32_t -openpic_fdt_id(device_t dev) +static int +openpic_fdt_attach(device_t dev) { - return (ofw_bus_get_node(dev)); + return (openpic_common_attach(dev, ofw_bus_get_node(dev))); } Modified: head/sys/powerpc/mpc85xx/pci_fdt.c ============================================================================== --- head/sys/powerpc/mpc85xx/pci_fdt.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/mpc85xx/pci_fdt.c Sat Jan 29 20:58:38 2011 (r218075) @@ -136,7 +136,7 @@ static int fsl_pcib_decode_win(phandle_t static void fsl_pcib_err_init(device_t); static void fsl_pcib_inbound(struct fsl_pcib_softc *, int, int, u_long, u_long, u_long); -static int fsl_pcib_init(struct fsl_pcib_softc *, int, int, int); +static int fsl_pcib_init(struct fsl_pcib_softc *, int, int); static int fsl_pcib_intr_info(phandle_t, struct fsl_pcib_softc *); static int fsl_pcib_set_range(struct fsl_pcib_softc *, int, int, u_long, u_long); @@ -160,8 +160,6 @@ static uint32_t fsl_pcib_read_config(dev static void fsl_pcib_write_config(device_t, u_int, u_int, u_int, u_int, uint32_t, int); -static int next_busnr = 0; - /* Configuration r/w mutex. */ struct mtx pcicfg_mtx; static int mtx_initialized = 0; @@ -215,23 +213,17 @@ DRIVER_MODULE(pcib, fdtbus, fsl_pcib_dri static int fsl_pcib_probe(device_t dev) { - phandle_t parnode; + phandle_t node; - /* - * The PCI subnode does not have the 'compatible' property, so we need - * to check in the parent PCI node. However the parent is not - * represented by a separate ofw_bus child, and therefore - * ofw_bus_is_compatible() cannot be used, but direct fdt equivalent. - */ - parnode = OF_parent(ofw_bus_get_node(dev)); - if (parnode == 0) + node = ofw_bus_get_node(dev); + if (!fdt_is_type(node, "pci")) return (ENXIO); - if (!(fdt_is_compatible(parnode, "fsl,mpc8548-pcie") || - fdt_is_compatible(parnode, "fsl,mpc8548-pcie"))) + + if (!(fdt_is_compatible(node, "fsl,mpc8540-pci") || + fdt_is_compatible(node, "fsl,mpc8548-pcie"))) return (ENXIO); device_set_desc(dev, "Freescale Integrated PCI/PCI-E Controller"); - return (BUS_PROBE_DEFAULT); } @@ -241,7 +233,7 @@ fsl_pcib_attach(device_t dev) struct fsl_pcib_softc *sc; phandle_t node; uint32_t cfgreg; - int maxslot, subbus; + int maxslot; uint8_t ltssm, capptr; sc = device_get_softc(dev); @@ -304,23 +296,13 @@ fsl_pcib_attach(device_t dev) sc->sc_devfn_tundra = -1; sc->sc_devfn_via_ide = -1; - maxslot = (sc->sc_pcie) ? 1 : 31; /* - * Scan bus using firmware configured, 0 based bus numbering, - * let fsl_pcib_init() shift bus number by next_busnr offset. + * Scan bus using firmware configured, 0 based bus numbering. */ - sc->sc_busnr = 1; - subbus = fsl_pcib_init(sc, 0, next_busnr, maxslot); - - if (bootverbose) - printf("PCI: domain %d, busnr = %d, next_busnr = %d\n", - device_get_unit(dev), next_busnr + 1, - next_busnr + subbus + 1); - - /* Set final busnr */ - sc->sc_busnr = next_busnr + 1; - next_busnr += subbus + 1; + sc->sc_busnr = 0; + maxslot = (sc->sc_pcie) ? 0 : PCI_SLOTMAX; + fsl_pcib_init(sc, sc->sc_busnr, maxslot); if (sc->sc_pcie) { ltssm = fsl_pcib_cfgread(sc, 0, 0, 0, PCIR_LTSSM, 1); @@ -455,7 +437,7 @@ fsl_pcib_maxslots(device_t dev) { struct fsl_pcib_softc *sc = device_get_softc(dev); - return ((sc->sc_pcie) ? 1 : 31); + return ((sc->sc_pcie) ? 0 : PCI_SLOTMAX); } static uint32_t @@ -572,14 +554,11 @@ fsl_pcib_route_int(struct fsl_pcib_softc devfn = DEVFN(bus, slot, func); if (devfn == sc->sc_devfn_via_ide) -#if 0 - intline = INTR_VEC(ATPIC_ID, 14); + intline = INTR_VEC(0, 14); else if (devfn == sc->sc_devfn_via_ide + 1) - intline = INTR_VEC(ATPIC_ID, 10); + intline = INTR_VEC(0, 10); else if (devfn == sc->sc_devfn_via_ide + 2) - intline = INTR_VEC(ATPIC_ID, 10); -#endif - ; + intline = INTR_VEC(0, 10); else { if (intpin != 0) err = fdt_pci_route_intr(bus, slot, func, intpin, @@ -596,10 +575,9 @@ fsl_pcib_route_int(struct fsl_pcib_softc } static int -fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int busnr_offset, - int maxslot) +fsl_pcib_init(struct fsl_pcib_softc *sc, int bus, int maxslot) { - int secbus, subbus; + int secbus; int old_pribus, old_secbus, old_subbus; int new_pribus, new_secbus, new_subbus; int slot, func, maxfunc; @@ -608,11 +586,10 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, uint8_t command, hdrtype, class, subclass; uint8_t intline, intpin; - subbus = bus; + secbus = bus; for (slot = 0; slot <= maxslot; slot++) { maxfunc = 0; for (func = 0; func <= maxfunc; func++) { - hdrtype = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, PCIR_HDRTYPE, 1); @@ -667,19 +644,14 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, func, PCIR_CLASS, 1); subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, func, PCIR_SUBCLASS, 1); -#if 0 + /* Allow only proper PCI-PCI briges */ if (class != PCIC_BRIDGE) continue; if (subclass != PCIS_BRIDGE_PCI) continue; -#endif - /* Allow all DEVTYPE 1 devices */ - if (hdrtype != PCIM_HDRTYPE_BRIDGE) - continue; - subbus++; - secbus = subbus; + secbus++; /* Program I/O decoder. */ fsl_pcib_write_config(sc->sc_dev, bus, slot, func, @@ -718,31 +690,20 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, if (bootverbose) printf("PCI: reading firmware bus numbers for " "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", - secbus + busnr_offset, old_pribus, - old_secbus, old_subbus); + secbus, old_pribus, old_secbus, old_subbus); - /* Skip unconfigured devices */ - if ((old_pribus == 0) && - (old_secbus == 0) && (old_subbus == 0)) - continue; + new_pribus = bus; + new_secbus = secbus; - subbus += fsl_pcib_init(sc, secbus, busnr_offset, - (subclass == PCIS_BRIDGE_PCI) ? 31 : 1); + secbus = fsl_pcib_init(sc, secbus, + (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); - new_pribus = bus + busnr_offset; - new_secbus = secbus + busnr_offset; - new_subbus = subbus + busnr_offset; - - /* Fixup pribus for MPC8572 PCIE controller */ - if ((vendor == 0x1957) && ((device = 0x0040) || - (device == 0x0041))) - new_pribus = 0; + new_subbus = secbus; if (bootverbose) - printf("PCI: translate firmware bus numbers for " - "secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", - secbus + busnr_offset, - old_pribus, old_secbus, old_subbus, + printf("PCI: translate firmware bus numbers " + "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", + secbus, old_pribus, old_secbus, old_subbus, new_pribus, new_secbus, new_subbus); fsl_pcib_write_config(sc->sc_dev, bus, slot, func, @@ -754,11 +715,7 @@ fsl_pcib_init(struct fsl_pcib_softc *sc, } } - if (bootverbose) - printf("PCI: bus %d, #subbus = %d\n", - bus + busnr_offset, subbus - bus); - - return (subbus - bus); + return (secbus); } static void @@ -938,12 +895,10 @@ fsl_pcib_alloc_resource(device_t dev, de va = sc->sc_iomem_va; break; case SYS_RES_IRQ: -#if 0 - if (INTR_IGN(start) == powerpc_ign_lookup(ATPIC_ID)) { + if (start < 16) { device_printf(dev, "%s requested ISA interrupt %lu\n", device_get_nameunit(child), start); } -#endif flags |= RF_SHAREABLE; return (BUS_ALLOC_RESOURCE(device_get_parent(dev), child, type, rid, start, end, count, flags)); Modified: head/sys/powerpc/powermac/cpcht.c ============================================================================== --- head/sys/powerpc/powermac/cpcht.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powermac/cpcht.c Sat Jan 29 20:58:38 2011 (r218075) @@ -757,7 +757,6 @@ static void openpic_cpcht_config(device_ static void openpic_cpcht_enable(device_t, u_int irq, u_int vector); static void openpic_cpcht_unmask(device_t, u_int irq); static void openpic_cpcht_eoi(device_t, u_int irq); -static uint32_t openpic_cpcht_id(device_t); static device_method_t openpic_cpcht_methods[] = { /* Device interface */ @@ -773,7 +772,6 @@ static device_method_t openpic_cpcht_me DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_cpcht_unmask), - DEVMETHOD(pic_id, openpic_cpcht_id), { 0, 0 }, }; @@ -808,9 +806,11 @@ static int openpic_cpcht_attach(device_t dev) { struct openpic_cpcht_softc *sc; + phandle_t node; int err, irq; - err = openpic_attach(dev); + node = ofw_bus_get_node(dev); + err = openpic_common_attach(dev, node); if (err != 0) return (err); @@ -839,9 +839,8 @@ openpic_cpcht_attach(device_t dev) * be necessary, but Linux does it, and I cannot find any U3 machines * with MSI devices to test. */ - if (dev == root_pic) - cpcht_msipic = PIC_ID(dev); + cpcht_msipic = node; return (0); } @@ -981,10 +980,3 @@ openpic_cpcht_eoi(device_t dev, u_int ir openpic_eoi(dev, irq); } - -static uint32_t -openpic_cpcht_id(device_t dev) -{ - return (ofw_bus_get_node(dev)); -} - Modified: head/sys/powerpc/powermac/hrowpic.c ============================================================================== --- head/sys/powerpc/powermac/hrowpic.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powermac/hrowpic.c Sat Jan 29 20:58:38 2011 (r218075) @@ -69,7 +69,6 @@ static void hrowpic_eoi(device_t, u_int) static void hrowpic_ipi(device_t, u_int); static void hrowpic_mask(device_t, u_int); static void hrowpic_unmask(device_t, u_int); -static uint32_t hrowpic_id(device_t dev); static device_method_t hrowpic_methods[] = { /* Device interface */ @@ -80,7 +79,6 @@ static device_method_t hrowpic_methods[ DEVMETHOD(pic_dispatch, hrowpic_dispatch), DEVMETHOD(pic_enable, hrowpic_enable), DEVMETHOD(pic_eoi, hrowpic_eoi), - DEVMETHOD(pic_id, hrowpic_id), DEVMETHOD(pic_ipi, hrowpic_ipi), DEVMETHOD(pic_mask, hrowpic_mask), DEVMETHOD(pic_unmask, hrowpic_unmask), @@ -169,9 +167,7 @@ hrowpic_attach(device_t dev) hrowpic_write_reg(sc, HPIC_ENABLE, HPIC_SECONDARY, 0); hrowpic_write_reg(sc, HPIC_CLEAR, HPIC_SECONDARY, 0xffffffff); - powerpc_register_pic(dev, 64); - root_pic = dev; /* Heathrow systems have only one PIC */ - + powerpc_register_pic(dev, ofw_bus_get_node(dev), 64, 0, FALSE); return (0); } @@ -282,10 +278,3 @@ hrowpic_unmask(device_t dev, u_int irq) sc = device_get_softc(dev); hrowpic_toggle_irq(sc, irq, 1); } - -static uint32_t -hrowpic_id(device_t dev) -{ - return (ofw_bus_get_node(dev)); -} - Modified: head/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- head/sys/powerpc/powermac/openpic_macio.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powermac/openpic_macio.c Sat Jan 29 20:58:38 2011 (r218075) @@ -58,12 +58,12 @@ __FBSDID("$FreeBSD$"); * MacIO interface */ static int openpic_macio_probe(device_t); -static uint32_t openpic_macio_id(device_t); +static int openpic_macio_attach(device_t); static device_method_t openpic_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_macio_probe), - DEVMETHOD(device_attach, openpic_attach), + DEVMETHOD(device_attach, openpic_macio_attach), /* PIC interface */ DEVMETHOD(pic_bind, openpic_bind), @@ -74,7 +74,6 @@ static device_method_t openpic_macio_me DEVMETHOD(pic_ipi, openpic_ipi), DEVMETHOD(pic_mask, openpic_mask), DEVMETHOD(pic_unmask, openpic_unmask), - DEVMETHOD(pic_id, openpic_macio_id), { 0, 0 }, }; @@ -99,9 +98,9 @@ openpic_macio_probe(device_t dev) return (0); } -static uint32_t -openpic_macio_id(device_t dev) +static int +openpic_macio_attach(device_t dev) { - return (ofw_bus_get_node(dev)); + + return (openpic_common_attach(dev, ofw_bus_get_node(dev))); } - Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powerpc/intr_machdep.c Sat Jan 29 20:58:38 2011 (r218075) @@ -60,6 +60,8 @@ * $FreeBSD$ */ +#include "opt_isa.h" + #include #include #include @@ -102,9 +104,11 @@ struct powerpc_intr { }; struct pic { - device_t pic; - uint32_t pic_id; - int ipi_irq; + device_t dev; + uint32_t node; + u_int irqs; + u_int ipis; + int base; }; static u_int intrcnt_index = 0; @@ -113,6 +117,11 @@ static struct powerpc_intr *powerpc_intr static struct pic piclist[MAX_PICS]; static u_int nvectors; /* Allocated vectors */ static u_int npics; /* PICs registered */ +#ifdef DEV_ISA +static u_int nirqs = 16; /* Allocated IRQS (ISA pre-allocated). */ +#else +static u_int nirqs = 0; /* Allocated IRQs. */ +#endif static u_int stray_count; device_t root_pic; @@ -142,7 +151,6 @@ smp_intr_init(void *dummy __unused) PIC_BIND(i->pic, i->intline, i->cpu); } } - SYSINIT(smp_intr_init, SI_SUB_SMP, SI_ORDER_ANY, smp_intr_init, NULL); #endif @@ -231,9 +239,21 @@ intr_lookup(u_int irq) static int powerpc_map_irq(struct powerpc_intr *i) { + struct pic *p; + u_int cnt; + int idx; + + for (idx = 0; idx < npics; idx++) { + p = &piclist[idx]; + cnt = p->irqs + p->ipis; + if (i->irq >= p->base && i->irq < p->base + cnt) + break; + } + if (idx == npics) + return (EINVAL); - i->intline = INTR_INTLINE(i->irq); - i->pic = piclist[INTR_IGN(i->irq)].pic; + i->intline = i->irq - p->base; + i->pic = p->dev; /* Try a best guess if that failed */ if (i->pic == NULL) @@ -288,46 +308,76 @@ powerpc_assign_intr_cpu(void *arg, u_cha } void -powerpc_register_pic(device_t dev, u_int ipi) +powerpc_register_pic(device_t dev, uint32_t node, u_int irqs, u_int ipis, + u_int atpic) { - int i; + struct pic *p; + u_int irq; + int idx; mtx_lock(&intr_table_lock); - for (i = 0; i < npics; i++) { - if (piclist[i].pic_id == PIC_ID(dev)) + /* XXX see powerpc_get_irq(). */ + for (idx = 0; idx < npics; idx++) { + p = &piclist[idx]; + if (p->node != node) + continue; + if (node != 0 || p->dev == dev) break; } - piclist[i].pic = dev; - piclist[i].pic_id = PIC_ID(dev); - piclist[i].ipi_irq = ipi; - if (i == npics) + p = &piclist[idx]; + + p->dev = dev; + p->node = node; + p->irqs = irqs; + p->ipis = ipis; + if (idx == npics) { +#ifdef DEV_ISA + p->base = (atpic) ? 0 : nirqs; +#else + p->base = nirqs; +#endif + irq = p->base + irqs + ipis; + nirqs = MAX(nirqs, irq); npics++; + } mtx_unlock(&intr_table_lock); } -int -powerpc_ign_lookup(uint32_t pic_id) +u_int +powerpc_get_irq(uint32_t node, u_int pin) { - int i; + int idx; - mtx_lock(&intr_table_lock); + if (node == 0) + return (pin); - for (i = 0; i < npics; i++) { - if (piclist[i].pic_id == pic_id) { + mtx_lock(&intr_table_lock); + for (idx = 0; idx < npics; idx++) { + if (piclist[idx].node == node) { mtx_unlock(&intr_table_lock); - return (i); + return (piclist[idx].base + pin); } } - piclist[i].pic = NULL; - piclist[i].pic_id = pic_id; - piclist[i].ipi_irq = 0; + + /* + * XXX we should never encounter an unregistered PIC, but that + * can only be done when we properly support bus enumeration + * using multiple passes. Until then, fake an entry and give it + * some adhoc maximum number of IRQs and IPIs. + */ + piclist[idx].dev = NULL; + piclist[idx].node = node; + piclist[idx].irqs = 124; + piclist[idx].ipis = 4; + piclist[idx].base = nirqs; + nirqs += 128; npics++; mtx_unlock(&intr_table_lock); - return (i); + return (piclist[idx].base + pin); } int @@ -342,15 +392,18 @@ powerpc_enable_intr(void) if (npics == 0) panic("no PIC detected\n"); + if (root_pic == NULL) + root_pic = piclist[0].dev; + #ifdef SMP /* Install an IPI handler. */ - for (n = 0; n < npics; n++) { - if (piclist[n].pic != root_pic) + if (piclist[n].dev != root_pic) continue; + KASSERT(piclist[n].ipis != 0, ("%s", __func__)); error = powerpc_setup_intr("IPI", - INTR_VEC(piclist[n].pic_id, piclist[n].ipi_irq), + INTR_VEC(piclist[n].node, piclist[n].irqs), powerpc_ipi_handler, NULL, NULL, INTR_TYPE_MISC | INTR_EXCL, &ipi_cookie); if (error) { @@ -373,6 +426,9 @@ powerpc_enable_intr(void) i->pol != INTR_POLARITY_CONFORM) PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); + if (i != NULL && i->pic == root_pic) + PIC_BIND(i->pic, i->intline, i->cpu); + if (i->event != NULL) PIC_ENABLE(i->pic, i->intline, vector); } Modified: head/sys/powerpc/powerpc/openpic.c ============================================================================== --- head/sys/powerpc/powerpc/openpic.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powerpc/openpic.c Sat Jan 29 20:58:38 2011 (r218075) @@ -83,7 +83,7 @@ openpic_set_priority(struct openpic_soft } int -openpic_attach(device_t dev) +openpic_common_attach(device_t dev, uint32_t node) { struct openpic_softc *sc; u_int cpu, ipi, irq; @@ -217,7 +217,7 @@ openpic_attach(device_t dev) for (cpu = 0; cpu < sc->sc_ncpu; cpu++) openpic_write(sc, OPENPIC_PCPU_TPR(cpu), 0); - powerpc_register_pic(dev, sc->sc_nirq); + powerpc_register_pic(dev, node, sc->sc_nirq, 4, FALSE); /* If this is not a cascaded PIC, it must be the root PIC */ if (sc->sc_intr == NULL) @@ -285,7 +285,6 @@ openpic_dispatch(device_t dev, struct tr cpuid = (dev == root_pic) ? PCPU_GET(cpuid) : 0; sc = device_get_softc(dev); - while (1) { vector = openpic_read(sc, OPENPIC_PCPU_IACK(cpuid)); vector &= OPENPIC_VECTOR_MASK; Modified: head/sys/powerpc/powerpc/pic_if.m ============================================================================== --- head/sys/powerpc/powerpc/pic_if.m Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/powerpc/pic_if.m Sat Jan 29 20:58:38 2011 (r218075) @@ -66,10 +66,6 @@ METHOD void ipi { u_int cpu; }; -METHOD uint32_t id { - device_t dev; -}; - METHOD void mask { device_t dev; u_int irq; Modified: head/sys/powerpc/ps3/ps3pic.c ============================================================================== --- head/sys/powerpc/ps3/ps3pic.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/ps3/ps3pic.c Sat Jan 29 20:58:38 2011 (r218075) @@ -54,7 +54,6 @@ static void ps3pic_eoi(device_t, u_int); static void ps3pic_ipi(device_t, u_int); static void ps3pic_mask(device_t, u_int); static void ps3pic_unmask(device_t, u_int); -static uint32_t ps3pic_id(device_t dev); struct ps3pic_softc { uint64_t *bitmap_thread0; @@ -76,7 +75,6 @@ static device_method_t ps3pic_methods[] DEVMETHOD(pic_dispatch, ps3pic_dispatch), DEVMETHOD(pic_enable, ps3pic_enable), DEVMETHOD(pic_eoi, ps3pic_eoi), - DEVMETHOD(pic_id, ps3pic_id), DEVMETHOD(pic_ipi, ps3pic_ipi), DEVMETHOD(pic_mask, ps3pic_mask), DEVMETHOD(pic_unmask, ps3pic_unmask), @@ -146,9 +144,7 @@ ps3pic_attach(device_t dev) sc->sc_ipi_outlet[1], 0); #endif - powerpc_register_pic(dev, sc->sc_ipi_outlet[0]); - root_pic = dev; /* PS3s have only one PIC */ - + powerpc_register_pic(dev, 0, sc->sc_ipi_outlet[0], 1, FALSE); return (0); } @@ -245,10 +241,3 @@ ps3pic_unmask(device_t dev, u_int irq) lv1_did_update_interrupt_mask(ppe, 0); lv1_did_update_interrupt_mask(ppe, 1); } - -static uint32_t -ps3pic_id(device_t dev) -{ - return (0); -} - Modified: head/sys/powerpc/psim/openpic_iobus.c ============================================================================== --- head/sys/powerpc/psim/openpic_iobus.c Sat Jan 29 20:28:17 2011 (r218074) +++ head/sys/powerpc/psim/openpic_iobus.c Sat Jan 29 20:58:38 2011 (r218075) @@ -62,11 +62,12 @@ __FBSDID("$FreeBSD$"); * PSIM IOBus interface */ static int openpic_iobus_probe(device_t); +static int openpic_iobus_attach(device_t); static device_method_t openpic_iobus_methods[] = { /* Device interface */ DEVMETHOD(device_probe, openpic_iobus_probe), - DEVMETHOD(device_attach, openpic_attach), + DEVMETHOD(device_attach, openpic_iobus_attach), /* PIC interface */ DEVMETHOD(pic_config, openpic_config), @@ -109,3 +110,10 @@ openpic_iobus_probe(device_t dev) return (0); } + +static int +openpic_iobus_attach(device_t dev) +{ + + return (openpic_common_attach(dev, 0)); +} From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 21:08:03 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D0F4106564A; Sat, 29 Jan 2011 21:08:03 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8DB358FC08; Sat, 29 Jan 2011 21:08:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TL83vp045659; Sat, 29 Jan 2011 21:08:03 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TL83vW045657; Sat, 29 Jan 2011 21:08:03 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101292108.p0TL83vW045657@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Jan 2011 21:08:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218076 - head/sys/dev/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 21:08:03 -0000 Author: marcel Date: Sat Jan 29 21:08:03 2011 New Revision: 218076 URL: http://svn.freebsd.org/changeset/base/218076 Log: Call newbus_device_create() for PCI devices. Call pci_from_fdt_node() for the newly created device_t, rather than the parent. Modified: head/sys/dev/fdt/fdtbus.c Modified: head/sys/dev/fdt/fdtbus.c ============================================================================== --- head/sys/dev/fdt/fdtbus.c Sat Jan 29 20:58:38 2011 (r218075) +++ head/sys/dev/fdt/fdtbus.c Sat Jan 29 21:08:03 2011 (r218076) @@ -39,10 +39,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include +#include + #include "fdt_common.h" #include "ofw_bus_if.h" @@ -150,6 +150,8 @@ static void fdtbus_identify(driver_t *driver, device_t parent) { + debugf("%s(driver=%p, parent=%p)\n", __func__, driver, parent); + if (device_find_child(parent, "fdtbus", -1) == NULL) BUS_ADD_CHILD(parent, 0, "fdtbus", -1); } @@ -158,6 +160,8 @@ static int fdtbus_probe(device_t dev) { + debugf("%s(dev=%p); pass=%u\n", __func__, dev, bus_current_pass); + device_set_desc(dev, "FDT main bus"); if (!bootverbose) device_quiet(dev); @@ -472,12 +476,9 @@ newbus_device_from_fdt_node(device_t dev return; } - if (type != NULL && strcmp(type, "pci") == 0) { - pci_from_fdt_node(dev_par, node, name, type, compat); - return; - } - child = newbus_device_create(dev_par, node, name, type, compat); + if (type != NULL && strcmp(type, "pci") == 0) + pci_from_fdt_node(child, node, name, type, compat); } static struct resource * From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 21:14:29 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E79D106564A; Sat, 29 Jan 2011 21:14:29 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6DD308FC1A; Sat, 29 Jan 2011 21:14:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TLETPK045859; Sat, 29 Jan 2011 21:14:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TLETug045857; Sat, 29 Jan 2011 21:14:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101292114.p0TLETug045857@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 29 Jan 2011 21:14:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218077 - head/sys/dev/fdt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 21:14:29 -0000 Author: marcel Date: Sat Jan 29 21:14:29 2011 New Revision: 218077 URL: http://svn.freebsd.org/changeset/base/218077 Log: Don't operate on the parent of the PCI node. It's the PCI node itself that represents the host controller. This makes the FDT PCI support working an a bare-bones manner. This needs a lot more work, of which the beginning are at the end of the file, compiled-out with #if 0. The intend being that both the Marvell PCIE and Freescale PCI/PCIX/PCIE duplicate the same platform-independent domain initialization, that should be moved into an unified implementation in the FDT code. Handling of resources requires help from the platform. A unified implementation allows us to properly support PCI devices listed in the device tree and configured according to the device tree specification. Sponsored by: Juniper Networks Modified: head/sys/dev/fdt/fdt_pci.c Modified: head/sys/dev/fdt/fdt_pci.c ============================================================================== --- head/sys/dev/fdt/fdt_pci.c Sat Jan 29 21:08:03 2011 (r218076) +++ head/sys/dev/fdt/fdt_pci.c Sat Jan 29 21:14:29 2011 (r218077) @@ -39,10 +39,12 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include "ofw_bus_if.h" +#include "pcib_if.h" #define DEBUG #undef DEBUG @@ -156,35 +158,17 @@ int fdt_pci_ranges(phandle_t node, struct fdt_pci_range *io_space, struct fdt_pci_range *mem_space) { - struct fdt_pci_range par_io_space, par_mem_space; - u_long base; int err; - debugf("Processing parent PCI node: %x\n", node); - if ((err = fdt_pci_ranges_decode(OF_parent(node), &par_io_space, - &par_mem_space)) != 0) { - debugf("could not decode parent PCI node 'ranges'\n"); - return (err); - } - - debugf("Processing PCI sub node: %x\n", node); + debugf("Processing PCI node: %x\n", node); if ((err = fdt_pci_ranges_decode(node, io_space, mem_space)) != 0) { - debugf("could not decode PCI subnode 'ranges'\n"); + debugf("could not decode parent PCI node 'ranges'\n"); return (err); } - base = io_space->base_parent & 0x000fffff; - base += par_io_space.base_parent; - io_space->base_parent = base; - - base = mem_space->base_parent & 0x000fffff; - base += par_mem_space.base_parent; - mem_space->base_parent = base; - debugf("Post fixup dump:\n"); fdt_pci_range_dump(io_space); fdt_pci_range_dump(mem_space); - return (0); } @@ -223,25 +207,25 @@ int fdt_pci_intr_info(phandle_t node, struct fdt_pci_intr *intr_info) { void *map, *mask; - phandle_t pci_par; - int intr_cells, addr_cells; - int len; + int acells, icells; + int error, len; - addr_cells = fdt_parent_addr_cells(node); + error = fdt_addr_cells(node, &acells); + if (error) + return (error); - pci_par = OF_parent(node); - intr_cells = fdt_interrupt_cells(pci_par); + icells = fdt_interrupt_cells(node); /* * Retrieve the interrupt map and mask properties. */ - len = OF_getprop_alloc(pci_par, "interrupt-map-mask", 1, &mask); - if (len / sizeof(pcell_t) != (addr_cells + intr_cells)) { + len = OF_getprop_alloc(node, "interrupt-map-mask", 1, &mask); + if (len / sizeof(pcell_t) != (acells + icells)) { debugf("bad mask len = %d\n", len); goto err; } - len = OF_getprop_alloc(pci_par, "interrupt-map", 1, &map); + len = OF_getprop_alloc(node, "interrupt-map", 1, &map); if (len <= 0) { debugf("bad map len = %d\n", len); goto err; @@ -250,8 +234,10 @@ fdt_pci_intr_info(phandle_t node, struct intr_info->map_len = len; intr_info->map = map; intr_info->mask = mask; - intr_info->addr_cells = addr_cells; - intr_info->intr_cells = intr_cells; + intr_info->addr_cells = acells; + intr_info->intr_cells = icells; + + debugf("acells=%u, icells=%u, map_len=%u\n", acells, icells, len); return (0); err: @@ -326,7 +312,8 @@ fdt_pci_route_intr(int bus, int slot, in trig, pol); #if defined(__powerpc__) - powerpc_config_intr(INTR_VEC(intr_par, *interrupt), trig, pol); + powerpc_config_intr(FDT_MAP_IRQ(intr_par, *interrupt), trig, + pol); #endif return (0); @@ -364,3 +351,218 @@ fdt_pci_devmap(phandle_t node, struct pm return (0); } #endif + +#if 0 +static int +fdt_pci_config_bar(device_t dev, int bus, int slot, int func, int bar) +{ +} + +static int +fdt_pci_config_normal(device_t dev, int bus, int slot, int func) +{ + int bar; + uint8_t command, intline, intpin; + + command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); + command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); + PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); + + /* Program the base address registers. */ + bar = 0; + while (bar <= PCIR_MAX_BAR_0) + bar += fdt_pci_config_bar(dev, bus, slot, func, bar); + + /* Perform interrupt routing. */ + intpin = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_INTPIN, 1); + intline = fsl_pcib_route_int(dev, bus, slot, func, intpin); + PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_INTLINE, intline, 1); + + command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; + PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); +} + +static int +fdt_pci_config_bridge(device_t dev, int bus, int secbus, int slot, int func) +{ + int maxbar; + uint8_t command; + + command = PCIB_READ_CONFIG(dev, bus, slot, func, PCIR_COMMAND, 1); + command &= ~(PCIM_CMD_MEMEN | PCIM_CMD_PORTEN); + PCIB_WRITE_CONFIG(dev, bus, slot, func, PCIR_COMMAND, command, 1); + + /* Program the base address registers. */ + maxbar = (hdrtype & PCIM_HDRTYPE) ? 1 : 6; + bar = 0; + while (bar < maxbar) + bar += fsl_pcib_init_bar(sc, bus, slot, func, + bar); + + /* Perform interrupt routing. */ + intpin = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_INTPIN, 1); + intline = fsl_pcib_route_int(sc, bus, slot, func, + intpin); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_INTLINE, intline, 1); + + command |= PCIM_CMD_MEMEN | PCIM_CMD_PORTEN; + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_COMMAND, command, 1); + + /* + * Handle PCI-PCI bridges + */ + class = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_CLASS, 1); + subclass = fsl_pcib_read_config(sc->sc_dev, bus, slot, + func, PCIR_SUBCLASS, 1); + + /* Allow only proper PCI-PCI briges */ + if (class != PCIC_BRIDGE) + continue; + if (subclass != PCIS_BRIDGE_PCI) + continue; + + secbus++; + + /* Program I/O decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOBASEL_1, sc->sc_ioport.rm_start >> 8, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOLIMITL_1, sc->sc_ioport.rm_end >> 8, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOBASEH_1, sc->sc_ioport.rm_start >> 16, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_IOLIMITH_1, sc->sc_ioport.rm_end >> 16, 2); + + /* Program (non-prefetchable) memory decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_MEMBASE_1, sc->sc_iomem.rm_start >> 16, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_MEMLIMIT_1, sc->sc_iomem.rm_end >> 16, 2); + + /* Program prefetchable memory decoder. */ + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMBASEL_1, 0x0010, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMLIMITL_1, 0x000f, 2); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMBASEH_1, 0x00000000, 4); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PMLIMITH_1, 0x00000000, 4); + + /* Read currect bus register configuration */ + old_pribus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_PRIBUS_1, 1); + old_secbus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_SECBUS_1, 1); + old_subbus = fsl_pcib_read_config(sc->sc_dev, bus, + slot, func, PCIR_SUBBUS_1, 1); + + if (bootverbose) + printf("PCI: reading firmware bus numbers for " + "secbus = %d (bus/sec/sub) = (%d/%d/%d)\n", + secbus, old_pribus, old_secbus, old_subbus); + + new_pribus = bus; + new_secbus = secbus; + + secbus = fsl_pcib_init(sc, secbus, + (subclass == PCIS_BRIDGE_PCI) ? PCI_SLOTMAX : 0); + + new_subbus = secbus; + + if (bootverbose) + printf("PCI: translate firmware bus numbers " + "for secbus %d (%d/%d/%d) -> (%d/%d/%d)\n", + secbus, old_pribus, old_secbus, old_subbus, + new_pribus, new_secbus, new_subbus); + + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_PRIBUS_1, new_pribus, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_SECBUS_1, new_secbus, 1); + fsl_pcib_write_config(sc->sc_dev, bus, slot, func, + PCIR_SUBBUS_1, new_subbus, 1); + +} + +static int +fdt_pci_config_slot(device_t dev, int bus, int secbus, int slot) +{ + int func, maxfunc; + uint16_t vendor; + uint8_t hdrtype; + + maxfunc = 0; + for (func = 0; func <= maxfunc; func++) { + hdrtype = PCIB_READ_CONFIG(dev, bus, slot, func, + PCIR_HDRTYPE, 1); + if ((hdrtype & PCIM_HDRTYPE) > PCI_MAXHDRTYPE) + continue; + if (func == 0 && (hdrtype & PCIM_MFDEV)) + maxfunc = PCI_FUNCMAX; + + vendor = PCIB_READ_CONFIG(dev, bus, slot, func, + PCIR_VENDOR, 2); + if (vendor == 0xffff) + continue; + + if ((hdrtype & PCIM_HDRTYPE) == PCIM_HDRTYPE_NORMAL) + fdt_pci_config_normal(dev, bus, slot, func); + else + secbus = fdt_pci_config_bridge(dev, bus, secbus, + slot, func); + } + + return (secbus); +} + +static int +fdt_pci_config_bus(device_t dev, int bus, int maxslot) +{ + int func, maxfunc, secbus, slot; + + secbus = bus; + for (slot = 0; slot <= maxslot; slot++) + secbus = fdt_pci_config_slot(dev, bus, secbus, slot); + + return (secbus); +} + +int +fdt_pci_config_domain(device_t dev) +{ + pcell_t bus_range[2]; + phandle_t root; + int bus, error, maxslot; + + root = ofw_bus_get_node(dev); + if (root == 0) + return (EINVAL); + if (!fdt_is_type(root, "pci")) + return (EINVAL); + + /* + * Determine the bus number of the root in this domain. + * Lacking any information, this will be bus 0. + * Write the bus number to the bus device, using the IVAR. + */ + if ((OF_getprop(root, "bus-range", bus_range, sizeof(bus_range)) <= 0) + bus = 0; + else + bus = fdt32_to_cpu(bus_range[0]); + + error = BUS_WRITE_IVAR(dev, NULL, PCIB_IVAR_BUS, bus); + if (error) + return (error); + + /* Get the maximum slot number for bus-enumeration. */ + maxslot = PCIB_MAXSLOTS(dev); + + bus = fdt_pci_config_bus(dev, bus, maxslot); + return (0); +} +#endif From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 22:11:13 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A8B9D106564A; Sat, 29 Jan 2011 22:11:13 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99BEF8FC0A; Sat, 29 Jan 2011 22:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TMBDNE047362; Sat, 29 Jan 2011 22:11:13 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TMBDRJ047360; Sat, 29 Jan 2011 22:11:13 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201101292211.p0TMBDRJ047360@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 29 Jan 2011 22:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218078 - head/sys/netinet X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 22:11:13 -0000 Author: bz Date: Sat Jan 29 22:11:13 2011 New Revision: 218078 URL: http://svn.freebsd.org/changeset/base/218078 Log: Remove duplicate printing of TF_NOPUSH in db_print_tflags(). MFC after: 10 days Modified: head/sys/netinet/tcp_usrreq.c Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sat Jan 29 21:14:29 2011 (r218077) +++ head/sys/netinet/tcp_usrreq.c Sat Jan 29 22:11:13 2011 (r218078) @@ -1742,10 +1742,6 @@ db_print_tflags(u_int t_flags) db_printf("%sTF_NOPUSH", comma ? ", " : ""); comma = 1; } - if (t_flags & TF_NOPUSH) { - db_printf("%sTF_NOPUSH", comma ? ", " : ""); - comma = 1; - } if (t_flags & TF_MORETOCOME) { db_printf("%sTF_MORETOCOME", comma ? ", " : ""); comma = 1; From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 22:51:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 462D11065670; Sat, 29 Jan 2011 22:51:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 358C98FC0A; Sat, 29 Jan 2011 22:51:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TMpSJK048377; Sat, 29 Jan 2011 22:51:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TMpSTW048372; Sat, 29 Jan 2011 22:51:28 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101292251.p0TMpSTW048372@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 29 Jan 2011 22:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218079 - in stable/8/sys/ufs: ffs ufs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 22:51:28 -0000 Author: kib Date: Sat Jan 29 22:51:27 2011 New Revision: 218079 URL: http://svn.freebsd.org/changeset/base/218079 Log: MFC r216796: Add kernel side support for BIO_DELETE/TRIM on UFS. Tested by: pho Modified: stable/8/sys/ufs/ffs/ffs_alloc.c stable/8/sys/ufs/ffs/ffs_vfsops.c stable/8/sys/ufs/ffs/fs.h stable/8/sys/ufs/ufs/ufsmount.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_alloc.c Sat Jan 29 22:11:13 2011 (r218078) +++ stable/8/sys/ufs/ffs/ffs_alloc.c Sat Jan 29 22:51:27 2011 (r218079) @@ -78,6 +78,9 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include + +#include #include #include @@ -94,6 +97,10 @@ typedef ufs2_daddr_t allocfcn_t(struct i static ufs2_daddr_t ffs_alloccg(struct inode *, u_int, ufs2_daddr_t, int); static ufs2_daddr_t ffs_alloccgblk(struct inode *, struct buf *, ufs2_daddr_t); +static void ffs_blkfree_cg(struct ufsmount *, struct fs *, + struct vnode *, ufs2_daddr_t, long, ino_t); +static void ffs_blkfree_trim_completed(struct bio *); +static void ffs_blkfree_trim_task(void *ctx, int pending __unused); #ifdef INVARIANTS static int ffs_checkblk(struct inode *, ufs2_daddr_t, long); #endif @@ -1843,8 +1850,8 @@ ffs_isfreeblock(struct fs *fs, u_char *c * free map. If a fragment is deallocated, a possible * block reassembly is checked. */ -void -ffs_blkfree(ump, fs, devvp, bno, size, inum) +static void +ffs_blkfree_cg(ump, fs, devvp, bno, size, inum) struct ufsmount *ump; struct fs *fs; struct vnode *devvp; @@ -1970,6 +1977,86 @@ ffs_blkfree(ump, fs, devvp, bno, size, i bdwrite(bp); } +TASKQUEUE_DEFINE_THREAD(ffs_trim); + +struct ffs_blkfree_trim_params { + struct task task; + struct ufsmount *ump; + struct vnode *devvp; + ufs2_daddr_t bno; + long size; + ino_t inum; +}; + +static void +ffs_blkfree_trim_task(ctx, pending) + void *ctx; + int pending; +{ + struct ffs_blkfree_trim_params *tp; + + tp = ctx; + ffs_blkfree_cg(tp->ump, tp->ump->um_fs, tp->devvp, tp->bno, tp->size, + tp->inum); + vn_finished_secondary_write(UFSTOVFS(tp->ump)); + free(tp, M_TEMP); +} + +static void +ffs_blkfree_trim_completed(bip) + struct bio *bip; +{ + struct ffs_blkfree_trim_params *tp; + + tp = bip->bio_caller2; + g_destroy_bio(bip); + TASK_INIT(&tp->task, 0, ffs_blkfree_trim_task, tp); + taskqueue_enqueue(taskqueue_ffs_trim, &tp->task); +} + +void +ffs_blkfree(ump, fs, devvp, bno, size, inum) + struct ufsmount *ump; + struct fs *fs; + struct vnode *devvp; + ufs2_daddr_t bno; + long size; + ino_t inum; +{ + struct mount *mp; + struct bio *bip; + struct ffs_blkfree_trim_params *tp; + + if (!ump->um_candelete) { + ffs_blkfree_cg(ump, fs, devvp, bno, size, inum); + return; + } + + /* + * Postpone the set of the free bit in the cg bitmap until the + * BIO_DELETE is completed. Otherwise, due to disk queue + * reordering, TRIM might be issued after we reuse the block + * and write some new data into it. + */ + tp = malloc(sizeof(struct ffs_blkfree_trim_params), M_TEMP, M_WAITOK); + tp->ump = ump; + tp->devvp = devvp; + tp->bno = bno; + tp->size = size; + tp->inum = inum; + + bip = g_alloc_bio(); + bip->bio_cmd = BIO_DELETE; + bip->bio_offset = dbtob(fsbtodb(fs, bno)); + bip->bio_done = ffs_blkfree_trim_completed; + bip->bio_length = size; + bip->bio_caller2 = tp; + + mp = UFSTOVFS(ump); + vn_start_secondary_write(NULL, &mp, 0); + g_io_request(bip, (struct g_consumer *)devvp->v_bufobj.bo_private); +} + #ifdef INVARIANTS /* * Verify allocation of a block or fragment. Returns true if block or Modified: stable/8/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- stable/8/sys/ufs/ffs/ffs_vfsops.c Sat Jan 29 22:11:13 2011 (r218078) +++ stable/8/sys/ufs/ffs/ffs_vfsops.c Sat Jan 29 22:51:27 2011 (r218079) @@ -891,6 +891,21 @@ ffs_mountfs(devvp, mp, td) mp->mnt_stat.f_mntonname); #endif } + if ((fs->fs_flags & FS_TRIM) != 0) { + size = sizeof(int); + if (g_io_getattr("GEOM::candelete", cp, &size, + &ump->um_candelete) == 0) { + if (!ump->um_candelete) + printf( +"WARNING: %s: TRIM flag on fs but disk does not support TRIM\n", + mp->mnt_stat.f_mntonname); + } else { + printf( +"WARNING: %s: TRIM flag on fs but cannot get whether disk supports TRIM\n", + mp->mnt_stat.f_mntonname); + ump->um_candelete = 0; + } + } ump->um_mountp = mp; ump->um_dev = dev; Modified: stable/8/sys/ufs/ffs/fs.h ============================================================================== --- stable/8/sys/ufs/ffs/fs.h Sat Jan 29 22:11:13 2011 (r218078) +++ stable/8/sys/ufs/ffs/fs.h Sat Jan 29 22:51:27 2011 (r218079) @@ -411,6 +411,7 @@ CTASSERT(sizeof(struct fs) == 1376); #define FS_GJOURNAL 0x0040 /* gjournaled file system */ #define FS_FLAGS_UPDATED 0x0080 /* flags have been moved to new location */ #define FS_NFS4ACLS 0x0100 /* file system has NFSv4 ACLs enabled */ +#define FS_TRIM 0x0400 /* issue BIO_DELETE for deleted blocks */ /* * Macros to access bits in the fs_active array. Modified: stable/8/sys/ufs/ufs/ufsmount.h ============================================================================== --- stable/8/sys/ufs/ufs/ufsmount.h Sat Jan 29 22:11:13 2011 (r218078) +++ stable/8/sys/ufs/ufs/ufsmount.h Sat Jan 29 22:51:27 2011 (r218079) @@ -86,6 +86,7 @@ struct ufsmount { time_t um_itime[MAXQUOTAS]; /* inode quota time limit */ char um_qflags[MAXQUOTAS]; /* quota specific flags */ int64_t um_savedmaxfilesize; /* XXX - limit maxfilesize */ + int um_candelete; /* devvp supports TRIM */ int (*um_balloc)(struct vnode *, off_t, int, struct ucred *, int, struct buf **); int (*um_blkatoff)(struct vnode *, off_t, char **, struct buf **); int (*um_truncate)(struct vnode *, off_t, int, struct ucred *, struct thread *); From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 22:51:46 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A26E106564A; Sat, 29 Jan 2011 22:51:46 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 68C178FC16; Sat, 29 Jan 2011 22:51:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TMpk9H048425; Sat, 29 Jan 2011 22:51:46 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TMpk0I048417; Sat, 29 Jan 2011 22:51:46 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201101292251.p0TMpk0I048417@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 29 Jan 2011 22:51:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218080 - in stable/8/sbin: dumpfs geom/class/sched newfs tunefs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 22:51:46 -0000 Author: kib Date: Sat Jan 29 22:51:46 2011 New Revision: 218080 URL: http://svn.freebsd.org/changeset/base/218080 Log: MFC r216798: Add support for FS_TRIM to user-mode UFS utilities. Tested by: pho Modified: stable/8/sbin/dumpfs/dumpfs.c stable/8/sbin/newfs/mkfs.c stable/8/sbin/newfs/newfs.8 stable/8/sbin/newfs/newfs.c stable/8/sbin/newfs/newfs.h stable/8/sbin/tunefs/tunefs.8 stable/8/sbin/tunefs/tunefs.c Directory Properties: stable/8/sbin/ (props changed) stable/8/sbin/atacontrol/ (props changed) stable/8/sbin/bsdlabel/ (props changed) stable/8/sbin/camcontrol/ (props changed) stable/8/sbin/ddb/ (props changed) stable/8/sbin/devd/ (props changed) stable/8/sbin/devfs/ (props changed) stable/8/sbin/dhclient/ (props changed) stable/8/sbin/dump/ (props changed) stable/8/sbin/dumpfs/ (props changed) stable/8/sbin/fdisk/ (props changed) stable/8/sbin/fsck/ (props changed) stable/8/sbin/fsck_ffs/ (props changed) stable/8/sbin/fsck_msdosfs/ (props changed) stable/8/sbin/fsirand/ (props changed) stable/8/sbin/geom/ (props changed) stable/8/sbin/geom/class/multipath/ (props changed) stable/8/sbin/geom/class/part/ (props changed) stable/8/sbin/geom/class/sched/gsched.8 (props changed) stable/8/sbin/geom/class/stripe/ (props changed) stable/8/sbin/ggate/ (props changed) stable/8/sbin/growfs/ (props changed) stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) stable/8/sbin/ifconfig/ (props changed) stable/8/sbin/ipfw/ (props changed) stable/8/sbin/iscontrol/ (props changed) stable/8/sbin/kldload/ (props changed) stable/8/sbin/kldstat/ (props changed) stable/8/sbin/mdconfig/ (props changed) stable/8/sbin/mksnap_ffs/ (props changed) stable/8/sbin/mount/ (props changed) stable/8/sbin/mount_cd9660/ (props changed) stable/8/sbin/mount_msdosfs/ (props changed) stable/8/sbin/mount_nfs/ (props changed) stable/8/sbin/natd/ (props changed) stable/8/sbin/newfs/ (props changed) stable/8/sbin/newfs_msdos/ (props changed) stable/8/sbin/ping6/ (props changed) stable/8/sbin/reboot/ (props changed) stable/8/sbin/restore/ (props changed) stable/8/sbin/route/ (props changed) stable/8/sbin/routed/ (props changed) stable/8/sbin/setkey/ (props changed) stable/8/sbin/spppcontrol/ (props changed) stable/8/sbin/sysctl/ (props changed) stable/8/sbin/tunefs/ (props changed) stable/8/sbin/umount/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/dumpfs/dumpfs.c Sat Jan 29 22:51:46 2011 (r218080) @@ -253,9 +253,11 @@ dumpfs(const char *name) printf("fs_flags expanded "); if (fsflags & FS_NFS4ACLS) printf("nfsv4acls "); + if (fsflags & FS_TRIM) + printf("trim "); fsflags &= ~(FS_UNCLEAN | FS_DOSOFTDEP | FS_NEEDSFSCK | FS_INDEXDIRS | FS_ACLS | FS_MULTILABEL | FS_GJOURNAL | FS_FLAGS_UPDATED | - FS_NFS4ACLS); + FS_NFS4ACLS | FS_TRIM); if (fsflags != 0) printf("unknown flags (%#x)", fsflags); putchar('\n'); Modified: stable/8/sbin/newfs/mkfs.c ============================================================================== --- stable/8/sbin/newfs/mkfs.c Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/newfs/mkfs.c Sat Jan 29 22:51:46 2011 (r218080) @@ -151,6 +151,8 @@ mkfs(struct partition *pp, char *fsys) sblock.fs_flags |= FS_GJOURNAL; if (lflag) sblock.fs_flags |= FS_MULTILABEL; + if (tflag) + sblock.fs_flags |= FS_TRIM; /* * Validate the given file system size. * Verify that its last block can actually be accessed. Modified: stable/8/sbin/newfs/newfs.8 ============================================================================== --- stable/8/sbin/newfs/newfs.8 Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/newfs/newfs.8 Sat Jan 29 22:51:46 2011 (r218080) @@ -28,7 +28,7 @@ .\" @(#)newfs.8 8.6 (Berkeley) 5/3/95 .\" $FreeBSD$ .\" -.Dd March 21, 2008 +.Dd December 9, 2010 .Dt NEWFS 8 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd construct a new UFS1/UFS2 file system .Sh SYNOPSIS .Nm -.Op Fl EJNUln +.Op Fl EJNUlnt .Op Fl L Ar volname .Op Fl O Ar filesystem-type .Op Fl S Ar sector-size @@ -240,6 +240,14 @@ A valid .Ar size value cannot be larger than the default one, which means that the file system cannot extend into the reserved space. +.It Fl t +Turn on the TRIM enable flag. +If enabled, and if the underlying device supports the BIO_DELETE +command, the file system will send a delete request to the underlying +device for each freed block. +The trim enable flag is typically set when the underlying device +uses flash-memory as the device can use the delete command to +pre-zero or at least avoid copying blocks that have been deleted. .El .Pp The following options override the standard sizes for the disk geometry. Modified: stable/8/sbin/newfs/newfs.c ============================================================================== --- stable/8/sbin/newfs/newfs.c Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/newfs/newfs.c Sat Jan 29 22:51:46 2011 (r218080) @@ -89,6 +89,7 @@ int Xflag = 0; /* exit in middle of new int Jflag; /* enable gjournal for file system */ int lflag; /* enable multilabel for file system */ int nflag; /* do not create .snap directory */ +int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ @@ -136,7 +137,7 @@ main(int argc, char *argv[]) part_name = 'c'; reserved = 0; while ((ch = getopt(argc, argv, - "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:")) != -1) + "EJL:NO:RS:T:UXa:b:c:d:e:f:g:h:i:lm:no:p:r:s:t")) != -1) switch (ch) { case 'E': Eflag = 1; @@ -263,6 +264,9 @@ main(int argc, char *argv[]) *cp != '\0' || fssize < 0) errx(1, "%s: bad file system size", optarg); break; + case 't': + tflag = 1; + break; case '?': default: usage(); @@ -479,5 +483,6 @@ usage() fprintf(stderr, "\t-p partition name (a..h)\n"); fprintf(stderr, "\t-r reserved sectors at the end of device\n"); fprintf(stderr, "\t-s file system size (sectors)\n"); + fprintf(stderr, "\t-t enable TRIM\n"); exit(1); } Modified: stable/8/sbin/newfs/newfs.h ============================================================================== --- stable/8/sbin/newfs/newfs.h Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/newfs/newfs.h Sat Jan 29 22:51:46 2011 (r218080) @@ -85,6 +85,7 @@ extern int Xflag; /* exit in middle of extern int Jflag; /* enable gjournal for file system */ extern int lflag; /* enable multilabel MAC for file system */ extern int nflag; /* do not create .snap directory */ +extern int tflag; /* enable TRIM */ extern intmax_t fssize; /* file system size */ extern int sectorsize; /* bytes/sector */ extern int realsectorsize; /* bytes/sector in hardware*/ Modified: stable/8/sbin/tunefs/tunefs.8 ============================================================================== --- stable/8/sbin/tunefs/tunefs.8 Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/tunefs/tunefs.8 Sat Jan 29 22:51:46 2011 (r218080) @@ -28,7 +28,7 @@ .\" @(#)tunefs.8 8.2 (Berkeley) 12/11/93 .\" $FreeBSD$ .\" -.Dd August 13, 2007 +.Dd December 9, 2010 .Dt TUNEFS 8 .Os .Sh NAME @@ -49,6 +49,7 @@ .Op Fl o Cm space | time .Op Fl p .Op Fl s Ar avgfpdir +.Op Fl t Cm enable | disable .Ar special | filesystem .Sh DESCRIPTION The @@ -136,6 +137,14 @@ obtained from the utility. .It Fl s Ar avgfpdir Specify the expected number of files per directory. +.It Fl t Cm enable | disable +Turn on/off the TRIM enable flag. +If enabled, and if the underlying device supports the BIO_DELETE +command, the file system will send a delete request to the underlying +device for each freed block. +The trim enable flag is typically set when the underlying device +uses flash-memory as the device can use the delete command to +pre-zero or at least avoid copying blocks that have been deleted. .El .Pp At least one of the above flags is required. Modified: stable/8/sbin/tunefs/tunefs.c ============================================================================== --- stable/8/sbin/tunefs/tunefs.c Sat Jan 29 22:51:27 2011 (r218079) +++ stable/8/sbin/tunefs/tunefs.c Sat Jan 29 22:51:46 2011 (r218080) @@ -77,11 +77,13 @@ int main(int argc, char *argv[]) { char *avalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; + char *tvalue; const char *special, *on; const char *name; int active; int Aflag, aflag, eflag, evalue, fflag, fvalue, Jflag, Lflag, lflag; int mflag, mvalue, Nflag, nflag, oflag, ovalue, pflag, sflag, svalue; + int tflag; int ch, found_arg, i; const char *chg[2]; struct ufs_args args; @@ -90,12 +92,12 @@ main(int argc, char *argv[]) if (argc < 3) usage(); Aflag = aflag = eflag = fflag = Jflag = Lflag = lflag = mflag = 0; - Nflag = nflag = oflag = pflag = sflag = 0; + Nflag = nflag = oflag = pflag = sflag = tflag = 0; avalue = Jvalue = Lvalue = lvalue = Nvalue = nvalue = NULL; evalue = fvalue = mvalue = ovalue = svalue = 0; active = 0; found_arg = 0; /* At least one arg is required. */ - while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:N:n:o:ps:")) != -1) + while ((ch = getopt(argc, argv, "Aa:e:f:J:L:l:m:N:n:o:ps:t:")) != -1) switch (ch) { case 'A': @@ -240,6 +242,18 @@ main(int argc, char *argv[]) sflag = 1; break; + case 't': + found_arg = 1; + name = "trim"; + tvalue = optarg; + if (strcmp(tvalue, "enable") != 0 && + strcmp(tvalue, "disable") != 0) { + errx(10, "bad %s (options are %s)", + name, "`enable' or `disable'"); + } + tflag = 1; + break; + default: usage(); } @@ -436,6 +450,24 @@ main(int argc, char *argv[]) sblock.fs_avgfpdir = svalue; } } + if (tflag) { + name = "issue TRIM to the disk"; + if (strcmp(tvalue, "enable") == 0) { + if (sblock.fs_flags & FS_TRIM) + warnx("%s remains unchanged as enabled", name); + else { + sblock.fs_flags |= FS_TRIM; + warnx("%s set", name); + } + } else if (strcmp(tvalue, "disable") == 0) { + if ((~sblock.fs_flags & FS_TRIM) == FS_TRIM) + warnx("%s remains unchanged as disabled", name); + else { + sblock.fs_flags &= ~FS_TRIM; + warnx("%s cleared", name); + } + } + } if (sbwrite(&disk, Aflag) == -1) goto err; @@ -458,11 +490,12 @@ err: void usage(void) { - fprintf(stderr, "%s\n%s\n%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n", "usage: tunefs [-A] [-a enable | disable] [-e maxbpg] [-f avgfilesize]", " [-J enable | disable ] [-L volname] [-l enable | disable]", " [-m minfree] [-N enable | disable] [-n enable | disable]", -" [-o space | time] [-p] [-s avgfpdir] special | filesystem"); +" [-o space | time] [-p] [-s avgfpdir] [-t enable | disable]", +" special | filesystem"); exit(2); } @@ -479,6 +512,8 @@ printfs(void) (sblock.fs_flags & FS_DOSOFTDEP)? "enabled" : "disabled"); warnx("gjournal: (-J) %s", (sblock.fs_flags & FS_GJOURNAL)? "enabled" : "disabled"); + warnx("trim: (-t) %s", + (sblock.fs_flags & FS_TRIM)? "enabled" : "disabled"); warnx("maximum blocks per file in a cylinder group: (-e) %d", sblock.fs_maxbpg); warnx("average file size: (-f) %d", From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 23:02:21 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EDB1B1065673; Sat, 29 Jan 2011 23:02:21 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id E33498FC08; Sat, 29 Jan 2011 23:02:20 +0000 (UTC) Received: by wyf19 with SMTP id 19so4538348wyf.13 for ; Sat, 29 Jan 2011 15:02:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=pXG4PVNf9YG9AM8auf5+6vU6ecb+43Bk2UF/BTSo4BQ=; b=OX1Ck4Xx7zQkbB1JGsVZU2IoCC870ElmeHjftcWEO0G0hDrVXRiotxD+ZVMLGrnqRI i3YEzgw5vK7V77lifvMc6yQvOtwvUrLapcYqYNKU4UapIx0Ez0BTfEcjX+0wdQoeMmiK 4oUKfpCLeFjj9Iz3YRqYHTRuHMSfPAynvrNUY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=AMrjp/7GEGFuFwQArzVkcd/7xe+GjDhA+R4ObaFHQJPEtUHe2amzlovZfvlepo7lmd UObaWM/IgivUkfcIwCcmfS+O6CVqhLB1lGZxPZNA7UUeUYvW1tHIio5pi/2Fc64i2RjE rpgFrAW4Yn9gNkkjsAw8BlrB0tSQHScGShGJ0= MIME-Version: 1.0 Received: by 10.227.144.200 with SMTP id a8mr4364469wbv.217.1296340343865; Sat, 29 Jan 2011 14:32:23 -0800 (PST) Received: by 10.227.156.194 with HTTP; Sat, 29 Jan 2011 14:32:23 -0800 (PST) In-Reply-To: <201101290814.p0T8ElWG023548@svn.freebsd.org> References: <201101290814.p0T8ElWG023548@svn.freebsd.org> Date: Sat, 29 Jan 2011 23:32:23 +0100 Message-ID: From: Oliver Pinter To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r218060 - stable/8/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 23:02:22 -0000 Is this a badly MFCd local commit or not? On 1/29/11, Alfred Perlstein wrote: > Author: alfred > Date: Sat Jan 29 08:14:47 2011 > New Revision: 218060 > URL: http://svn.freebsd.org/changeset/base/218060 > > Log: > MFC: 'alfred' command. > > Modified: > stable/8/usr.sbin/portsnap/portsnap/portsnap.sh > > Modified: stable/8/usr.sbin/portsnap/portsnap/portsnap.sh > ============================================================================== > --- stable/8/usr.sbin/portsnap/portsnap/portsnap.sh Sat Jan 29 07:22:33 > 2011 (r218059) > +++ stable/8/usr.sbin/portsnap/portsnap/portsnap.sh Sat Jan 29 08:14:47 > 2011 (r218060) > @@ -140,7 +140,7 @@ parse_cmdline() { > if [ ! -z "${SERVERNAME}" ]; then usage; fi > shift; SERVERNAME="$1" > ;; > - cron | extract | fetch | update) > + cron | extract | fetch | update | alfred) > COMMANDS="${COMMANDS} $1" > ;; > *) > @@ -1040,6 +1040,22 @@ cmd_update() { > update_run || exit 1 > } > > +# Alfred command. Run 'fetch' or 'cron' depending on > +# whether stdin is a terminal; then run 'update' or > +# 'extract' depending on whether ${PORTSDIR} exists. > +cmd_alfred() { > + if [ -t 0 ]; then > + cmd_fetch > + else > + cmd_cron > + fi > + if [ -d ${PORTSDIR} ]; then > + cmd_update > + else > + cmd_extract > + fi > +} > + > #### Entry point > > # Make sure we find utilities from the base system > _______________________________________________ > svn-src-stable@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/svn-src-stable > To unsubscribe, send any mail to "svn-src-stable-unsubscribe@freebsd.org" > From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 23:26:28 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 915211065674; Sat, 29 Jan 2011 23:26:28 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 81EC28FC13; Sat, 29 Jan 2011 23:26:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0TNQSjS049247; Sat, 29 Jan 2011 23:26:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0TNQSPP049245; Sat, 29 Jan 2011 23:26:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201101292326.p0TNQSPP049245@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 29 Jan 2011 23:26:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218081 - head/sys/powerpc/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 23:26:28 -0000 Author: nwhitehorn Date: Sat Jan 29 23:26:28 2011 New Revision: 218081 URL: http://svn.freebsd.org/changeset/base/218081 Log: Fix boot on SMP systems after r218075 by delaying CPU binding until a SYSINIT. Reviewed by: marcel Modified: head/sys/powerpc/powerpc/intr_machdep.c Modified: head/sys/powerpc/powerpc/intr_machdep.c ============================================================================== --- head/sys/powerpc/powerpc/intr_machdep.c Sat Jan 29 22:51:46 2011 (r218080) +++ head/sys/powerpc/powerpc/intr_machdep.c Sat Jan 29 23:26:28 2011 (r218081) @@ -426,9 +426,6 @@ powerpc_enable_intr(void) i->pol != INTR_POLARITY_CONFORM) PIC_CONFIG(i->pic, i->intline, i->trig, i->pol); - if (i != NULL && i->pic == root_pic) - PIC_BIND(i->pic, i->intline, i->cpu); - if (i->event != NULL) PIC_ENABLE(i->pic, i->intline, vector); } From owner-svn-src-all@FreeBSD.ORG Sat Jan 29 23:45:51 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4E5BB1065693 for ; Sat, 29 Jan 2011 23:45:51 +0000 (UTC) (envelope-from cperciva@freebsd.org) Received: from xps.daemonology.net (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx2.freebsd.org (Postfix) with SMTP id D7D741A8C57 for ; Sat, 29 Jan 2011 23:45:50 +0000 (UTC) Received: (qmail 12541 invoked from network); 29 Jan 2011 23:45:54 -0000 Received: from unknown (HELO xps.daemonology.net) (127.0.0.1) by localhost with SMTP; 29 Jan 2011 23:45:54 -0000 Message-ID: <4D44A6B2.1050300@freebsd.org> Date: Sat, 29 Jan 2011 15:45:54 -0800 From: Colin Percival User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.16) Gecko/20101220 Thunderbird/3.0.11 MIME-Version: 1.0 To: Oliver Pinter References: <201101290814.p0T8ElWG023548@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org, svn-src-stable-8@freebsd.org Subject: Re: svn commit: r218060 - stable/8/usr.sbin/portsnap/portsnap X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Jan 2011 23:45:51 -0000 On 01/29/11 14:32, Oliver Pinter wrote: > Is this a badly MFCd local commit or not? No, 'portsnap alfred' is real. Alfred requested the functionality, and I couldn't think of a better name at the time. Feel free to offer suggestions. :-) -- Colin Percival Security Officer, FreeBSD | freebsd.org | The power to serve Founder / author, Tarsnap | tarsnap.com | Online backups for the truly paranoid