From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 02:15:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C32C07FF; Sun, 28 Oct 2012 02:15:36 +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 90C1C8FC14; Sun, 28 Oct 2012 02:15:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9S2Fax8007460; Sun, 28 Oct 2012 02:15:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9S2Fajw007456; Sun, 28 Oct 2012 02:15:36 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201210280215.q9S2Fajw007456@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 28 Oct 2012 02:15:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242203 - in head/sys/modules/drm: r128 radeon via X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 02:15:36 -0000 Author: nwhitehorn Date: Sun Oct 28 02:15:35 2012 New Revision: 242203 URL: http://svn.freebsd.org/changeset/base/242203 Log: Extend dim's hack from r228978: not only clang but gcc on non-x86 platforms warns about unused variables in this code, so always add -Wno-unused to the warning flags. Why gcc on x86 *doesn't* warn about this, I will never know. The code itself should probably be fixed at some point. Modified: head/sys/modules/drm/r128/Makefile head/sys/modules/drm/radeon/Makefile head/sys/modules/drm/via/Makefile Modified: head/sys/modules/drm/r128/Makefile ============================================================================== --- head/sys/modules/drm/r128/Makefile Sat Oct 27 23:42:41 2012 (r242202) +++ head/sys/modules/drm/r128/Makefile Sun Oct 28 02:15:35 2012 (r242203) @@ -7,6 +7,6 @@ SRCS +=device_if.h bus_if.h pci_if.h opt .include -CWARNFLAGS.r128_cce.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.r128_state.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS.r128_cce.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.r128_state.c= -Wno-unused CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: head/sys/modules/drm/radeon/Makefile ============================================================================== --- head/sys/modules/drm/radeon/Makefile Sat Oct 27 23:42:41 2012 (r242202) +++ head/sys/modules/drm/radeon/Makefile Sun Oct 28 02:15:35 2012 (r242203) @@ -8,6 +8,6 @@ SRCS +=device_if.h bus_if.h pci_if.h opt .include -CWARNFLAGS.r600_cp.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} -CWARNFLAGS.radeon_cp.c= ${NO_WUNUSED_VALUE} ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.r600_cp.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} +CWARNFLAGS.radeon_cp.c= -Wno-unused ${NO_WCONSTANT_CONVERSION} CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} Modified: head/sys/modules/drm/via/Makefile ============================================================================== --- head/sys/modules/drm/via/Makefile Sat Oct 27 23:42:41 2012 (r242202) +++ head/sys/modules/drm/via/Makefile Sun Oct 28 02:15:35 2012 (r242203) @@ -22,6 +22,6 @@ opt_drm.h: .include -CWARNFLAGS.via_dma.c= ${NO_WUNUSED_VALUE} -CWARNFLAGS.via_dmablit.c= ${NO_WUNUSED_VALUE} +CWARNFLAGS.via_dma.c= -Wno-unused-value +CWARNFLAGS.via_dmablit.c= -Wno-unused-value CWARNFLAGS+= ${CWARNFLAGS.${.IMPSRC:T}} From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 02:55:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 201D2CCA; Sun, 28 Oct 2012 02:55:52 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0810A8FC0C; Sun, 28 Oct 2012 02:55:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9S2tprW013636; Sun, 28 Oct 2012 02:55:51 GMT (envelope-from imp@svn.freebsd.org) Received: (from imp@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9S2tpn5013634; Sun, 28 Oct 2012 02:55:51 GMT (envelope-from imp@svn.freebsd.org) Message-Id: <201210280255.q9S2tpn5013634@svn.freebsd.org> From: Warner Losh Date: Sun, 28 Oct 2012 02:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242204 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 02:55:52 -0000 Author: imp Date: Sun Oct 28 02:55:51 2012 New Revision: 242204 URL: http://svn.freebsd.org/changeset/base/242204 Log: Better comments. Modified: head/sys/conf/files.mips Modified: head/sys/conf/files.mips ============================================================================== --- head/sys/conf/files.mips Sun Oct 28 02:15:35 2012 (r242203) +++ head/sys/conf/files.mips Sun Oct 28 02:55:51 2012 (r242204) @@ -76,9 +76,9 @@ dev/fdt/fdt_mips.c optional fdt crypto/blowfish/bf_enc.c optional crypto | ipsec crypto/des/des_enc.c optional crypto | ipsec -# AP common nvram interface +# AP common nvram interface MIPS specific, but maybe should be more generic dev/nvram2env/nvram2env.c optional nvram2env -# hwpmc goo +# hwpmc support dev/hwpmc/hwpmc_mips.c optional hwpmc dev/hwpmc/hwpmc_mips24k.c optional hwpmc From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 04:18:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7D24D6DC; Sun, 28 Oct 2012 04:18: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 536098FC08; Sun, 28 Oct 2012 04:18:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9S4IoxI026787; Sun, 28 Oct 2012 04:18:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9S4IoCD026785; Sun, 28 Oct 2012 04:18:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210280418.q9S4IoCD026785@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Oct 2012 04:18:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242205 - head/sys/net80211 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 04:18:50 -0000 Author: adrian Date: Sun Oct 28 04:18:49 2012 New Revision: 242205 URL: http://svn.freebsd.org/changeset/base/242205 Log: Add some further BAR TX debugging; it was useful when figuring out when BAR TX was actually failing. Modified: head/sys/net80211/ieee80211_ht.c Modified: head/sys/net80211/ieee80211_ht.c ============================================================================== --- head/sys/net80211/ieee80211_ht.c Sun Oct 28 02:55:51 2012 (r242204) +++ head/sys/net80211/ieee80211_ht.c Sun Oct 28 04:18:49 2012 (r242205) @@ -1025,12 +1025,21 @@ ieee80211_ht_node_init(struct ieee80211_ struct ieee80211_tx_ampdu *tap; int tid; + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: called", + __func__); + if (ni->ni_flags & IEEE80211_NODE_HT) { /* * Clean AMPDU state on re-associate. This handles the case * where a station leaves w/o notifying us and then returns * before node is reaped for inactivity. */ + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: calling cleanup", + __func__); ieee80211_ht_node_cleanup(ni); } for (tid = 0; tid < WME_NUM_TID; tid++) { @@ -1052,6 +1061,11 @@ ieee80211_ht_node_cleanup(struct ieee802 struct ieee80211com *ic = ni->ni_ic; int i; + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, + "%s: called", + __func__); + KASSERT(ni->ni_flags & IEEE80211_NODE_HT, ("not an HT node")); /* XXX optimize this */ @@ -1684,6 +1698,11 @@ ampdu_tx_stop(struct ieee80211_tx_ampdu struct ieee80211_node *ni = tap->txa_ni; struct ieee80211com *ic = ni->ni_ic; + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: called", + __func__); + KASSERT(tap->txa_flags & IEEE80211_AGGR_SETUP, ("txa_flags 0x%x tid %d ac %d", tap->txa_flags, tap->txa_tid, TID_TO_WME_AC(tap->txa_tid))); @@ -2203,6 +2222,9 @@ bar_timeout(void *arg) } else { ni->ni_vap->iv_stats.is_ampdu_bar_tx_retry++; if (ieee80211_send_bar(ni, tap, tap->txa_seqpending) != 0) { + IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, + ni, "%s: failed to TX, starting timer\n", + __func__); /* * If ieee80211_send_bar() fails here, the * timer may have stopped and/or the pending @@ -2221,12 +2243,20 @@ bar_timeout(void *arg) static void bar_start_timer(struct ieee80211_tx_ampdu *tap) { + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: called", + __func__); callout_reset(&tap->txa_timer, ieee80211_bar_timeout, bar_timeout, tap); } static void bar_stop_timer(struct ieee80211_tx_ampdu *tap) { + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: called", + __func__); callout_stop(&tap->txa_timer); } @@ -2258,6 +2288,10 @@ ieee80211_bar_response(struct ieee80211_ struct ieee80211_tx_ampdu *tap, int status) { + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: called", + __func__); if (status == 0) { /* got ACK */ IEEE80211_NOTE(ni->ni_vap, IEEE80211_MSG_11N, ni, "BAR moves BA win <%u:%u> (%u frames) txseq %u tid %u", @@ -2292,6 +2326,12 @@ ieee80211_send_bar(struct ieee80211_node uint8_t *frm; int tid, ret; + + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: called", + __func__); + if ((tap->txa_flags & IEEE80211_AGGR_RUNNING) == 0) { /* no ADDBA response, should not happen */ /* XXX stat+msg */ @@ -2354,6 +2394,9 @@ ieee80211_send_bar(struct ieee80211_node */ ret = ic->ic_raw_xmit(ni, m, NULL); if (ret != 0) { + IEEE80211_NOTE(vap, IEEE80211_MSG_DEBUG | IEEE80211_MSG_11N, + ni, "send BAR: failed: (ret = %d)\n", + ret); /* xmit failed, clear state flag */ tap->txa_flags &= ~IEEE80211_AGGR_BARPEND; vap->iv_stats.is_ampdu_bar_tx_fail++; @@ -2364,6 +2407,10 @@ ieee80211_send_bar(struct ieee80211_node bar_start_timer(tap); return 0; bad: + IEEE80211_NOTE(tap->txa_ni->ni_vap, IEEE80211_MSG_11N, + tap->txa_ni, + "%s: bad! ret=%d", + __func__, ret); vap->iv_stats.is_ampdu_bar_tx_fail++; ieee80211_free_node(ni); return ret; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 09:04:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0312924C; Sun, 28 Oct 2012 09:04:23 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-ie0-f182.google.com (mail-ie0-f182.google.com [209.85.223.182]) by mx1.freebsd.org (Postfix) with ESMTP id 947C58FC08; Sun, 28 Oct 2012 09:04:22 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id k10so7062890iea.13 for ; Sun, 28 Oct 2012 02:04:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=gfth/WKpc3/NrsKqSKg3tFfuewj5ZkGpwSYEypB+vSo=; b=KaeRUeDZyiwkV0GvdtjweJdB3/Kln8uuoFdbr9fgqeqiv/BqQc8CWb95xDjBCvAfEM v/Qr/G9q7+WKd7acdGLhcEMYa7bZBFuOKzmP/UdgrxI5LNW6GdAxwJLyox9Zm7ebq7Wr PqkhgVgbEWgalW8h/lSw455tkcZvvsQ7ANgHo6wT7MG+TAnsenbj1MLqxXFo6wpvwEBG sXnRg0BJp+3Gpgbkt6nENf9qaI5JgZVWQjh43pEWsynfBX0eeu6jABWLLXaLOQgc27O2 UGjimh7XY0a7OgFFKqfa14dF5B84CsD+zlllIACl6rpPT3BTfTfsFd82ng3BFrWeLwkz dxqQ== MIME-Version: 1.0 Received: by 10.50.242.74 with SMTP id wo10mr6582771igc.51.1351415062005; Sun, 28 Oct 2012 02:04:22 -0700 (PDT) Sender: pluknet@gmail.com Received: by 10.64.47.228 with HTTP; Sun, 28 Oct 2012 02:04:21 -0700 (PDT) In-Reply-To: <201210272342.q9RNgffr083366@svn.freebsd.org> References: <201210272342.q9RNgffr083366@svn.freebsd.org> Date: Sun, 28 Oct 2012 12:04:21 +0300 X-Google-Sender-Auth: d_cn91ksQLCIyd6LLt3Op0c_t9E Message-ID: Subject: Re: svn commit: r242202 - head/sys/kern From: Sergey Kandaurov To: Davide Italiano Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 09:04:23 -0000 On 28 October 2012 03:42, Davide Italiano wrote: > Author: davide > Date: Sat Oct 27 23:42:41 2012 > New Revision: 242202 > URL: http://svn.freebsd.org/changeset/base/242202 > > Log: > The fields of struct timespec32 should be int32_t and not uint32_t. > Make this change. > > Reviewed by: bde, davidxu > Tested by: pho > MFC after: 1 week > > Modified: > head/sys/kern/kern_umtx.c > > Modified: head/sys/kern/kern_umtx.c > ============================================================================== > --- head/sys/kern/kern_umtx.c Sat Oct 27 23:36:41 2012 (r242201) > +++ head/sys/kern/kern_umtx.c Sat Oct 27 23:42:41 2012 (r242202) > @@ -3291,8 +3291,8 @@ freebsd32_umtx_unlock(struct thread *td, > } > > struct timespec32 { > - uint32_t tv_sec; > - uint32_t tv_nsec; > + int32_t tv_sec; > + int32_t tv_nsec; > }; > > struct umtx_time32 { Thanks. It could be fine to take this from compat/freebsd32, OTOH it hardly makes sense for me. IMHO duplicating a single struct definition is sometimes lesser evil than inclusion pile of unused stuff from yet another header(s). -- wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 09:14:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 09066812; Sun, 28 Oct 2012 09:14:43 +0000 (UTC) (envelope-from edwin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3DD98FC12; Sun, 28 Oct 2012 09:14:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9S9Egjf071431; Sun, 28 Oct 2012 09:14:42 GMT (envelope-from edwin@svn.freebsd.org) Received: (from edwin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9S9EgaC071426; Sun, 28 Oct 2012 09:14:42 GMT (envelope-from edwin@svn.freebsd.org) Message-Id: <201210280914.q9S9EgaC071426@svn.freebsd.org> From: Edwin Groothuis Date: Sun, 28 Oct 2012 09:14:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242208 - head/contrib/tzdata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 09:14:43 -0000 Author: edwin Date: Sun Oct 28 09:14:42 2012 New Revision: 242208 URL: http://svn.freebsd.org/changeset/base/242208 Log: Merge of vendor import of tzdata2012h - Bahia no longer has DST. - Tocantins has DST. - Israel has new DST rules next year. - Jordan stays on DST this winter. Modified: head/contrib/tzdata/asia head/contrib/tzdata/southamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/asia ============================================================================== --- head/contrib/tzdata/asia Sun Oct 28 09:13:07 2012 (r242207) +++ head/contrib/tzdata/asia Sun Oct 28 09:14:42 2012 (r242208) @@ -1170,15 +1170,15 @@ Rule Zion 2004 only - Sep 22 1:00 0 S # # ftp://ftp.cs.huji.ac.il/pub/tz/announcements/2005+beyond.ps -# From Paul Eggert (2005-02-22): +# From Paul Eggert (2012-10-26): # I used Ephraim Silverberg's dst-israel.el program # (2005-02-20) # along with Ed Reingold's cal-hebrew in GNU Emacs 21.4, -# to generate the transitions in this list. +# to generate the transitions from 2005 through 2012. # (I replaced "lastFri" with "Fri>=26" by hand.) -# The spring transitions below all correspond to the following Rule: +# The spring transitions all correspond to the following Rule: # -# Rule Zion 2005 max - Mar Fri>=26 2:00 1:00 D +# Rule Zion 2005 2012 - Mar Fri>=26 2:00 1:00 D # # but older zic implementations (e.g., Solaris 8) do not support # "Fri>=26" to mean April 1 in years like 2005, so for now we list the @@ -1195,39 +1195,36 @@ Rule Zion 2009 only - Sep 27 2:00 0 S Rule Zion 2010 only - Sep 12 2:00 0 S Rule Zion 2011 only - Apr 1 2:00 1:00 D Rule Zion 2011 only - Oct 2 2:00 0 S -Rule Zion 2012 2015 - Mar Fri>=26 2:00 1:00 D +Rule Zion 2012 only - Mar Fri>=26 2:00 1:00 D Rule Zion 2012 only - Sep 23 2:00 0 S -Rule Zion 2013 only - Sep 8 2:00 0 S -Rule Zion 2014 only - Sep 28 2:00 0 S -Rule Zion 2015 only - Sep 20 2:00 0 S -Rule Zion 2016 only - Apr 1 2:00 1:00 D -Rule Zion 2016 only - Oct 9 2:00 0 S -Rule Zion 2017 2021 - Mar Fri>=26 2:00 1:00 D -Rule Zion 2017 only - Sep 24 2:00 0 S -Rule Zion 2018 only - Sep 16 2:00 0 S -Rule Zion 2019 only - Oct 6 2:00 0 S -Rule Zion 2020 only - Sep 27 2:00 0 S -Rule Zion 2021 only - Sep 12 2:00 0 S -Rule Zion 2022 only - Apr 1 2:00 1:00 D -Rule Zion 2022 only - Oct 2 2:00 0 S -Rule Zion 2023 2032 - Mar Fri>=26 2:00 1:00 D -Rule Zion 2023 only - Sep 24 2:00 0 S -Rule Zion 2024 only - Oct 6 2:00 0 S -Rule Zion 2025 only - Sep 28 2:00 0 S -Rule Zion 2026 only - Sep 20 2:00 0 S -Rule Zion 2027 only - Oct 10 2:00 0 S -Rule Zion 2028 only - Sep 24 2:00 0 S -Rule Zion 2029 only - Sep 16 2:00 0 S -Rule Zion 2030 only - Oct 6 2:00 0 S -Rule Zion 2031 only - Sep 21 2:00 0 S -Rule Zion 2032 only - Sep 12 2:00 0 S -Rule Zion 2033 only - Apr 1 2:00 1:00 D -Rule Zion 2033 only - Oct 2 2:00 0 S -Rule Zion 2034 2037 - Mar Fri>=26 2:00 1:00 D -Rule Zion 2034 only - Sep 17 2:00 0 S -Rule Zion 2035 only - Oct 7 2:00 0 S -Rule Zion 2036 only - Sep 28 2:00 0 S -Rule Zion 2037 only - Sep 13 2:00 0 S + +# From Ephraim Silverberg (2012-10-18): + +# Yesterday, the Interior Ministry Committee, after more than a year +# past, approved sending the proposed June 2011 changes to the Time +# Decree Law back to the Knesset for second and third (final) votes +# before the upcoming elections on Jan. 22, 2013. Hence, although the +# changes are not yet law, they are expected to be so before Februray 2013. +# +# As of 2013, DST starts at 02:00 on the Friday before the last Sunday in March. +# DST ends at 02:00 on the first Sunday after October 1, unless it occurs on the +# second day of the Jewish Rosh Hashana holiday, in which case DST ends a day +# later (i.e. at 02:00 the first Monday after October 2). +# [Rosh Hashana holidays are factored in until 2100.] + +# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S +Rule Zion 2013 max - Mar Fri>=23 2:00 1:00 D +Rule Zion 2013 2026 - Oct Sun>=2 2:00 0 S +Rule Zion 2027 only - Oct Mon>=3 2:00 0 S +Rule Zion 2028 max - Oct Sun>=2 2:00 0 S +# The following rules are commented out for now, as they break older +# versions of zic that support only signed 32-bit timestamps, i.e., +# through 2038-01-19 03:14:07 UTC. +#Rule Zion 2028 2053 - Oct Sun>=2 2:00 0 S +#Rule Zion 2054 only - Oct Mon>=3 2:00 0 S +#Rule Zion 2055 2080 - Oct Sun>=2 2:00 0 S +#Rule Zion 2081 only - Oct Mon>=3 2:00 0 S +#Rule Zion 2082 max - Oct Sun>=2 2:00 0 S # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Jerusalem 2:20:56 - LMT 1880 @@ -1362,6 +1359,16 @@ Zone Asia/Tokyo 9:18:59 - LMT 1887 Dec 3 # From Arthur David Olson (2009-04-06): # We still have Jordan switching to DST on Thursdays in 2000 and 2001. +# From Steffen Thorsen (2012-10-25): +# Yesterday the government in Jordan announced that they will not +# switch back to standard time this winter, so the will stay on DST +# until about the same time next year (at least). +# http://www.petra.gov.jo/Public_News/Nws_NewsDetails.aspx?NewsID=88950 +# +# From Paul Eggert (2012-10-25): +# For now, assume this is just a one-year measure. If it becomes +# permanent, we should move Jordan from EET to AST effective tomorrow. + # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S Rule Jordan 1973 only - Jun 6 0:00 1:00 S Rule Jordan 1973 1975 - Oct 1 0:00 0 - @@ -1390,7 +1397,8 @@ Rule Jordan 2002 max - Mar lastThu 24:00 Rule Jordan 2003 only - Oct 24 0:00s 0 - Rule Jordan 2004 only - Oct 15 0:00s 0 - Rule Jordan 2005 only - Sep lastFri 0:00s 0 - -Rule Jordan 2006 max - Oct lastFri 0:00s 0 - +Rule Jordan 2006 2011 - Oct lastFri 0:00s 0 - +Rule Jordan 2013 max - Oct lastFri 0:00s 0 - # Zone NAME GMTOFF RULES FORMAT [UNTIL] Zone Asia/Amman 2:23:44 - LMT 1931 2:00 Jordan EE%sT Modified: head/contrib/tzdata/southamerica ============================================================================== --- head/contrib/tzdata/southamerica Sun Oct 28 09:13:07 2012 (r242207) +++ head/contrib/tzdata/southamerica Sun Oct 28 09:14:42 2012 (r242208) @@ -829,6 +829,15 @@ Zone America/La_Paz -4:32:36 - LMT 1890 # http://www.in.gov.br/visualiza/index.jsp?data=13/10/2011&jornal=1000&pagina=6&totalArquivos=6 # +# From Kelley Cook (2012-10-16): +# The governor of state of Bahia in Brazil announced on Thursday that +# due to public pressure, he is reversing the DST policy they implemented +# last year and will not be going to Summer Time on October 21st.... +# http://www.correio24horas.com.br/r/artigo/apos-pressoes-wagner-suspende-horario-de-verao-na-bahia + +# From Rodrigo Severo (2012-10-16): +# Tocantins state will have DST. +# http://noticias.terra.com.br/brasil/noticias/0,,OI6232536-EI306.html # Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S # Decree 20,466 (1931-10-01) @@ -1048,7 +1057,8 @@ Zone America/Araguaina -3:12:48 - LMT 19 -3:00 Brazil BR%sT 1990 Sep 17 -3:00 - BRT 1995 Sep 14 -3:00 Brazil BR%sT 2003 Sep 24 - -3:00 - BRT + -3:00 - BRT 2012 Oct 21 + -3:00 Brazil BR%sT # # Alagoas (AL), Sergipe (SE) Zone America/Maceio -2:22:52 - LMT 1914 @@ -1067,7 +1077,8 @@ Zone America/Maceio -2:22:52 - LMT 1914 Zone America/Bahia -2:34:04 - LMT 1914 -3:00 Brazil BR%sT 2003 Sep 24 -3:00 - BRT 2011 Oct 16 - -3:00 Brazil BR%sT + -3:00 Brazil BR%sT 2012 Oct 21 + -3:00 - BRT # # Goias (GO), Distrito Federal (DF), Minas Gerais (MG), # Espirito Santo (ES), Rio de Janeiro (RJ), Sao Paulo (SP), Parana (PR), From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 10:06:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E461247B; Sun, 28 Oct 2012 10:06:00 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6D7B08FC0C; Sun, 28 Oct 2012 10:06:00 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.5/8.14.5) with ESMTP id q9SA5txP065029 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Sun, 28 Oct 2012 11:05:55 +0100 (CET) (envelope-from uqs@FreeBSD.org) Date: Sun, 28 Oct 2012 11:05:55 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Michael Tuexen Subject: Re: svn commit: r241916 - in head/sys: netinet netinet6 Message-ID: <20121028100555.GA28199@acme.spoerlein.net> Mail-Followup-To: Ulrich =?utf-8?B?U3DDtnJsZWlu?= , Michael Tuexen , Bruce Evans , Xin LI , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org References: <201210222149.q9MLnvrt014543@svn.freebsd.org> <20121023142219.K1008@besplex.bde.org> <20121024052525.T4723@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Xin LI , Bruce Evans X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 10:06:01 -0000 On Tue, 2012-10-23 at 20:43:33 +0200, Michael Tuexen wrote: > On Oct 23, 2012, at 8:28 PM, Bruce Evans wrote: > > > On Tue, 23 Oct 2012, Michael Tuexen wrote: > > > >> On Oct 23, 2012, at 6:23 AM, Bruce Evans wrote: > >> > >>> On Mon, 22 Oct 2012, Xin LI wrote: > >>> > >>>> Log: > >>>> Remove __P. > >>> > >>> This was a chance to remove style bugs in the prototypes. At least it > >>> didn't create so many new ones, unlike the original __P axing. It > >>> still enlarged about a hundred by changing from Gnu style continuation > >>> to Gnu style continuation indentation with an off-by-5 error. > >> > >> please note that the SCTP code in the FreeBSD sources is generated > >> via an export script from a codebase which runs on multiple platforms. > >> The script tries to follow FreeBSDs guidelines, but is far from being > >> perfect. > > > > The export script might not like manual editing of its output. > > > > Portability might require __P(()), and then removing it cleaning requires > > a complicated script. > Maybe I wasn't clear... > > * The removal of __P() needs also be done upstream. I'll handle this, not problem. > I don't think we need __P on any platform. > * My comment was regarding your list of formatting issues of the code. Changing > the formatting would require changing the export script. > If someone "just" changes the FreeBSD sources and these changes are not included > upstream, they are lost by the next commit of rrs@ or mine. > > My point was: Getting rid of __P is fine and we can handle that upstream (as > any other non whitespace/formatting changes needed), but changing the formatting > is NOT that easy. I'm sorry about that and just wanted to let you know that > there is a reason why the style 9 stuff is not followed exactly within the > SCTP code. > > I hope this makes the situation clearer. Maybe running it through uncrustify[1] as part of the export for FreeBSD could help here? hth Uli [1] http://uncrustify.sourceforge.net/ and textproc/uncrustify From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 11:53:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C52059CE; Sun, 28 Oct 2012 11:53: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 788A08FC0A; Sun, 28 Oct 2012 11:53:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SBrtlj099268; Sun, 28 Oct 2012 11:53:55 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SBrtAv099265; Sun, 28 Oct 2012 11:53:55 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201210281153.q9SBrtAv099265@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 28 Oct 2012 11:53:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242218 - in head/sys/ia64: ia64 include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 11:53:56 -0000 Author: kib Date: Sun Oct 28 11:53:54 2012 New Revision: 242218 URL: http://svn.freebsd.org/changeset/base/242218 Log: Fix compilation on ia64 when page size is configured for 16KB. Reviewed by: alc, marcel Modified: head/sys/ia64/ia64/pmap.c head/sys/ia64/include/pmap.h Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sun Oct 28 11:27:54 2012 (r242217) +++ head/sys/ia64/ia64/pmap.c Sun Oct 28 11:53:54 2012 (r242218) @@ -140,6 +140,29 @@ extern uint64_t ia64_gateway_page[]; #define pmap_set_wired(lpte) (lpte)->pte |= PTE_WIRED /* + * Individual PV entries are stored in per-pmap chunks. This saves + * space by eliminating the need to record the pmap within every PV + * entry. + */ +#if PAGE_SIZE == 8192 +#define _NPCM 6 +#define _NPCPV 337 +#define _NPCS 2 +#elif PAGE_SIZE == 16384 +#define _NPCM 11 +#define _NPCPV 677 +#define _NPCS 1 +#endif +struct pv_chunk { + pmap_t pc_pmap; + TAILQ_ENTRY(pv_chunk) pc_list; + u_long pc_map[_NPCM]; /* bitmap; 1 = free */ + TAILQ_ENTRY(pv_chunk) pc_lru; + u_long pc_spare[_NPCS]; + struct pv_entry pc_pventry[_NPCPV]; +}; + +/* * The VHPT bucket head structure. */ struct ia64_bucket { @@ -693,8 +716,6 @@ pmap_growkernel(vm_offset_t addr) ***************************************************/ CTASSERT(sizeof(struct pv_chunk) == PAGE_SIZE); -CTASSERT(_NPCM == 6); -CTASSERT(_NPCPV == 337); static __inline struct pv_chunk * pv_to_chunk(pv_entry_t pv) @@ -705,13 +726,23 @@ pv_to_chunk(pv_entry_t pv) #define PV_PMAP(pv) (pv_to_chunk(pv)->pc_pmap) -#define PC_FREE0_4 0xfffffffffffffffful -#define PC_FREE5 0x000000000001fffful +#define PC_FREE_FULL 0xfffffffffffffffful +#define PC_FREE_PARTIAL \ + ((1UL << (_NPCPV - sizeof(u_long) * 8 * (_NPCM - 1))) - 1) +#if PAGE_SIZE == 8192 static const u_long pc_freemask[_NPCM] = { - PC_FREE0_4, PC_FREE0_4, PC_FREE0_4, - PC_FREE0_4, PC_FREE0_4, PC_FREE5 + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_PARTIAL }; +#elif PAGE_SIZE == 16384 +static const u_long pc_freemask[_NPCM] = { + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_FULL, PC_FREE_FULL, + PC_FREE_FULL, PC_FREE_PARTIAL +}; +#endif static SYSCTL_NODE(_vm, OID_AUTO, pmap, CTLFLAG_RD, 0, "VM/pmap parameters"); Modified: head/sys/ia64/include/pmap.h ============================================================================== --- head/sys/ia64/include/pmap.h Sun Oct 28 11:27:54 2012 (r242217) +++ head/sys/ia64/include/pmap.h Sun Oct 28 11:53:54 2012 (r242218) @@ -105,21 +105,6 @@ typedef struct pv_entry { TAILQ_ENTRY(pv_entry) pv_list; } *pv_entry_t; -/* - * pv_entries are allocated in chunks per-process. This avoids the - * need to track per-pmap assignments. - */ -#define _NPCM 6 -#define _NPCPV 337 -struct pv_chunk { - pmap_t pc_pmap; - TAILQ_ENTRY(pv_chunk) pc_list; - u_long pc_map[_NPCM]; /* bitmap; 1 = free */ - TAILQ_ENTRY(pv_chunk) pc_lru; - u_long pc_spare[2]; - struct pv_entry pc_pventry[_NPCPV]; -}; - #ifdef _KERNEL extern vm_paddr_t phys_avail[]; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 14:37:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D9BAF4D5; Sun, 28 Oct 2012 14:37:17 +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 C16B48FC0A; Sun, 28 Oct 2012 14:37:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SEbHpW028280; Sun, 28 Oct 2012 14:37:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SEbH94028278; Sun, 28 Oct 2012 14:37:17 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201210281437.q9SEbH94028278@svn.freebsd.org> From: Hans Petter Selasky Date: Sun, 28 Oct 2012 14:37:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242223 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 14:37:17 -0000 Author: hselasky Date: Sun Oct 28 14:37:17 2012 New Revision: 242223 URL: http://svn.freebsd.org/changeset/base/242223 Log: Implement support for the so-called USB feedback endpoint for USB audio devices. This endpoint gives clues to the USB host about the actual data rate on asynchronous endpoints and makes the more expensive USB audio devices usable under FreeBSD. The Linux USB audio driver was used as reference for the automagic shift of the received value. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Sun Oct 28 13:21:35 2012 (r242222) +++ head/sys/dev/sound/usb/uaudio.c Sun Oct 28 14:37:17 2012 (r242223) @@ -176,7 +176,7 @@ struct uaudio_chan { struct mtx *pcm_mtx; /* lock protecting this structure */ struct uaudio_softc *priv_sc; struct pcm_channel *pcm_ch; - struct usb_xfer *xfer[UAUDIO_NCHANBUFS]; + struct usb_xfer *xfer[UAUDIO_NCHANBUFS + 1]; union uaudio_asf1d p_asf1d; union uaudio_sed p_sed; const usb_endpoint_descriptor_audio_t *p_ed1; @@ -206,6 +206,12 @@ struct uaudio_chan { uint8_t iface_index; uint8_t iface_alt_index; uint8_t channels; + + uint8_t last_sync_time; + uint8_t last_sync_state; +#define UAUDIO_SYNC_NONE 0 +#define UAUDIO_SYNC_MORE 1 +#define UAUDIO_SYNC_LESS 2 }; #define UMIDI_CABLES_MAX 16 /* units */ @@ -386,7 +392,9 @@ static device_attach_t uaudio_attach; static device_detach_t uaudio_detach; static usb_callback_t uaudio_chan_play_callback; +static usb_callback_t uaudio_chan_play_sync_callback; static usb_callback_t uaudio_chan_record_callback; +static usb_callback_t uaudio_chan_record_sync_callback; static usb_callback_t uaudio_mixer_write_cfg_callback; static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; @@ -482,7 +490,7 @@ static void uaudio_chan_dump_ep_desc( #endif static const struct usb_config - uaudio_cfg_record[UAUDIO_NCHANBUFS] = { + uaudio_cfg_record[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -502,10 +510,20 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_record_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_OUT, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_record_sync_callback, + }, }; static const struct usb_config - uaudio_cfg_play[UAUDIO_NCHANBUFS] = { + uaudio_cfg_play[UAUDIO_NCHANBUFS + 1] = { [0] = { .type = UE_ISOCHRONOUS, .endpoint = UE_ADDR_ANY, @@ -525,6 +543,16 @@ static const struct usb_config .flags = {.short_xfer_ok = 1,}, .callback = &uaudio_chan_play_callback, }, + + [2] = { + .type = UE_ISOCHRONOUS, + .endpoint = UE_ADDR_ANY, + .direction = UE_DIR_IN, + .bufsize = 0, /* use "wMaxPacketSize * frames" */ + .frames = 1, + .flags = {.no_pipe_ok = 1,.short_xfer_ok = 1,}, + .callback = &uaudio_chan_play_sync_callback, + }, }; static const struct usb_config @@ -845,9 +873,9 @@ uaudio_detach(device_t dev) * any. */ if (sc->sc_play_chan.valid) - usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_play_chan.xfer, UAUDIO_NCHANBUFS + 1); if (sc->sc_rec_chan.valid) - usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(sc->sc_rec_chan.xfer, UAUDIO_NCHANBUFS + 1); if (bus_generic_detach(dev) != 0) { DPRINTF("detach failed!\n"); @@ -1396,10 +1424,96 @@ done: } static void +uaudio_chan_play_sync_callback(struct usb_xfer *xfer, usb_error_t error) +{ + struct uaudio_chan *ch = usbd_xfer_softc(xfer); + struct usb_page_cache *pc; + uint8_t buf[4]; + uint64_t temp; + int len; + int actlen; + int nframes; + + usbd_xfer_status(xfer, &actlen, NULL, NULL, &nframes); + + switch (USB_GET_STATE(xfer)) { + case USB_ST_TRANSFERRED: + + DPRINTFN(6, "transferred %d bytes\n", actlen); + + if (nframes == 0) + break; + len = usbd_xfer_frame_len(xfer, 0); + if (len == 0) + break; + if (len > sizeof(buf)) + len = sizeof(buf); + + memset(buf, 0, sizeof(buf)); + + pc = usbd_xfer_get_frame(xfer, 0); + usbd_copy_out(pc, 0, buf, len); + + temp = UGETDW(buf); + + DPRINTF("Value = 0x%08x\n", (int)temp); + + /* auto-detect SYNC format */ + + if (len == 4) + temp &= 0x0fffffff; + + /* check for no data */ + + if (temp == 0) + break; + + /* correctly scale value */ + + temp = (temp * 125ULL) - 64; + + /* auto adjust */ + + while (temp < (ch->sample_rate - (ch->sample_rate / 4))) + temp *= 2; + + while (temp > (ch->sample_rate + (ch->sample_rate / 2))) + temp /= 2; + + /* bias */ + + temp += (ch->sample_rate + 1999) / 2000; + + /* compare */ + + DPRINTF("Comparing %d < %d\n", + (int)temp, (int)ch->sample_rate); + + if (temp == ch->sample_rate) + ch->last_sync_state = UAUDIO_SYNC_NONE; + else if (temp > ch->sample_rate) + ch->last_sync_state = UAUDIO_SYNC_MORE; + else + ch->last_sync_state = UAUDIO_SYNC_LESS; + break; + + case USB_ST_SETUP: + usbd_xfer_set_frames(xfer, 1); + usbd_xfer_set_frame_len(xfer, 0, usbd_xfer_max_framelen(xfer)); + usbd_transfer_submit(xfer); + break; + + default: /* Error */ + break; + } +} + +static void uaudio_chan_play_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); struct usb_page_cache *pc; + uint32_t mfl; uint32_t total; uint32_t blockcount; uint32_t n; @@ -1423,12 +1537,18 @@ tr_transferred: } chn_intr(ch->pcm_ch); + /* start SYNC transfer, if any */ + if ((ch->last_sync_time++ & 7) == 0) + usbd_transfer_start(ch->xfer[UAUDIO_NCHANBUFS]); + case USB_ST_SETUP: - if (ch->bytes_per_frame[1] > usbd_xfer_max_framelen(xfer)) { + mfl = usbd_xfer_max_framelen(xfer); + + if (ch->bytes_per_frame[1] > mfl) { DPRINTF("bytes per transfer, %d, " "exceeds maximum, %d!\n", ch->bytes_per_frame[1], - usbd_xfer_max_framelen(xfer)); + mfl); break; } @@ -1442,15 +1562,37 @@ tr_transferred: /* setup frame lengths */ for (n = 0; n != blockcount; n++) { + uint32_t frame_len; + ch->sample_curr += ch->sample_rem; if (ch->sample_curr >= ch->frames_per_second) { ch->sample_curr -= ch->frames_per_second; - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[1]); - total += ch->bytes_per_frame[1]; + frame_len = ch->bytes_per_frame[1]; } else { - usbd_xfer_set_frame_len(xfer, n, ch->bytes_per_frame[0]); - total += ch->bytes_per_frame[0]; + frame_len = ch->bytes_per_frame[0]; + } + + if (n == (blockcount - 1)) { + switch (ch->last_sync_state) { + case UAUDIO_SYNC_MORE: + DPRINTFN(6, "sending one sample more\n"); + if ((frame_len + ch->sample_size) <= mfl) + frame_len += ch->sample_size; + ch->last_sync_state = UAUDIO_SYNC_NONE; + break; + case UAUDIO_SYNC_LESS: + DPRINTFN(6, "sending one sample less\n"); + if (frame_len >= ch->sample_size) + frame_len -= ch->sample_size; + ch->last_sync_state = UAUDIO_SYNC_NONE; + break; + default: + break; + } } + + usbd_xfer_set_frame_len(xfer, n, frame_len); + total += frame_len; } DPRINTFN(6, "transfer %d bytes\n", total); @@ -1487,6 +1629,12 @@ tr_transferred: } static void +uaudio_chan_record_sync_callback(struct usb_xfer *xfer, usb_error_t error) +{ + /* TODO */ +} + +static void uaudio_chan_record_callback(struct usb_xfer *xfer, usb_error_t error) { struct uaudio_chan *ch = usbd_xfer_softc(xfer); @@ -1697,7 +1845,7 @@ uaudio_chan_init(struct uaudio_softc *sc } } if (usbd_transfer_setup(sc->sc_udev, &iface_index, ch->xfer, - ch->usb_cfg, UAUDIO_NCHANBUFS, ch, ch->pcm_mtx)) { + ch->usb_cfg, UAUDIO_NCHANBUFS + 1, ch, ch->pcm_mtx)) { DPRINTF("could not allocate USB transfers!\n"); goto error; } @@ -1767,7 +1915,7 @@ uaudio_chan_free(struct uaudio_chan *ch) free(ch->buf, M_DEVBUF); ch->buf = NULL; } - usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS); + usbd_transfer_unsetup(ch->xfer, UAUDIO_NCHANBUFS + 1); ch->valid = 0; @@ -1868,12 +2016,8 @@ uaudio_chan_start(struct uaudio_chan *ch #if (UAUDIO_NCHANBUFS != 2) #error "please update code" #endif - if (ch->xfer[0]) { - usbd_transfer_start(ch->xfer[0]); - } - if (ch->xfer[1]) { - usbd_transfer_start(ch->xfer[1]); - } + usbd_transfer_start(ch->xfer[0]); + usbd_transfer_start(ch->xfer[1]); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 17:16:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 97CD7FA2; Sun, 28 Oct 2012 17:16:10 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F1088FC08; Sun, 28 Oct 2012 17:16:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SHGAUp060277; Sun, 28 Oct 2012 17:16:10 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SHGAss060275; Sun, 28 Oct 2012 17:16:10 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281716.q9SHGAss060275@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242249 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 17:16:10 -0000 Author: andre Date: Sun Oct 28 17:16:09 2012 New Revision: 242249 URL: http://svn.freebsd.org/changeset/base/242249 Log: Adjust the initial default CWND upon connection establishment to the new and increased values specified by RFC5681 Section 3.1. The even larger initial CWND per RFC3390, if enabled, is not affected. MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Oct 28 17:06:50 2012 (r242248) +++ head/sys/netinet/tcp_input.c Sun Oct 28 17:16:09 2012 (r242249) @@ -351,8 +351,15 @@ cc_conn_init(struct tcpcb *tp) if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); - else - tp->snd_cwnd = tp->t_maxseg; + else { + /* Per RFC5681 Section 3.1 */ + if (tp->t_maxseg > 2190) + tp->snd_cwnd = 2 * tp->t_maxseg; + else if (tp->t_maxseg > 1095) + tp->snd_cwnd = 3 * tp->t_maxseg; + else + tp->snd_cwnd = 4 * tp->t_maxseg; + } if (CC_ALGO(tp)->conn_init != NULL) CC_ALGO(tp)->conn_init(tp->ccv); From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 17:25:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B8350298; Sun, 28 Oct 2012 17:25:09 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85BE58FC08; Sun, 28 Oct 2012 17:25:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SHP9xI061869; Sun, 28 Oct 2012 17:25:09 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SHP9Sw061865; Sun, 28 Oct 2012 17:25:09 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281725.q9SHP9Sw061865@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:25:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242250 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 17:25:09 -0000 Author: andre Date: Sun Oct 28 17:25:08 2012 New Revision: 242250 URL: http://svn.freebsd.org/changeset/base/242250 Log: When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to reduce the initial CWND to one segment. This reduction got lost some time ago due to a change in initialization ordering. Additionally in tcp_timer_rexmt() avoid entering fast recovery when we're still in TCPS_SYN_SENT state. MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Oct 28 17:16:09 2012 (r242249) +++ head/sys/netinet/tcp_input.c Sun Oct 28 17:25:08 2012 (r242250) @@ -345,10 +345,16 @@ cc_conn_init(struct tcpcb *tp) /* * Set the initial slow-start flight size. * - * RFC3390 says only do this if SYN or SYN/ACK didn't got lost. - * XXX: We currently check only in syncache_socket for that. - */ - if (V_tcp_do_rfc3390) + * RFC5681 Section 3.1 specifies the default conservative values. + * RFC3390 specifies slightly more aggressive values. + * + * If a SYN or SYN/ACK was lost and retransmitted, we have to + * reduce the initial CWND to one segment as congestion is likely + * requiring us to be cautious. + */ + if (tp->snd_cwnd == 1) + tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); else { Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Oct 28 17:16:09 2012 (r242249) +++ head/sys/netinet/tcp_syncache.c Sun Oct 28 17:25:08 2012 (r242250) @@ -852,11 +852,12 @@ syncache_socket(struct syncache *sc, str tcp_mss(tp, sc->sc_peer_mss); /* - * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. + * If the SYN,ACK was retransmitted, indicate that CWND to be + * limited to one segment in cc_conn_init(). * NB: sc_rxmits counts all SYN,ACK transmits, not just retransmits. */ if (sc->sc_rxmits > 1) - tp->snd_cwnd = tp->t_maxseg; + tp->snd_cwnd = 1; #ifdef TCP_OFFLOAD /* Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 17:16:09 2012 (r242249) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 17:25:08 2012 (r242250) @@ -539,7 +539,13 @@ tcp_timer_rexmt(void * xtp) } INP_INFO_RUNLOCK(&V_tcbinfo); headlocked = 0; - if (tp->t_rxtshift == 1) { + if (tp->t_state == TCPS_SYN_SENT) { + /* + * If the SYN was retransmitted, indicate CWND to be + * limited to 1 segment in cc_conn_init(). + */ + tp->snd_cwnd = 1; + } else if (tp->t_rxtshift == 1) { /* * first retransmit; record ssthresh and cwnd so they can * be recovered if this turns out to be a "bad" retransmit. From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 17:30:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A36E647F; Sun, 28 Oct 2012 17:30:29 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 89DBB8FC0C; Sun, 28 Oct 2012 17:30:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SHUTkm062775; Sun, 28 Oct 2012 17:30:29 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SHUT6U062773; Sun, 28 Oct 2012 17:30:29 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281730.q9SHUT6U062773@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:30:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242251 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 17:30:29 -0000 Author: andre Date: Sun Oct 28 17:30:28 2012 New Revision: 242251 URL: http://svn.freebsd.org/changeset/base/242251 Log: When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to reduce the initial CWND to one segment. This reduction got lost some time ago due to a change in initialization ordering. Additionally in tcp_timer_rexmt() avoid entering fast recovery when we're still in TCPS_SYN_SENT state. MFC after: 2 weeks Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun Oct 28 17:25:08 2012 (r242250) +++ head/sys/netinet/tcp_output.c Sun Oct 28 17:30:28 2012 (r242251) @@ -551,10 +551,14 @@ after_sack_rexmit: * max size segments, or at least 50% of the maximum possible * window, then want to send a window update to peer. * Skip this if the connection is in T/TCP half-open state. - * Don't send pure window updates when the peer has closed - * the connection and won't ever send more data. + * + * Don't send an independent window update if a delayed + * ACK is pending (it will get piggy-backed on it) or the + * remote side already has done a half-close and won't send + * more data. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && + !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* * "adv" is the amount we can increase the window, From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 17:40:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07DE67AF; Sun, 28 Oct 2012 17:40:36 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E18368FC0C; Sun, 28 Oct 2012 17:40:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SHeZ8f064682; Sun, 28 Oct 2012 17:40:35 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SHeZe8064680; Sun, 28 Oct 2012 17:40:35 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281740.q9SHeZe8064680@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:40:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242252 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 17:40:36 -0000 Author: andre Date: Sun Oct 28 17:40:35 2012 New Revision: 242252 URL: http://svn.freebsd.org/changeset/base/242252 Log: Prevent a flurry of forced window updates when an application is doing small reads on a (partially) filled receive socket buffer. Normally one would a send a window update every time the available space in the socket buffer increases by two times MSS. This leads to a flurry of window updates that do not provide any meaningful new information to the sender. There still is available space in the window and the sender can continue sending data. All window updates then get carried by the regular ACKs. Only when the socket buffer was (almost) full and the window closed accordingly a window updates delivery new information and allows the sender to start sending more data again. Send window updates only every two MSS when the socket buffer has less than 1/8 space available, or the available space in the socket buffer increased by 1/4 its full capacity, or the socket buffer is very small. The next regular data ACK will carry and report the exact window size again. Reported by: sbruno Tested by: darrenr Tested by: Darren Baginski PR: kern/116335 MFC after: 2 weeks Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Sun Oct 28 17:30:28 2012 (r242251) +++ head/sys/netinet/tcp_output.c Sun Oct 28 17:40:35 2012 (r242252) @@ -545,23 +545,39 @@ after_sack_rexmit: } /* - * Compare available window to amount of window - * known to peer (as advertised window less - * next expected input). If the difference is at least two - * max size segments, or at least 50% of the maximum possible - * window, then want to send a window update to peer. - * Skip this if the connection is in T/TCP half-open state. + * Sending of standalone window updates. + * + * Window updates important when we close our window due to a full + * socket buffer and are opening it again after the application + * reads data from it. Once the window has opened again and the + * remote end starts to send again the ACK clock takes over and + * provides the most current window information. + * + * We must avoid to the silly window syndrome whereas every read + * from the receive buffer, no matter how small, causes a window + * update to be sent. We also should avoid sending a flurry of + * window updates when the socket buffer had queued a lot of data + * and the application is doing small reads. + * + * Prevent a flurry of pointless window updates by only sending + * an update when we can increase the advertized window by more + * than 1/4th of the socket buffer capacity. When the buffer is + * getting full or is very small be more aggressive and send an + * update whenever we can increase by two mss sized segments. + * In all other situations the ACK's to new incoming data will + * carry further window increases. * * Don't send an independent window update if a delayed * ACK is pending (it will get piggy-backed on it) or the * remote side already has done a half-close and won't send - * more data. + * more data. Skip this if the connection is in T/TCP + * half-open state. */ if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && !(tp->t_flags & TF_DELACK) && !TCPS_HAVERCVDFIN(tp->t_state)) { /* - * "adv" is the amount we can increase the window, + * "adv" is the amount we could increase the window, * taking into account that we are limited by * TCP_MAXWIN << tp->rcv_scale. */ @@ -581,9 +597,11 @@ after_sack_rexmit: */ if (oldwin >> tp->rcv_scale == (adv + oldwin) >> tp->rcv_scale) goto dontupdate; - if (adv >= (long) (2 * tp->t_maxseg)) - goto send; - if (2 * adv >= (long) so->so_rcv.sb_hiwat) + + if (adv >= (long)(2 * tp->t_maxseg) && + (adv >= (long)(so->so_rcv.sb_hiwat / 4) || + recwin <= (long)(so->so_rcv.sb_hiwat / 8) || + so->so_rcv.sb_hiwat <= 8 * tp->t_maxseg)) goto send; } dontupdate: From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 17:59:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7379CC27; Sun, 28 Oct 2012 17:59:47 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FAEB8FC16; Sun, 28 Oct 2012 17:59:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SHxlOq068102; Sun, 28 Oct 2012 17:59:47 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SHxlC5068100; Sun, 28 Oct 2012 17:59:47 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281759.q9SHxlC5068100@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 17:59:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242253 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 17:59:47 -0000 Author: andre Date: Sun Oct 28 17:59:46 2012 New Revision: 242253 URL: http://svn.freebsd.org/changeset/base/242253 Log: Simplify implementation of net.inet.tcp.reass.maxsegments and net.inet.tcp.reass.cursegments. MFC after: 2 weeks Modified: head/sys/netinet/tcp_reass.c Modified: head/sys/netinet/tcp_reass.c ============================================================================== --- head/sys/netinet/tcp_reass.c Sun Oct 28 17:40:35 2012 (r242252) +++ head/sys/netinet/tcp_reass.c Sun Oct 28 17:59:46 2012 (r242253) @@ -74,7 +74,6 @@ __FBSDID("$FreeBSD$"); #include #endif /* TCPDEBUG */ -static int tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS); static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS); static SYSCTL_NODE(_net_inet_tcp, OID_AUTO, reass, CTLFLAG_RW, 0, @@ -82,16 +81,12 @@ static SYSCTL_NODE(_net_inet_tcp, OID_AU static VNET_DEFINE(int, tcp_reass_maxseg) = 0; #define V_tcp_reass_maxseg VNET(tcp_reass_maxseg) -SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, maxsegments, - CTLTYPE_INT | CTLFLAG_RDTUN, - &VNET_NAME(tcp_reass_maxseg), 0, &tcp_reass_sysctl_maxseg, "I", +SYSCTL_VNET_INT(_net_inet_tcp_reass, OID_AUTO, maxsegments, CTLFLAG_RDTUN, + &VNET_NAME(tcp_reass_maxseg), 0, "Global maximum number of TCP Segments in Reassembly Queue"); -static VNET_DEFINE(int, tcp_reass_qsize) = 0; -#define V_tcp_reass_qsize VNET(tcp_reass_qsize) SYSCTL_VNET_PROC(_net_inet_tcp_reass, OID_AUTO, cursegments, - CTLTYPE_INT | CTLFLAG_RD, - &VNET_NAME(tcp_reass_qsize), 0, &tcp_reass_sysctl_qsize, "I", + (CTLTYPE_INT | CTLFLAG_RD), NULL, 0, &tcp_reass_sysctl_qsize, "I", "Global number of TCP Segments currently in Reassembly Queue"); static VNET_DEFINE(int, tcp_reass_overflows) = 0; @@ -109,8 +104,10 @@ static void tcp_reass_zone_change(void *tag) { + /* Set the zone limit and read back the effective value. */ V_tcp_reass_maxseg = nmbclusters / 16; uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); } void @@ -122,7 +119,9 @@ tcp_reass_init(void) &V_tcp_reass_maxseg); V_tcp_reass_zone = uma_zcreate("tcpreass", sizeof (struct tseg_qent), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); + /* Set the zone limit and read back the effective value. */ uma_zone_set_max(V_tcp_reass_zone, V_tcp_reass_maxseg); + V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); EVENTHANDLER_REGISTER(nmbclusters_change, tcp_reass_zone_change, NULL, EVENTHANDLER_PRI_ANY); } @@ -156,17 +155,12 @@ tcp_reass_flush(struct tcpcb *tp) } static int -tcp_reass_sysctl_maxseg(SYSCTL_HANDLER_ARGS) -{ - V_tcp_reass_maxseg = uma_zone_get_max(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); -} - -static int tcp_reass_sysctl_qsize(SYSCTL_HANDLER_ARGS) { - V_tcp_reass_qsize = uma_zone_get_cur(V_tcp_reass_zone); - return (sysctl_handle_int(oidp, arg1, arg2, req)); + int qsize; + + qsize = uma_zone_get_cur(V_tcp_reass_zone); + return (sysctl_handle_int(oidp, &qsize, sizeof(qsize), req)); } int From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:07:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E1C36DF1; Sun, 28 Oct 2012 18:07:34 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA51C8FC08; Sun, 28 Oct 2012 18:07:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SI7YDm069398; Sun, 28 Oct 2012 18:07:34 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SI7Yxa069395; Sun, 28 Oct 2012 18:07:34 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281807.q9SI7Yxa069395@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 18:07:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242254 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:07:35 -0000 Author: andre Date: Sun Oct 28 18:07:34 2012 New Revision: 242254 URL: http://svn.freebsd.org/changeset/base/242254 Log: Change the syncache count reporting the current number of entries from an unprotected u_int that reports garbage on SMP to a function based sysctl obtaining the current value from UMA. Also read back the actual cache_limit after page size rounding by UMA. PR: kern/165879 MFC after: 2 weeks Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_syncache.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Oct 28 17:59:46 2012 (r242253) +++ head/sys/netinet/tcp_syncache.c Sun Oct 28 18:07:34 2012 (r242254) @@ -123,6 +123,7 @@ struct syncache *syncache_lookup(struct static int syncache_respond(struct syncache *); static struct socket *syncache_socket(struct syncache *, struct socket *, struct mbuf *m); +static int syncache_sysctl_count(SYSCTL_HANDLER_ARGS); static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout); static void syncache_timer(void *); @@ -158,8 +159,8 @@ SYSCTL_VNET_UINT(_net_inet_tcp_syncache, &VNET_NAME(tcp_syncache.cache_limit), 0, "Overall entry limit for syncache"); -SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, count, CTLFLAG_RD, - &VNET_NAME(tcp_syncache.cache_count), 0, +SYSCTL_VNET_PROC(_net_inet_tcp_syncache, OID_AUTO, count, (CTLTYPE_UINT|CTLFLAG_RD), + NULL, 0, &syncache_sysctl_count, "IU", "Current number of entries in syncache"); SYSCTL_VNET_UINT(_net_inet_tcp_syncache, OID_AUTO, hashsize, CTLFLAG_RDTUN, @@ -225,7 +226,6 @@ syncache_init(void) { int i; - V_tcp_syncache.cache_count = 0; V_tcp_syncache.hashsize = TCP_SYNCACHE_HASHSIZE; V_tcp_syncache.bucket_limit = TCP_SYNCACHE_BUCKETLIMIT; V_tcp_syncache.rexmt_limit = SYNCACHE_MAXREXMTS; @@ -269,6 +269,7 @@ syncache_init(void) V_tcp_syncache.zone = uma_zcreate("syncache", sizeof(struct syncache), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); uma_zone_set_max(V_tcp_syncache.zone, V_tcp_syncache.cache_limit); + V_tcp_syncache.cache_limit = uma_zone_get_max(V_tcp_syncache.zone); } #ifdef VIMAGE @@ -296,8 +297,8 @@ syncache_destroy(void) mtx_destroy(&sch->sch_mtx); } - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", - __func__, V_tcp_syncache.cache_count)); + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0, + ("%s: cache_count not 0", __func__)); /* Free the allocated global resources. */ uma_zdestroy(V_tcp_syncache.zone); @@ -305,6 +306,15 @@ syncache_destroy(void) } #endif +static int +syncache_sysctl_count(SYSCTL_HANDLER_ARGS) +{ + int count; + + count = uma_zone_get_cur(V_tcp_syncache.zone); + return (sysctl_handle_int(oidp, &count, sizeof(count), req)); +} + /* * Inserts a syncache entry into the specified bucket row. * Locks and unlocks the syncache_head autonomously. @@ -347,7 +357,6 @@ syncache_insert(struct syncache *sc, str SCH_UNLOCK(sch); - V_tcp_syncache.cache_count++; TCPSTAT_INC(tcps_sc_added); } @@ -373,7 +382,6 @@ syncache_drop(struct syncache *sc, struc #endif syncache_free(sc); - V_tcp_syncache.cache_count--; } /* @@ -958,7 +966,6 @@ syncache_expand(struct in_conninfo *inc, tod->tod_syncache_removed(tod, sc->sc_todctx); } #endif - V_tcp_syncache.cache_count--; SCH_UNLOCK(sch); } Modified: head/sys/netinet/tcp_syncache.h ============================================================================== --- head/sys/netinet/tcp_syncache.h Sun Oct 28 17:59:46 2012 (r242253) +++ head/sys/netinet/tcp_syncache.h Sun Oct 28 18:07:34 2012 (r242254) @@ -112,7 +112,6 @@ struct tcp_syncache { u_int hashsize; u_int hashmask; u_int bucket_limit; - u_int cache_count; /* XXX: unprotected */ u_int cache_limit; u_int rexmt_limit; u_int hash_secret; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:33:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3F0527C; Sun, 28 Oct 2012 18:33:52 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A8F628FC0A; Sun, 28 Oct 2012 18:33:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIXqXf073406; Sun, 28 Oct 2012 18:33:52 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIXqfU073404; Sun, 28 Oct 2012 18:33:52 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281833.q9SIXqfU073404@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 18:33:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242255 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:33:52 -0000 Author: andre Date: Sun Oct 28 18:33:52 2012 New Revision: 242255 URL: http://svn.freebsd.org/changeset/base/242255 Log: Allow arbitrary MSS sizes and don't mind about the cluster size anymore. We've got more cluster sizes for quite some time now and the orginally imposed limits and the previously codified thoughts on efficiency gains are no longer true. MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Oct 28 18:07:34 2012 (r242254) +++ head/sys/netinet/tcp_input.c Sun Oct 28 18:33:52 2012 (r242255) @@ -3322,10 +3322,8 @@ tcp_xmit_timer(struct tcpcb *tp, int rtt /* * Determine a reasonable value for maxseg size. * If the route is known, check route for mtu. - * If none, use an mss that can be handled on the outgoing - * interface without forcing IP to fragment; if bigger than - * an mbuf cluster (MCLBYTES), round down to nearest multiple of MCLBYTES - * to utilize large mbufs. If no route is found, route has no mtu, + * If none, use an mss that can be handled on the outgoing interface + * without forcing IP to fragment. If no route is found, route has no mtu, * or the destination isn't local, use a default, hopefully conservative * size (usually 512 or the default IP max size, but no more than the mtu * of the interface), as we can't discover anything about intervening @@ -3506,13 +3504,6 @@ tcp_mss_update(struct tcpcb *tp, int off (tp->t_flags & TF_RCVD_TSTMP) == TF_RCVD_TSTMP)) mss -= TCPOLEN_TSTAMP_APPA; -#if (MCLBYTES & (MCLBYTES - 1)) == 0 - if (mss > MCLBYTES) - mss &= ~(MCLBYTES-1); -#else - if (mss > MCLBYTES) - mss = mss / MCLBYTES * MCLBYTES; -#endif tp->t_maxseg = mss; } From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:38:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BD32042B; Sun, 28 Oct 2012 18:38:51 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 956BE8FC0C; Sun, 28 Oct 2012 18:38:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIcpE8074183; Sun, 28 Oct 2012 18:38:51 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIcpiW074181; Sun, 28 Oct 2012 18:38:51 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281838.q9SIcpiW074181@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 18:38:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242256 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:38:52 -0000 Author: andre Date: Sun Oct 28 18:38:51 2012 New Revision: 242256 URL: http://svn.freebsd.org/changeset/base/242256 Log: Improve m_cat() by being able to also merge contents from M_EXT mbuf's by doing proper testing with M_WRITABLE(). In m_collapse() replace an incomplete manual check for M_RDONLY with the M_WRITABLE() macro that also tests for shared buffers and other cases that make a particular mbuf immutable. MFC after: 2 weeks Modified: head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Sun Oct 28 18:33:52 2012 (r242255) +++ head/sys/kern/uipc_mbuf.c Sun Oct 28 18:38:51 2012 (r242256) @@ -911,8 +911,8 @@ m_cat(struct mbuf *m, struct mbuf *n) while (m->m_next) m = m->m_next; while (n) { - if (m->m_flags & M_EXT || - m->m_data + m->m_len + n->m_len >= &m->m_dat[MLEN]) { + if (!M_WRITABLE(m) || + M_TRAILINGSPACE(m) < n->m_len) { /* just join the two chains */ m->m_next = n; return; @@ -1584,7 +1584,7 @@ again: n = m->m_next; if (n == NULL) break; - if ((m->m_flags & M_RDONLY) == 0 && + if (M_WRITABLE(m) && n->m_len < M_TRAILINGSPACE(m)) { bcopy(mtod(n, void *), mtod(m, char *) + m->m_len, n->m_len); From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:45:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0F886A6; Sun, 28 Oct 2012 18:45:04 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 884188FC08; Sun, 28 Oct 2012 18:45:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIj4FO075335; Sun, 28 Oct 2012 18:45:04 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIj49Q075333; Sun, 28 Oct 2012 18:45:04 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281845.q9SIj49Q075333@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 18:45:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242257 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:45:04 -0000 Author: andre Date: Sun Oct 28 18:45:04 2012 New Revision: 242257 URL: http://svn.freebsd.org/changeset/base/242257 Log: Remove bogus 'else' in #ifdef that prevented the rttvar from being reset tcp_timer_rexmt() on retransmit for IPv6 sessions. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 18:38:51 2012 (r242256) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 18:45:04 2012 (r242257) @@ -596,7 +596,6 @@ tcp_timer_rexmt(void * xtp) #ifdef INET6 if ((tp->t_inpcb->inp_vflag & INP_IPV6) != 0) in6_losing(tp->t_inpcb); - else #endif tp->t_rttvar += (tp->t_srtt >> TCP_RTT_SHIFT); tp->t_srtt = 0; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:46:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EE5DF81A; Sun, 28 Oct 2012 18:46: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 C62E98FC08; Sun, 28 Oct 2012 18:46:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIk6sl075526; Sun, 28 Oct 2012 18:46:06 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIk6iM075524; Sun, 28 Oct 2012 18:46:06 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210281846.q9SIk6iM075524@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Oct 2012 18:46:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242258 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:46:07 -0000 Author: adrian Date: Sun Oct 28 18:46:06 2012 New Revision: 242258 URL: http://svn.freebsd.org/changeset/base/242258 Log: Add a temporary (for values of "temporary") work around for hotplug support with ath(4) and VIMAGE. Right now the VIMAGE code doesn't supply a default vnet context during: * hotplug attach; * any device detach. It special cases kldload/boot time probing (by setting the context to vnet0) but that doesn't occur when probing devices during a bus rescan - eg, adding a cardbus card. These will eventually go away when the VIMAGE support extends to providing default contexts to hotplug attach/detach. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Oct 28 18:45:04 2012 (r242257) +++ head/sys/dev/ath/if_ath.c Sun Oct 28 18:46:06 2012 (r242258) @@ -281,6 +281,7 @@ ath_attach(u_int16_t devid, struct ath_s DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); + CURVNET_SET(vnet0); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); if (ifp == NULL) { device_printf(sc->sc_dev, "can not if_alloc()\n"); @@ -292,6 +293,7 @@ ath_attach(u_int16_t devid, struct ath_s /* set these up early for if_printf use */ if_initname(ifp, device_get_name(sc->sc_dev), device_get_unit(sc->sc_dev)); + CURVNET_RESTORE(); ah = ath_hal_attach(devid, sc, sc->sc_st, sc->sc_sh, sc->sc_eepromdata, &status); @@ -887,8 +889,11 @@ bad2: bad: if (ah) ath_hal_detach(ah); - if (ifp != NULL) + if (ifp != NULL) { + CURVNET_SET(ifp->if_vnet); if_free(ifp); + CURVNET_RESTORE(); + } sc->sc_invalid = 1; return error; } @@ -930,7 +935,10 @@ ath_detach(struct ath_softc *sc) ath_rxdma_teardown(sc); ath_tx_cleanup(sc); ath_hal_detach(sc->sc_ah); /* NB: sets chip in full sleep */ + + CURVNET_SET(ifp->if_vnet); if_free(ifp); + CURVNET_RESTORE(); return 0; } From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:53:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5089C9E; Sun, 28 Oct 2012 18:53:28 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BBFF78FC08; Sun, 28 Oct 2012 18:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIrSN5076698; Sun, 28 Oct 2012 18:53:28 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIrSYs076693; Sun, 28 Oct 2012 18:53:28 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210281853.q9SIrSYs076693@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Oct 2012 18:53:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242259 - in head/sys: sys ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:53:28 -0000 Author: trasz Date: Sun Oct 28 18:53:28 2012 New Revision: 242259 URL: http://svn.freebsd.org/changeset/base/242259 Log: Fix two problems that caused instant panic when the device mounted with softupdates went away. Note that this does not fix the problem entirely; I'm committing it now to make it easier for someone to pick up the work. Reviewed by: mckusick Modified: head/sys/sys/buf.h head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/sys/buf.h ============================================================================== --- head/sys/sys/buf.h Sun Oct 28 18:46:06 2012 (r242258) +++ head/sys/sys/buf.h Sun Oct 28 18:53:28 2012 (r242259) @@ -427,7 +427,6 @@ buf_deallocate(struct buf *bp) { if (bioops.io_deallocate) (*bioops.io_deallocate)(bp); - BUF_LOCKFREE(bp); } static __inline int Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Sun Oct 28 18:46:06 2012 (r242258) +++ head/sys/ufs/ffs/ffs_softdep.c Sun Oct 28 18:53:28 2012 (r242259) @@ -13342,8 +13342,13 @@ softdep_deallocate_dependencies(bp) if ((bp->b_ioflags & BIO_ERROR) == 0) panic("softdep_deallocate_dependencies: dangling deps"); - softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, bp->b_error); - panic("softdep_deallocate_dependencies: unrecovered I/O error"); + if (bp->b_vp != NULL && bp->b_vp->v_mount != NULL) + softdep_error(bp->b_vp->v_mount->mnt_stat.f_mntonname, bp->b_error); + else + printf("softdep_deallocate_dependencies: " + "got error %d while accessing filesystem\n", bp->b_error); + if (bp->b_error != ENXIO) + panic("softdep_deallocate_dependencies: unrecovered I/O error"); } /* From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 18:56:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id ECC45E3B; Sun, 28 Oct 2012 18:56:57 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D2DB48FC16; Sun, 28 Oct 2012 18:56:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SIuvPr077308; Sun, 28 Oct 2012 18:56:57 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SIuvbU077306; Sun, 28 Oct 2012 18:56:57 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281856.q9SIuvbU077306@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 18:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242260 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 18:56:58 -0000 Author: andre Date: Sun Oct 28 18:56:57 2012 New Revision: 242260 URL: http://svn.freebsd.org/changeset/base/242260 Log: When retransmitting SYN in TCPS_SYN_SENT state use TCPTV_RTOBASE, the default retransmit timeout, as base to calculate the backoff time until next try instead of the TCP_REXMTVAL() macro which only works correctly when we already have measured an actual RTT+RTTVAR. Before it would cause the first retransmit at RTOBASE, the next four at the same time (!) about 200ms later, and then another one again RTOBASE later. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 18:53:28 2012 (r242259) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 18:56:57 2012 (r242260) @@ -572,7 +572,7 @@ tcp_timer_rexmt(void * xtp) tp->t_flags &= ~TF_PREVVALID; TCPSTAT_INC(tcps_rexmttimeo); if (tp->t_state == TCPS_SYN_SENT) - rexmt = TCP_REXMTVAL(tp) * tcp_syn_backoff[tp->t_rxtshift]; + rexmt = TCPTV_RTOBASE * tcp_syn_backoff[tp->t_rxtshift]; else rexmt = TCP_REXMTVAL(tp) * tcp_backoff[tp->t_rxtshift]; TCPT_RANGESET(tp->t_rxtcur, rexmt, From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:02:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A3B2CB; Sun, 28 Oct 2012 19:02:08 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 19FD18FC0C; Sun, 28 Oct 2012 19:02:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJ272I078240; Sun, 28 Oct 2012 19:02:07 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJ272D078237; Sun, 28 Oct 2012 19:02:07 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281902.q9SJ272D078237@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:02:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242261 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:02:08 -0000 Author: andre Date: Sun Oct 28 19:02:07 2012 New Revision: 242261 URL: http://svn.freebsd.org/changeset/base/242261 Log: For retransmits of SYN|ACK from the syncache use the slightly more aggressive special tcp_syn_backoff[] retransmit schedule instead of the normal tcp_backoff[] schedule for established connections. MFC after: 2 weeks Modified: head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Oct 28 18:56:57 2012 (r242260) +++ head/sys/netinet/tcp_syncache.c Sun Oct 28 19:02:07 2012 (r242261) @@ -391,7 +391,7 @@ static void syncache_timeout(struct syncache *sc, struct syncache_head *sch, int docallout) { sc->sc_rxttime = ticks + - TCPTV_RTOBASE * (tcp_backoff[sc->sc_rxmits]); + TCPTV_RTOBASE * (tcp_syn_backoff[sc->sc_rxmits]); sc->sc_rxmits++; if (TSTMP_LT(sc->sc_rxttime, sch->sch_nextc)) { sch->sch_nextc = sc->sc_rxttime; Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Sun Oct 28 18:56:57 2012 (r242260) +++ head/sys/netinet/tcp_timer.h Sun Oct 28 19:02:07 2012 (r242261) @@ -170,6 +170,7 @@ extern int tcp_rexmit_slop; extern int tcp_msl; extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; +extern int tcp_syn_backoff[]; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:16:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 810A6601; Sun, 28 Oct 2012 19:16:23 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 59D108FC14; Sun, 28 Oct 2012 19:16:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJGNQ7080552; Sun, 28 Oct 2012 19:16:23 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJGNwb080550; Sun, 28 Oct 2012 19:16:23 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281916.q9SJGNwb080550@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:16:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242262 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:16:23 -0000 Author: andre Date: Sun Oct 28 19:16:22 2012 New Revision: 242262 URL: http://svn.freebsd.org/changeset/base/242262 Log: Simplify and enhance the window change/update acceptance logic, especially in the presence of bi-directional data transfers. snd_wl1 tracks the right edge, including data in the reassembly queue, of valid incoming data. This makes it like rcv_nxt plus reassembly. It never goes backwards to prevent older, possibly reordered segments from updating the window. snd_wl2 tracks the left edge of sent data. This makes it a duplicate of snd_una. However joining them right now is difficult due to separate update dependencies in different places in the code flow. snd_wnd tracks the current advertized send window by the peer. In tcp_output() the effective window is calculated by subtracting the already in-flight data, snd_nxt less snd_una, from it. ACK's become the main clock of window updates and will always update the window when the left edge of what we sent is advanced. The ACK clock is the primary signaling mechanism in ongoing data transfers. This works reliably even in the presence of reordering, reassembly and retransmitted segments. The ACK clock is most important because it determines how much data we are allowed to inject into the network. Zero window updates get us out of persistence mode are crucial. Here a segment that neither moves ACK nor SEQ but enlarges WND is accepted. When the ACK clock is not active (that is we're not or no longer sending any data) any segment that moves the extended right SEQ edge, including out-of-order segments, updates the window. This gives us updates especially during ping-pong transfers where the peer isn't done consuming the already acknowledged data from the receive buffer while responding with data. The SSH protocol is a prime candidate to benefit from the improved bi-directional window update logic as it has its own windowing mechanism on top of TCP and is frequently sending back protocol ACK's. Tcpdump provided by: darrenr Tested by: darrenr MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Oct 28 19:02:07 2012 (r242261) +++ head/sys/netinet/tcp_input.c Sun Oct 28 19:16:22 2012 (r242262) @@ -1714,7 +1714,7 @@ tcp_do_segment(struct mbuf *m, struct tc * Pull snd_wl1 up to prevent seq wrap relative to * th_seq. */ - tp->snd_wl1 = th->th_seq; + tp->snd_wl1 = th->th_seq + tlen; /* * Pull rcv_up up to prevent seq wrap relative to * rcv_nxt. @@ -2327,7 +2327,6 @@ tcp_do_segment(struct mbuf *m, struct tc if (tlen == 0 && (thflags & TH_FIN) == 0) (void) tcp_reass(tp, (struct tcphdr *)0, 0, (struct mbuf *)0); - tp->snd_wl1 = th->th_seq - 1; /* FALLTHROUGH */ /* @@ -2638,12 +2637,10 @@ process_ACK: SOCKBUF_LOCK(&so->so_snd); if (acked > so->so_snd.sb_cc) { - tp->snd_wnd -= so->so_snd.sb_cc; sbdrop_locked(&so->so_snd, (int)so->so_snd.sb_cc); ourfinisacked = 1; } else { sbdrop_locked(&so->so_snd, acked); - tp->snd_wnd -= acked; ourfinisacked = 0; } /* NB: sowwakeup_locked() does an implicit unlock. */ @@ -2733,24 +2730,56 @@ step6: INP_WLOCK_ASSERT(tp->t_inpcb); /* - * Update window information. - * Don't look at window if no ACK: TAC's send garbage on first SYN. + * Window update acceptance logic. We have to be careful not + * to accept window updates from old segments in the presence + * of reordering or duplication. + * + * A window update is valid when: + * - the segment ACK's new data. + * - the segment carries new data and its ACK is current. + * - the segment matches the current SEQ and ACK but increases + * the window. This is the escape from persist mode, if there + * data to be sent. + * + * XXXAO: The presence of new SACK information would allow to + * accept window updates during retransmits. We don't have an + * easy way to test for that the moment. + * + * NB: The other side isn't allowed to shrink the window when + * not sending or acking new data. This behavior is strongly + * discouraged by RFC793, section 3.7, page 42 anyways. + * + * XXXAO: tiwin >= minmss to avoid jitter? */ - if ((thflags & TH_ACK) && - (SEQ_LT(tp->snd_wl1, th->th_seq) || - (tp->snd_wl1 == th->th_seq && (SEQ_LT(tp->snd_wl2, th->th_ack) || - (tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd))))) { - /* keep track of pure window updates */ - if (tlen == 0 && - tp->snd_wl2 == th->th_ack && tiwin > tp->snd_wnd) + if ((thflags & TH_ACK) && tiwin != tp->snd_wnd && + (SEQ_GT(th->th_ack, tp->snd_wl2) || + (th->th_ack == tp->snd_wl2 && + (SEQ_GT(th->th_seq + tlen, tp->snd_wl1) || + (th->th_seq == tp->snd_wl1 && tlen == 0 && tiwin > tp->snd_wnd))))) { +#if 0 + char *s; + if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { + log(LOG_DEBUG, "%s; %s: window update %lu -> %lu\n", + s, __func__, tp->snd_wnd, tiwin); + free(s, M_TCPLOG); + } +#endif + /* Keep track of pure window updates. */ + if (th->th_seq == tp->snd_wl1 && tlen == 0 && + tiwin > tp->snd_wnd) TCPSTAT_INC(tcps_rcvwinupd); + /* + * When the new window is larger, nudge output + * as we may be able to send more data. + */ + if (tiwin > tp->snd_wnd) + needoutput = 1; tp->snd_wnd = tiwin; - tp->snd_wl1 = th->th_seq; - tp->snd_wl2 = th->th_ack; if (tp->snd_wnd > tp->max_sndwnd) tp->max_sndwnd = tp->snd_wnd; - needoutput = 1; } + if (SEQ_GT(th->th_ack, tp->snd_wl2)) + tp->snd_wl2 = th->th_ack; /* * Process segments with URG. @@ -2870,6 +2899,8 @@ dodata: /* XXX */ thflags = tcp_reass(tp, th, &tlen, m); tp->t_flags |= TF_ACKNOW; } + if (SEQ_GT(th->th_seq, tp->snd_wl1)) + tp->snd_wl1 = th->th_seq + tlen; if (tlen > 0 && (tp->t_flags & TF_SACK_PERMIT)) tcp_update_sack_list(tp, save_start, save_start + tlen); #if 0 From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:20:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B845786B; Sun, 28 Oct 2012 19:20:23 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0F598FC18; Sun, 28 Oct 2012 19:20:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJKNxu081244; Sun, 28 Oct 2012 19:20:23 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJKNS0081242; Sun, 28 Oct 2012 19:20:23 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281920.q9SJKNS0081242@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:20:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242263 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:20:23 -0000 Author: andre Date: Sun Oct 28 19:20:23 2012 New Revision: 242263 URL: http://svn.freebsd.org/changeset/base/242263 Log: Add SACK_PERMIT to the list of TCP options that are switched off after retransmitting a SYN three times. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 19:16:22 2012 (r242262) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 19:20:23 2012 (r242263) @@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp) * unknown-to-them TCP options. */ if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) - tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP); + tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); /* * If we backed off this far, our srtt estimate is probably bogus. * Clobber it so we'll take the next rtt measurement as our srtt; From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:22:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B0540AED; Sun, 28 Oct 2012 19:22:18 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9758F8FC08; Sun, 28 Oct 2012 19:22:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJMIGh081602; Sun, 28 Oct 2012 19:22:18 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJMI2N081600; Sun, 28 Oct 2012 19:22:18 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281922.q9SJMI2N081600@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:22:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242264 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:22:18 -0000 Author: andre Date: Sun Oct 28 19:22:18 2012 New Revision: 242264 URL: http://svn.freebsd.org/changeset/base/242264 Log: Update comment to reflect the change made in r242263. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 19:20:23 2012 (r242263) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 19:22:18 2012 (r242264) @@ -578,7 +578,7 @@ tcp_timer_rexmt(void * xtp) TCPT_RANGESET(tp->t_rxtcur, rexmt, tp->t_rttmin, TCPTV_REXMTMAX); /* - * Disable rfc1323 if we haven't got any response to + * Disable RFC1323 and SACK 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-head@FreeBSD.ORG Sun Oct 28 19:38:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B5FE1F7A; Sun, 28 Oct 2012 19:38:42 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9BA2D8FC0A; Sun, 28 Oct 2012 19:38:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJcg7Z084210; Sun, 28 Oct 2012 19:38:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJcgD6084208; Sun, 28 Oct 2012 19:38:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210281938.q9SJcgD6084208@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Oct 2012 19:38:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242265 - head/sbin/tunefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:38:42 -0000 Author: trasz Date: Sun Oct 28 19:38:42 2012 New Revision: 242265 URL: http://svn.freebsd.org/changeset/base/242265 Log: Declare functions as static and move global variables to the top; no functional changes. Modified: head/sbin/tunefs/tunefs.c Modified: head/sbin/tunefs/tunefs.c ============================================================================== --- head/sbin/tunefs/tunefs.c Sun Oct 28 19:22:18 2012 (r242264) +++ head/sbin/tunefs/tunefs.c Sun Oct 28 19:38:42 2012 (r242265) @@ -70,14 +70,16 @@ __FBSDID("$FreeBSD$"); /* the optimization warning string template */ #define OPTWARN "should optimize for %s with minfree %s %d%%" +static int blocks; +static char clrbuf[MAXBSIZE]; static struct uufsd disk; #define sblock disk.d_fs -void usage(void); -void printfs(void); -int journal_alloc(int64_t size); -void journal_clear(void); -void sbdirty(void); +static void usage(void); +static void printfs(void); +static int journal_alloc(int64_t size); +static void journal_clear(void); +static void sbdirty(void); int main(int argc, char *argv[]) @@ -545,16 +547,13 @@ err: err(12, "%s", special); } -void +static void sbdirty(void) { disk.d_fs.fs_flags |= FS_UNCLEAN | FS_NEEDSFSCK; disk.d_fs.fs_clean = 0; } -static int blocks; -static char clrbuf[MAXBSIZE]; - static ufs2_daddr_t journal_balloc(void) { @@ -880,7 +879,7 @@ indir_fill(ufs2_daddr_t blk, int level, /* * Clear the flag bits so the journal can be removed. */ -void +static void journal_clear(void) { struct ufs1_dinode *dp1; @@ -911,7 +910,7 @@ journal_clear(void) } } -int +static int journal_alloc(int64_t size) { struct ufs1_dinode *dp1; @@ -1060,7 +1059,7 @@ out: return (-1); } -void +static void usage(void) { fprintf(stderr, "%s\n%s\n%s\n%s\n%s\n%s\n", @@ -1073,7 +1072,7 @@ usage(void) exit(2); } -void +static void printfs(void) { warnx("POSIX.1e ACLs: (-a) %s", From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:47:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 13E65374; Sun, 28 Oct 2012 19:47:47 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EF13C8FC12; Sun, 28 Oct 2012 19:47:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJlkPN085770; Sun, 28 Oct 2012 19:47:46 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJlku2085767; Sun, 28 Oct 2012 19:47:46 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281947.q9SJlku2085767@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:47:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242266 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:47:47 -0000 Author: andre Date: Sun Oct 28 19:47:46 2012 New Revision: 242266 URL: http://svn.freebsd.org/changeset/base/242266 Log: Increase the initial CWND to 10 segments as defined in IETF TCPM draft-ietf-tcpm-initcwnd-05. It explains why the increased initial window improves the overall performance of many web services without risking congestion collapse. As long as it remains a draft it is placed under a sysctl marking it as experimental: net.inet.tcp.experimental.initcwnd10 = 1 When it becomes an official RFC soon the sysctl will be changed to the RFC number and moved to net.inet.tcp. This implementation differs from the RFC draft in that it is a bit more conservative in the case of packet loss on SYN or SYN|ACK because we haven't reduced the default RTO to 1 second yet. Also the restart window isn't yet increased as allowed. Both will be adjusted with upcoming changes. Is is enabled by default. In Linux it is enabled since kernel 3.0. MFC after: 2 weeks Modified: head/sys/netinet/tcp_input.c head/sys/netinet/tcp_var.h Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Oct 28 19:38:42 2012 (r242265) +++ head/sys/netinet/tcp_input.c Sun Oct 28 19:47:46 2012 (r242266) @@ -159,6 +159,14 @@ SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, &VNET_NAME(tcp_do_rfc3390), 0, "Enable RFC 3390 (Increasing TCP's Initial Congestion Window)"); +SYSCTL_NODE(_net_inet_tcp, OID_AUTO, experimental, CTLFLAG_RW, 0, + "Experimental TCP extensions"); + +VNET_DEFINE(int, tcp_do_initcwnd10) = 1; +SYSCTL_VNET_INT(_net_inet_tcp_experimental, OID_AUTO, initcwnd10, CTLFLAG_RW, + &VNET_NAME(tcp_do_initcwnd10), 0, + "Enable draft-ietf-tcpm-initcwnd-05 (Increasing initial CWND to 10)"); + VNET_DEFINE(int, tcp_do_rfc3465) = 1; SYSCTL_VNET_INT(_net_inet_tcp, OID_AUTO, rfc3465, CTLFLAG_RW, &VNET_NAME(tcp_do_rfc3465), 0, @@ -347,6 +355,7 @@ cc_conn_init(struct tcpcb *tp) * * RFC5681 Section 3.1 specifies the default conservative values. * RFC3390 specifies slightly more aggressive values. + * Draft-ietf-tcpm-initcwnd-05 increases it to ten segments. * * If a SYN or SYN/ACK was lost and retransmitted, we have to * reduce the initial CWND to one segment as congestion is likely @@ -354,6 +363,9 @@ cc_conn_init(struct tcpcb *tp) */ if (tp->snd_cwnd == 1) tp->snd_cwnd = tp->t_maxseg; /* SYN(-ACK) lost */ + else if (V_tcp_do_initcwnd10) + tp->snd_cwnd = min(10 * tp->t_maxseg, + max(2 * tp->t_maxseg, 14600)); else if (V_tcp_do_rfc3390) tp->snd_cwnd = min(4 * tp->t_maxseg, max(2 * tp->t_maxseg, 4380)); Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Oct 28 19:38:42 2012 (r242265) +++ head/sys/netinet/tcp_var.h Sun Oct 28 19:47:46 2012 (r242266) @@ -611,6 +611,7 @@ VNET_DECLARE(int, tcp_mssdflt); /* XXX * VNET_DECLARE(int, tcp_minmss); VNET_DECLARE(int, tcp_delack_enabled); VNET_DECLARE(int, tcp_do_rfc3390); +VNET_DECLARE(int, tcp_do_initcwnd10); VNET_DECLARE(int, tcp_sendspace); VNET_DECLARE(int, tcp_recvspace); VNET_DECLARE(int, path_mtu_discovery); @@ -623,6 +624,7 @@ VNET_DECLARE(int, tcp_abc_l_var); #define V_tcp_minmss VNET(tcp_minmss) #define V_tcp_delack_enabled VNET(tcp_delack_enabled) #define V_tcp_do_rfc3390 VNET(tcp_do_rfc3390) +#define V_tcp_do_initcwnd10 VNET(tcp_do_initcwnd10) #define V_tcp_sendspace VNET(tcp_sendspace) #define V_tcp_recvspace VNET(tcp_recvspace) #define V_path_mtu_discovery VNET(path_mtu_discovery) From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 19:58:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 78E33B7E; Sun, 28 Oct 2012 19:58:21 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60A718FC08; Sun, 28 Oct 2012 19:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SJwLTM087788; Sun, 28 Oct 2012 19:58:21 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SJwLV3087786; Sun, 28 Oct 2012 19:58:21 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210281958.q9SJwLV3087786@svn.freebsd.org> From: Andre Oppermann Date: Sun, 28 Oct 2012 19:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242267 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 19:58:21 -0000 Author: andre Date: Sun Oct 28 19:58:20 2012 New Revision: 242267 URL: http://svn.freebsd.org/changeset/base/242267 Log: If the user has closed the socket then drop a persisting connection after a much reduced timeout. Typically web servers close their sockets quickly under the assumption that the TCP connections goes away as well. That is not entirely true however. If the peer closed the window we're going to wait for a long time with lots of data in the send buffer. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.c Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Oct 28 19:47:46 2012 (r242266) +++ head/sys/netinet/tcp_timer.c Sun Oct 28 19:58:20 2012 (r242267) @@ -447,6 +447,16 @@ tcp_timer_persist(void *xtp) tp = tcp_drop(tp, ETIMEDOUT); goto out; } + /* + * If the user has closed the socket then drop a persisting + * connection after a much reduced timeout. + */ + if (tp->t_state > TCPS_CLOSE_WAIT && + (ticks - tp->t_rcvtime) >= TCPTV_PERSMAX) { + TCPSTAT_INC(tcps_persistdrop); + tp = tcp_drop(tp, ETIMEDOUT); + goto out; + } tcp_setpersist(tp); tp->t_flags |= TF_FORCEDATA; (void) tcp_output(tp); From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 20:03:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E0E6F20A; Sun, 28 Oct 2012 20:03:57 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C839F8FC17; Sun, 28 Oct 2012 20:03:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SK3vmx088918; Sun, 28 Oct 2012 20:03:57 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SK3vVl088916; Sun, 28 Oct 2012 20:03:57 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210282003.q9SK3vVl088916@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Oct 2012 20:03:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242268 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 20:03:58 -0000 Author: trasz Date: Sun Oct 28 20:03:57 2012 New Revision: 242268 URL: http://svn.freebsd.org/changeset/base/242268 Log: Remove useless check; vm_pindex_t is unsigned on all architectures. CID: 3701 Found with: Coverity Prevent Modified: head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Sun Oct 28 19:58:20 2012 (r242267) +++ head/sys/vm/vm_pageout.c Sun Oct 28 20:03:57 2012 (r242268) @@ -1895,7 +1895,7 @@ again: continue; size = vmspace_resident_count(vm); - if (limit >= 0 && size >= limit) { + if (size >= limit) { vm_pageout_map_deactivate_pages( &vm->vm_map, limit); } From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 20:07:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9ED64E2; Sun, 28 Oct 2012 20:07:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 3305E8FC08; Sun, 28 Oct 2012 20:07:02 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9SK71Nw024342; Mon, 29 Oct 2012 00:07:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9SK71Js024341; Mon, 29 Oct 2012 00:07:01 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Oct 2012 00:07:00 +0400 From: Gleb Smirnoff To: Andre Oppermann Subject: Re: svn commit: r242254 - head/sys/netinet Message-ID: <20121028200700.GL70741@FreeBSD.org> References: <201210281807.q9SI7Yxa069395@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210281807.q9SI7Yxa069395@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 20:07:03 -0000 On Sun, Oct 28, 2012 at 06:07:34PM +0000, Andre Oppermann wrote: A> @@ -296,8 +297,8 @@ syncache_destroy(void) A> mtx_destroy(&sch->sch_mtx); A> } A> A> - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", A> - __func__, V_tcp_syncache.cache_count)); A> + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0, A> + ("%s: cache_count not 0", __func__)); A> A> /* Free the allocated global resources. */ A> uma_zdestroy(V_tcp_syncache.zone); btw, keg_dtor() which is called in uma_zdestroy() printfs a warning (even on non-invariant kernel) if keg had items in it. So leak won't be unnoticed. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:01:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28A86700; Sun, 28 Oct 2012 21:01:33 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FA558FC19; Sun, 28 Oct 2012 21:01:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SL1Wx2098251; Sun, 28 Oct 2012 21:01:32 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SL1WXa098249; Sun, 28 Oct 2012 21:01:32 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210282101.q9SL1WXa098249@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 28 Oct 2012 21:01:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242270 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:01:33 -0000 Author: trasz Date: Sun Oct 28 21:01:32 2012 New Revision: 242270 URL: http://svn.freebsd.org/changeset/base/242270 Log: Make it clear that NULL can only be returned when M_NOWAIT was used. Modified: head/share/man/man9/zone.9 Modified: head/share/man/man9/zone.9 ============================================================================== --- head/share/man/man9/zone.9 Sun Oct 28 20:14:21 2012 (r242269) +++ head/share/man/man9/zone.9 Sun Oct 28 21:01:32 2012 (r242270) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 25, 2012 +.Dd October 28, 2012 .Dt ZONE 9 .Os .Sh NAME @@ -145,7 +145,7 @@ or .Dv NULL in the rare case where all items in the zone are in use and the allocator is unable to grow the zone -or when +and .Dv M_NOWAIT is specified. .Pp @@ -218,8 +218,10 @@ The .Fn uma_zalloc function returns a pointer to an item, or .Dv NULL -if the zone ran out of unused items and the allocator was unable to -enlarge it. +if the zone ran out of unused items +and +.Dv M_NOWAIT +was specified. .Sh SEE ALSO .Xr malloc 9 .Sh HISTORY From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:03:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4909883; Sun, 28 Oct 2012 21:03:12 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id A068C8FC08; Sun, 28 Oct 2012 21:03:12 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb] (unknown [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 2E92E3982B; Sun, 28 Oct 2012 14:03:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351458192; bh=URM/acX16cZwBkt6t1nHy3LiOxz1X5pVaXfJNOMFTiQ=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=DxkdXhEFMuRDWkNyudg6x2yvOn+cWZlEy0U+6WIzo2mzo0gVRBAgihThiMpGXgSAG VlJAqbN9jZvaO0QvEF9rSyicfVuf5ksd0SDqpSLDSe8+MzqiG83C630IOx0Ru67ZGe a5f8+VOymN8LDcxSDKpL6kmSGCWSXMCYxY+apaSg= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r242266 - head/sys/netinet From: Rui Paulo In-Reply-To: <201210281947.q9SJlku2085767@svn.freebsd.org> Date: Sun, 28 Oct 2012 14:03:08 -0700 Content-Transfer-Encoding: 7bit Message-Id: <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> References: <201210281947.q9SJlku2085767@svn.freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:03:12 -0000 On 28 Oct 2012, at 12:47, Andre Oppermann wrote: > Author: andre > Date: Sun Oct 28 19:47:46 2012 > New Revision: 242266 > URL: http://svn.freebsd.org/changeset/base/242266 > > Log: > Increase the initial CWND to 10 segments as defined in IETF TCPM > draft-ietf-tcpm-initcwnd-05. It explains why the increased initial > window improves the overall performance of many web services without > risking congestion collapse. > > As long as it remains a draft it is placed under a sysctl marking it > as experimental: > net.inet.tcp.experimental.initcwnd10 = 1 > When it becomes an official RFC soon the sysctl will be changed to > the RFC number and moved to net.inet.tcp. > > This implementation differs from the RFC draft in that it is a bit > more conservative in the case of packet loss on SYN or SYN|ACK because > we haven't reduced the default RTO to 1 second yet. Also the restart > window isn't yet increased as allowed. Both will be adjusted with > upcoming changes. > > Is is enabled by default. In Linux it is enabled since kernel 3.0. Didn't you also forget to point out the problems associated with it? http://tools.ietf.org/html/draft-gettys-iw10-considered-harmful-00 Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:03:40 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B34F0A07 for ; Sun, 28 Oct 2012 21:03:40 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 1D60A8FC17 for ; Sun, 28 Oct 2012 21:03:39 +0000 (UTC) Received: (qmail 92770 invoked from network); 28 Oct 2012 22:40:36 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 22:40:36 -0000 Message-ID: <508D9DA4.2000401@freebsd.org> Date: Sun, 28 Oct 2012 22:03:32 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r242254 - head/sys/netinet References: <201210281807.q9SI7Yxa069395@svn.freebsd.org> <20121028200700.GL70741@FreeBSD.org> In-Reply-To: <20121028200700.GL70741@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:03:40 -0000 On 28.10.2012 21:07, Gleb Smirnoff wrote: > On Sun, Oct 28, 2012 at 06:07:34PM +0000, Andre Oppermann wrote: > A> @@ -296,8 +297,8 @@ syncache_destroy(void) > A> mtx_destroy(&sch->sch_mtx); > A> } > A> > A> - KASSERT(V_tcp_syncache.cache_count == 0, ("%s: cache_count %d not 0", > A> - __func__, V_tcp_syncache.cache_count)); > A> + KASSERT(uma_zone_get_cur(V_tcp_syncache.zone) == 0, > A> + ("%s: cache_count not 0", __func__)); > A> > A> /* Free the allocated global resources. */ > A> uma_zdestroy(V_tcp_syncache.zone); > > btw, keg_dtor() which is called in uma_zdestroy() printfs a warning > (even on non-invariant kernel) if keg had items in it. So leak won't > be unnoticed. Thanks, didn't know that. I leave the KASSERT() in if you don't mind to make it a bit more forceful than a printf that gets overlooked too easily. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:04:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52531B7A for ; Sun, 28 Oct 2012 21:04:24 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id A2ECC8FC14 for ; Sun, 28 Oct 2012 21:04:23 +0000 (UTC) Received: (qmail 92784 invoked from network); 28 Oct 2012 22:41:25 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 22:41:25 -0000 Message-ID: <508D9DD5.2080800@freebsd.org> Date: Sun, 28 Oct 2012 22:04:21 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> In-Reply-To: <20121027220137.GJ70741@FreeBSD.org> Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:04:24 -0000 On 28.10.2012 00:01, Gleb Smirnoff wrote: > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: > A> > Author: glebius > A> > Date: Fri Oct 26 21:06:33 2012 > A> > New Revision: 242161 > A> > URL: http://svn.freebsd.org/changeset/base/242161 > A> > > A> > Log: > A> > o Remove last argument to ip_fragment(), and obtain all needed information > A> > on checksums directly from mbuf flags. This simplifies code. > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in > A> > hardware. Some driver may not announce CSUM_IP in theur if_hwassist, > A> > although try to do checksums if CSUM_IP set on mbuf. Example is em(4). > A> > A> I'm not getting your description here? Why work around a bug in a driver > A> in ip_fragment() when we can fix the bug in the driver? > > Well, that was actually bug in the stack and a very special driver that > demonstrates it. I may even agree that driver is incorrect, but the stack was > incorrect, too. Ah, OK. Do you intend to fix the driver as well? -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:13:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B554DEDC; Sun, 28 Oct 2012 21:13: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 8FF908FC14; Sun, 28 Oct 2012 21:13:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9SLDCJD000161; Sun, 28 Oct 2012 21:13:12 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9SLDCLS000155; Sun, 28 Oct 2012 21:13:12 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210282113.q9SLDCLS000155@svn.freebsd.org> From: Adrian Chadd Date: Sun, 28 Oct 2012 21:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242271 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:13:12 -0000 Author: adrian Date: Sun Oct 28 21:13:12 2012 New Revision: 242271 URL: http://svn.freebsd.org/changeset/base/242271 Log: Begin fleshing out some software queue awareness for TIM handling with the power save queue. * introduce some new ATH_NODE lock protected fields, tracking the net80211 psq and TIM state; * when doing buffer transitions - ie, when sending and completing buffers - check the state of the SWQ and update the TIM appropriately. * when clearing the TIM bit, if the SWQ is not empty then delay clearing it. This is racy, but it's no less racy than the current net80211 power save queue management code. Specifically, with multiple TX threads, it's quite plausible that parallel state updates will race and the TIM will be left in an inconsistent state. I'll address that in a follow-up commit. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_ath_tx.h head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sun Oct 28 21:01:32 2012 (r242270) +++ head/sys/dev/ath/if_ath.c Sun Oct 28 21:13:12 2012 (r242271) @@ -201,6 +201,7 @@ static void ath_announce(struct ath_soft static void ath_dfs_tasklet(void *, int); static void ath_node_powersave(struct ieee80211_node *, int); +static int ath_node_set_tim(struct ieee80211_node *, int); #ifdef IEEE80211_SUPPORT_TDMA #include @@ -1152,6 +1153,9 @@ ath_vap_create(struct ieee80211com *ic, avp->av_node_ps = vap->iv_node_ps; vap->iv_node_ps = ath_node_powersave; + avp->av_set_tim = vap->iv_set_tim; + vap->iv_set_tim = ath_node_set_tim; + /* Set default parameters */ /* @@ -2558,6 +2562,12 @@ ath_start(struct ifnet *ifp) ieee80211_free_node(ni); continue; } + + /* + * Check here if the node is in power save state. + */ + ath_tx_update_tim(sc, ni, 1); + if (next != NULL) { /* * Beware of state changing between frags. @@ -3536,6 +3546,24 @@ ath_tx_default_comp(struct ath_softc *sc SEQNO(bf->bf_state.bfs_seqno)); /* + * Check if the node software queue is empty; if so + * then clear the TIM. + * + * This needs to be done before the buffer is freed as + * otherwise the node reference will have been released + * and the node may not actually exist any longer. + * + * XXX I don't like this belonging here, but it's cleaner + * to do it here right now then all the other places + * where ath_tx_default_comp() is called. + * + * XXX TODO: during drain, ensure that the callback is + * being called so we get a chance to update the TIM. + */ + if (bf->bf_node) + ath_tx_update_tim(sc, bf->bf_node, 0); + + /* * Do any tx complete callback. Note this must * be done before releasing the node reference. * This will free the mbuf, release the net80211 @@ -3559,6 +3587,7 @@ ath_tx_update_ratectrl(struct ath_softc return; an = ATH_NODE(ni); + ATH_NODE_UNLOCK_ASSERT(an); if ((ts->ts_status & HAL_TXERR_FILT) == 0) { ATH_NODE_LOCK(an); @@ -3754,6 +3783,8 @@ ath_tx_processq(struct ath_softc *sc, st * Update statistics and call completion */ ath_tx_process_buf_completion(sc, txq, ts, bf); + + /* XXX at this point, bf and ni may be totally invalid */ } #ifdef IEEE80211_SUPPORT_SUPERG /* @@ -5397,6 +5428,219 @@ ath_node_powersave(struct ieee80211_node avp->av_node_ps(ni, enable); } +/* + * Notification from net80211 that the powersave queue state has + * changed. + * + * Since the software queue also may have some frames: + * + * + if the node software queue has frames and the TID state + * is 0, we set the TIM; + * + if the node and the stack are both empty, we clear the TIM bit. + * + If the stack tries to set the bit, always set it. + * + If the stack tries to clear the bit, only clear it if the + * software queue in question is also cleared. + * + * TODO: this is called during node teardown; so let's ensure this + * is all correctly handled and that the TIM bit is cleared. + * It may be that the node flush is called _AFTER_ the net80211 + * stack clears the TIM. + * + * Here is the racy part. Since it's possible >1 concurrent, + * overlapping TXes will appear complete with a TX completion in + * another thread, it's possible that the concurrent TIM calls will + * clash. We can't hold the node lock here because setting the + * TIM grabs the net80211 comlock and this may cause a LOR. + * The solution is either to totally serialise _everything_ at + * this point (ie, all TX, completion and any reset/flush go into + * one taskqueue) or a new "ath TIM lock" needs to be created that + * just wraps the driver state change and this call to avp->av_set_tim(). + * + * The same race exists in the net80211 power save queue handling + * as well. Since multiple transmitting threads may queue frames + * into the driver, as well as ps-poll and the driver transmitting + * frames (and thus clearing the psq), it's quite possible that + * a packet entering the PSQ and a ps-poll being handled will + * race, causing the TIM to be cleared and not re-set. + */ +static int +ath_node_set_tim(struct ieee80211_node *ni, int enable) +{ + struct ieee80211com *ic = ni->ni_ic; + struct ath_softc *sc = ic->ic_ifp->if_softc; + struct ath_node *an = ATH_NODE(ni); + struct ath_vap *avp = ATH_VAP(ni->ni_vap); + int changed = 0; + + ATH_NODE_UNLOCK_ASSERT(an); + + /* + * For now, just track and then update the TIM. + */ + ATH_NODE_LOCK(an); + an->an_stack_psq = enable; + + /* + * This will get called for all operating modes, + * even if avp->av_set_tim is unset. + * It's currently set for hostap/ibss modes; but + * the same infrastructure is used for both STA + * and AP/IBSS node power save. + */ + if (avp->av_set_tim == NULL) { + ATH_NODE_UNLOCK(an); + return (0); + } + + /* + * If setting the bit, always set it here. + * If clearing the bit, only clear it if the + * software queue is also empty. + * + * If the node has left power save, just clear the TIM + * bit regardless of the state of the power save queue. + * + * XXX TODO: although atomics are used, it's quite possible + * that a race will occur between this and setting/clearing + * in another thread. TX completion will occur always in + * one thread, however setting/clearing the TIM bit can come + * from a variety of different process contexts! + */ + if (enable && an->an_tim_set == 1) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, tim_set=1, ignoring\n", + __func__, an, enable); + ATH_NODE_UNLOCK(an); + } else if (enable) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, enabling TIM\n", + __func__, an, enable); + an->an_tim_set = 1; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else if (atomic_load_acq_int(&an->an_swq_depth) == 0) { + /* disable */ + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, an_swq_depth == 0, disabling\n", + __func__, an, enable); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else if (! an->an_is_powersave) { + /* + * disable regardless; the node isn't in powersave now + */ + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, enable=%d, an_pwrsave=0, disabling\n", + __func__, an, enable); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + changed = avp->av_set_tim(ni, enable); + } else { + /* + * psq disable, node is currently in powersave, node + * software queue isn't empty, so don't clear the TIM bit + * for now. + */ + ATH_NODE_UNLOCK(an); + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: enable=%d, an_swq_depth > 0, ignoring\n", + __func__, enable); + changed = 0; + } + + return (changed); +} + +/* + * Set or update the TIM from the software queue. + * + * Check the software queue depth before attempting to do lock + * anything; that avoids trying to obtain the lock. Then, + * re-check afterwards to ensure nothing has changed in the + * meantime. + * + * set: This is designed to be called from the TX path, after + * a frame has been queued; to see if the swq > 0. + * + * clear: This is designed to be called from the buffer completion point + * (right now it's ath_tx_default_comp()) where the state of + * a software queue has changed. + * + * It makes sense to place it at buffer free / completion rather + * than after each software queue operation, as there's no real + * point in churning the TIM bit as the last frames in the software + * queue are transmitted. If they fail and we retry them, we'd + * just be setting the TIM bit again anyway. + */ +void +ath_tx_update_tim(struct ath_softc *sc, struct ieee80211_node *ni, + int enable) +{ + struct ath_node *an; + struct ath_vap *avp; + + /* Don't do this for broadcast/etc frames */ + if (ni == NULL) + return; + + an = ATH_NODE(ni); + avp = ATH_VAP(ni->ni_vap); + + /* + * And for operating modes without the TIM handler set, let's + * just skip those. + */ + if (avp->av_set_tim == NULL) + return; + + ATH_NODE_UNLOCK_ASSERT(an); + + if (enable) { + /* + * Don't bother grabbing the lock unless the queue is not + * empty. + */ + if (atomic_load_acq_int(&an->an_swq_depth) == 0) + return; + + ATH_NODE_LOCK(an); + if (an->an_is_powersave && + an->an_tim_set == 0 && + atomic_load_acq_int(&an->an_swq_depth) != 0) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, swq_depth>0, tim_set=0, set!\n", + __func__, an); + an->an_tim_set = 1; + ATH_NODE_UNLOCK(an); + (void) avp->av_set_tim(ni, 1); + } else { + ATH_NODE_UNLOCK(an); + } + } else { + /* + * Don't bother grabbing the lock unless the queue is empty. + */ + if (atomic_load_acq_int(&an->an_swq_depth) != 0) + return; + + ATH_NODE_LOCK(an); + if (an->an_is_powersave && + an->an_stack_psq == 0 && + an->an_tim_set == 1 && + atomic_load_acq_int(&an->an_swq_depth) == 0) { + DPRINTF(sc, ATH_DEBUG_NODE_PWRSAVE, + "%s: an=%p, swq_depth=0, tim_set=1, psq_set=0," + " clear!\n", + __func__, an); + an->an_tim_set = 0; + ATH_NODE_UNLOCK(an); + (void) avp->av_set_tim(ni, 0); + } else { + ATH_NODE_UNLOCK(an); + } + } +} MODULE_VERSION(if_ath, 1); MODULE_DEPEND(if_ath, wlan, 1, 1, 1); /* 802.11 media layer */ Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Sun Oct 28 21:01:32 2012 (r242270) +++ head/sys/dev/ath/if_ath_misc.h Sun Oct 28 21:13:12 2012 (r242271) @@ -107,6 +107,9 @@ extern void ath_tx_process_buf_completio extern int ath_stoptxdma(struct ath_softc *sc); +extern void ath_tx_update_tim(struct ath_softc *sc, + struct ieee80211_node *ni, int enable); + /* * This is only here so that the RX proc function can call it. * It's very likely that the "start TX after RX" call should be Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Sun Oct 28 21:01:32 2012 (r242270) +++ head/sys/dev/ath/if_ath_tx.c Sun Oct 28 21:13:12 2012 (r242271) @@ -2219,6 +2219,13 @@ ath_raw_xmit(struct ieee80211_node *ni, ifp->if_opackets++; sc->sc_stats.ast_tx_raw++; + /* + * Update the TIM - if there's anything queued to the + * software queue and power save is enabled, we should + * set the TIM. + */ + ath_tx_update_tim(sc, ni, 1); + ATH_PCU_LOCK(sc); sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); @@ -5292,11 +5299,10 @@ ath_addba_response_timeout(struct ieee80 ATH_TXQ_UNLOCK(sc->sc_ac2q[atid->ac]); } -#if 0 /* * Check if a node is asleep or not. */ -static int +int ath_tx_node_is_asleep(struct ath_softc *sc, struct ath_node *an) { @@ -5304,7 +5310,6 @@ ath_tx_node_is_asleep(struct ath_softc * return (an->an_is_powersave); } -#endif /* * Mark a node as currently "in powersaving." Modified: head/sys/dev/ath/if_ath_tx.h ============================================================================== --- head/sys/dev/ath/if_ath_tx.h Sun Oct 28 21:01:32 2012 (r242270) +++ head/sys/dev/ath/if_ath_tx.h Sun Oct 28 21:13:12 2012 (r242271) @@ -128,6 +128,7 @@ extern void ath_addba_response_timeout(s */ extern void ath_tx_node_sleep(struct ath_softc *sc, struct ath_node *an); extern void ath_tx_node_wakeup(struct ath_softc *sc, struct ath_node *an); +extern int ath_tx_node_is_asleep(struct ath_softc *sc, struct ath_node *an); /* * Setup path Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sun Oct 28 21:01:32 2012 (r242270) +++ head/sys/dev/ath/if_athvar.h Sun Oct 28 21:13:12 2012 (r242271) @@ -173,6 +173,8 @@ struct ath_node { u_int8_t an_mgmtrix; /* min h/w rate index */ u_int8_t an_mcastrix; /* mcast h/w rate index */ uint32_t an_is_powersave; /* node is sleeping */ + uint32_t an_stack_psq; /* net80211 psq isn't empty */ + uint32_t an_tim_set; /* TIM has been set */ struct ath_buf *an_ff_buf[WME_NUM_AC]; /* ff staging area */ struct ath_tid an_tid[IEEE80211_TID_SIZE]; /* per-TID state */ char an_name[32]; /* eg "wlan0_a1" */ @@ -432,6 +434,7 @@ struct ath_vap { enum ieee80211_state, int); void (*av_bmiss)(struct ieee80211vap *); void (*av_node_ps)(struct ieee80211_node *, int); + int (*av_set_tim)(struct ieee80211_node *, int); }; #define ATH_VAP(vap) ((struct ath_vap *)(vap)) From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:26:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A29FD743; Sun, 28 Oct 2012 21:26:51 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 7F7D78FC18; Sun, 28 Oct 2012 21:26:51 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb] (unknown [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 13BDF3982B; Sun, 28 Oct 2012 14:26:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351459611; bh=Fr3CXmPq8xZHx1xaf4vlJ4+A0hPVRfBR+HffVlcr+ZA=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=QzMlfYBo4O51kSgvdvku0YONIvsQDqCXxp3ONv5pPS8WLgsdu/iIliT2BBePRtu8U EmgJ1hgbu3H0cq8WkmVDclOZp+Llke69BTyhNl8yfg9l1T51tAzr8eiZlNS4chFLp4 M+DAcVdqb0sen89aBUiSQrQoQ8Ltbbo1u7pJ4/FY= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r242263 - head/sys/netinet From: Rui Paulo In-Reply-To: <201210281920.q9SJKNS0081242@svn.freebsd.org> Date: Sun, 28 Oct 2012 14:26:46 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <0220FA6E-FFCB-4489-BF57-3493C2531DD7@felyko.com> References: <201210281920.q9SJKNS0081242@svn.freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:26:51 -0000 On 28 Oct 2012, at 12:20, Andre Oppermann wrote: > Author: andre > Date: Sun Oct 28 19:20:23 2012 > New Revision: 242263 > URL: http://svn.freebsd.org/changeset/base/242263 >=20 > Log: > Add SACK_PERMIT to the list of TCP options that are switched off = after > retransmitting a SYN three times. >=20 > MFC after: 2 weeks >=20 > Modified: > head/sys/netinet/tcp_timer.c >=20 > Modified: head/sys/netinet/tcp_timer.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- head/sys/netinet/tcp_timer.c Sun Oct 28 19:16:22 2012 = (r242262) > +++ head/sys/netinet/tcp_timer.c Sun Oct 28 19:20:23 2012 = (r242263) > @@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp) > * unknown-to-them TCP options. > */ > if ((tp->t_state =3D=3D TCPS_SYN_SENT) && (tp->t_rxtshift =3D=3D = 3)) > - tp->t_flags &=3D ~(TF_REQ_SCALE|TF_REQ_TSTMP); > + tp->t_flags &=3D = ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); > /* > * If we backed off this far, our srtt estimate is probably = bogus. > * Clobber it so we'll take the next rtt measurement as our = srtt; Do you have any data regarding this commit or you're just trying to make = sure the SACK option follows the same behaviour of the WSCALE/TSTMP = options? Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:33:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D32A4CCF for ; Sun, 28 Oct 2012 21:33:41 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2F4748FC16 for ; Sun, 28 Oct 2012 21:33:40 +0000 (UTC) Received: (qmail 92933 invoked from network); 28 Oct 2012 23:10:42 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 23:10:42 -0000 Message-ID: <508DA4B3.4080002@freebsd.org> Date: Sun, 28 Oct 2012 22:33:39 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r242266 - head/sys/netinet References: <201210281947.q9SJlku2085767@svn.freebsd.org> <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> In-Reply-To: <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:33:41 -0000 On 28.10.2012 22:03, Rui Paulo wrote: > On 28 Oct 2012, at 12:47, Andre Oppermann wrote: > >> Author: andre >> Date: Sun Oct 28 19:47:46 2012 >> New Revision: 242266 >> URL: http://svn.freebsd.org/changeset/base/242266 >> >> Log: >> Increase the initial CWND to 10 segments as defined in IETF TCPM >> draft-ietf-tcpm-initcwnd-05. It explains why the increased initial >> window improves the overall performance of many web services without >> risking congestion collapse. >> >> As long as it remains a draft it is placed under a sysctl marking it >> as experimental: >> net.inet.tcp.experimental.initcwnd10 = 1 >> When it becomes an official RFC soon the sysctl will be changed to >> the RFC number and moved to net.inet.tcp. >> >> This implementation differs from the RFC draft in that it is a bit >> more conservative in the case of packet loss on SYN or SYN|ACK because >> we haven't reduced the default RTO to 1 second yet. Also the restart >> window isn't yet increased as allowed. Both will be adjusted with >> upcoming changes. >> >> Is is enabled by default. In Linux it is enabled since kernel 3.0. > > > Didn't you also forget to point out the problems associated with it? > > http://tools.ietf.org/html/draft-gettys-iw10-considered-harmful-00 IW10 has been heavily discussed on IETF TCPM. A lot of research on the impact has been done and the overall result has been a significant improvement with very little downside. Linux has adopted it for quite some time already as default setting. The bufferbloat issue is certainly real and should not be neglected. However the solution to bufferbloat is not to send less packets into the network. In fact that doesn't even make a difference simply because other packets with take their place. Buffer bloat can only be fixed in the devices that actually do the buffering. A much discussed and apparently good approach seems to be the Codel algorithm for active buffer management. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:34:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D138DFAD; Sun, 28 Oct 2012 21:34:44 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id AE47F8FC14; Sun, 28 Oct 2012 21:34:44 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb] (unknown [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 4C5C83982B; Sun, 28 Oct 2012 14:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351460084; bh=P08BNdh8B5Ssf5nudRluVjJPFxskKk+AikH5+Z5bSH8=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=FVd8ZnW2B5pw/WbC+hfgB7rX5kBn7IPNZBr0Fo5IqPh6gZ2omX1dbIa4oFD81ugjJ 4iyyo5aA6+9DLDDSdyrxSLAUgRq0jdND59ENNj7gDqyhr3bKFFN1/o567E0PomzvyL YEhvYt9rdhwrKL2oaEey+GLEFMaZs6bhEjjvpIKM= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r242261 - head/sys/netinet From: Rui Paulo In-Reply-To: <201210281902.q9SJ272D078237@svn.freebsd.org> Date: Sun, 28 Oct 2012 14:34:40 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <6FC10C06-9288-4E2C-A1A2-33C5CC8086C5@felyko.com> References: <201210281902.q9SJ272D078237@svn.freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:34:44 -0000 On 28 Oct 2012, at 12:02, Andre Oppermann wrote: > Author: andre > Date: Sun Oct 28 19:02:07 2012 > New Revision: 242261 > URL: http://svn.freebsd.org/changeset/base/242261 >=20 > Log: > For retransmits of SYN|ACK from the syncache use the slightly more > aggressive special tcp_syn_backoff[] retransmit schedule instead of > the normal tcp_backoff[] schedule for established connections. How did you came up with the values for tcp_syn_backoff? I obviously = understand the aggressiveness, but did you measure any significant = improvement in connection establishment time and if so, on what type of = links? Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:44:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB3B5563; Sun, 28 Oct 2012 21:44:25 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 87F138FC16; Sun, 28 Oct 2012 21:44:25 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb] (unknown [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 246CB3982B; Sun, 28 Oct 2012 14:44:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351460665; bh=GJdkILYyfgcInDHafPGo3/BffJ7bF+urtZO8PbX2k5Y=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=hYcuX7Qzt5KmDrQKWQ77FUJBP3tuSxsL+tVloHhr8c7RzuilTjyw4WuzA023u4FWz 2MwUJiTr1jJe0sIGFuEi0Tk7e7I3WTr4SsxVsK566p9R+usdIzN9egJHV6rhyztFMl 1pZEEcyZEVCv6gpC3zR2f8tgl0rL0TdhoGlitZ1k= Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r242266 - head/sys/netinet From: Rui Paulo In-Reply-To: <508DA4B3.4080002@freebsd.org> Date: Sun, 28 Oct 2012 14:44:21 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <8CE1596C-A1E2-49BA-985D-D4D6C891C544@felyko.com> References: <201210281947.q9SJlku2085767@svn.freebsd.org> <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> <508DA4B3.4080002@freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:44:25 -0000 On 28 Oct 2012, at 14:33, Andre Oppermann wrote: > IW10 has been heavily discussed on IETF TCPM. A lot of research on > the impact has been done and the overall result has been a significant > improvement with very little downside. Linux has adopted it for quite > some time already as default setting. I have followed the discussions at tcpm, but I did not find any = conclusive evidence of the benefit of IW10. I'm sure it can help in = multiple situations but, as always, there are tradeoffs. Section 6 of = draft-ietf-tcpm-initcwnd never convinced me. > The bufferbloat issue is certainly real and should not be neglected. > However the solution to bufferbloat is not to send less packets into > the network. In fact that doesn't even make a difference simply = because > other packets with take their place. Right, my point is that sending more packets in an already congested = link will negatively affect the throughput / latency of the network. I'm = not saying that it won't help you download a YouTube video faster, but = the overall fairness of TCP will be reduced. > Buffer bloat can only be fixed > in the devices that actually do the buffering. A much discussed and > apparently good approach seems to be the Codel algorithm for active > buffer management. Are you working on CoDel? :-) Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:45:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6B837B8 for ; Sun, 28 Oct 2012 21:45:58 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 193DA8FC12 for ; Sun, 28 Oct 2012 21:45:57 +0000 (UTC) Received: (qmail 92997 invoked from network); 28 Oct 2012 23:22:59 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 23:22:59 -0000 Message-ID: <508DA793.3060608@freebsd.org> Date: Sun, 28 Oct 2012 22:45:55 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r242263 - head/sys/netinet References: <201210281920.q9SJKNS0081242@svn.freebsd.org> <0220FA6E-FFCB-4489-BF57-3493C2531DD7@felyko.com> In-Reply-To: <0220FA6E-FFCB-4489-BF57-3493C2531DD7@felyko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:45:58 -0000 On 28.10.2012 22:26, Rui Paulo wrote: > On 28 Oct 2012, at 12:20, Andre Oppermann wrote: > >> Author: andre >> Date: Sun Oct 28 19:20:23 2012 >> New Revision: 242263 >> URL: http://svn.freebsd.org/changeset/base/242263 >> >> Log: >> Add SACK_PERMIT to the list of TCP options that are switched off after >> retransmitting a SYN three times. >> >> MFC after: 2 weeks >> >> Modified: >> head/sys/netinet/tcp_timer.c >> >> Modified: head/sys/netinet/tcp_timer.c >> ============================================================================== >> --- head/sys/netinet/tcp_timer.c Sun Oct 28 19:16:22 2012 (r242262) >> +++ head/sys/netinet/tcp_timer.c Sun Oct 28 19:20:23 2012 (r242263) >> @@ -585,7 +585,7 @@ tcp_timer_rexmt(void * xtp) >> * unknown-to-them TCP options. >> */ >> if ((tp->t_state == TCPS_SYN_SENT) && (tp->t_rxtshift == 3)) >> - tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP); >> + tp->t_flags &= ~(TF_REQ_SCALE|TF_REQ_TSTMP|TF_SACK_PERMIT); >> /* >> * If we backed off this far, our srtt estimate is probably bogus. >> * Clobber it so we'll take the next rtt measurement as our srtt; > > Do you have any data regarding this commit or you're just trying to make sure > the SACK option follows the same behaviour of the WSCALE/TSTMP options? The latter. For the purpose of turning off the options after three tries it is contradictory to leave SACK on. There is discussion of scrapping this whole option disabling altogether. Until then better have the 'correct' behavior. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 21:56:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27B65D8F for ; Sun, 28 Oct 2012 21:56:26 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7EA5D8FC12 for ; Sun, 28 Oct 2012 21:56:25 +0000 (UTC) Received: (qmail 93054 invoked from network); 28 Oct 2012 23:33:27 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 23:33:27 -0000 Message-ID: <508DAA07.9090103@freebsd.org> Date: Sun, 28 Oct 2012 22:56:23 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r242261 - head/sys/netinet References: <201210281902.q9SJ272D078237@svn.freebsd.org> <6FC10C06-9288-4E2C-A1A2-33C5CC8086C5@felyko.com> In-Reply-To: <6FC10C06-9288-4E2C-A1A2-33C5CC8086C5@felyko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 21:56:26 -0000 On 28.10.2012 22:34, Rui Paulo wrote: > On 28 Oct 2012, at 12:02, Andre Oppermann wrote: > >> Author: andre >> Date: Sun Oct 28 19:02:07 2012 >> New Revision: 242261 >> URL: http://svn.freebsd.org/changeset/base/242261 >> >> Log: >> For retransmits of SYN|ACK from the syncache use the slightly more >> aggressive special tcp_syn_backoff[] retransmit schedule instead of >> the normal tcp_backoff[] schedule for established connections. > > > How did you came up with the values for tcp_syn_backoff? I obviously > understand the aggressiveness, but did you measure any significant > improvement in connection establishment time and if so, on what type of links? I didn't come up with the values. tcp_syn_backoff[] was introduced almost 12 years ago by jlemon. For syncache it got lost somewhere along the line. There has been recent talk by some large FreeBSD web server operators of reducing SYN|ACK retransmit timeouts. This change fixes a part of the problem. The recent RFC on reducing the RTO will fix the other part. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 22:01:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 993E2155; Sun, 28 Oct 2012 22:01:24 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 7499B8FC08; Sun, 28 Oct 2012 22:01:24 +0000 (UTC) Received: from [10.0.1.38] (c-50-131-226-51.hsd1.ca.comcast.net [50.131.226.51]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id 0464A39828; Sun, 28 Oct 2012 15:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351461684; bh=7vCnyOuGLeQRQDhmaszAEhVxQ1rta5tOvjD8/pKwjPg=; h=References:In-Reply-To:Cc:From:Subject:Date:To; b=Q2CZRm9ntX/Fw7qYZf6Bk9EDG0m6R4JiZDGwZ28uhIvYE7gzKxObDQozfCXasxJv3 WYUlTGuskeQlrzypD+cVr079XG0WMvOWwgpvLCc15nv6cBJXtnfvylK4qX2di8n3zw 0hawa5es0Um8aPkZIBwpJOFMyyPDLwwwsxM9WAmU= References: <201210281902.q9SJ272D078237@svn.freebsd.org> <6FC10C06-9288-4E2C-A1A2-33C5CC8086C5@felyko.com> <508DAA07.9090103@freebsd.org> Mime-Version: 1.0 (1.0) In-Reply-To: <508DAA07.9090103@freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: <81A9846E-CC54-4822-A5B4-EF37D00B42B3@felyko.com> X-Mailer: iPhone Mail (10A505) From: Rui Paulo Subject: Re: svn commit: r242261 - head/sys/netinet Date: Sun, 28 Oct 2012 15:01:24 -0700 To: Andre Oppermann Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 22:01:24 -0000 On Oct 28, 2012, at 14:56, Andre Oppermann wrote: > On 28.10.2012 22:34, Rui Paulo wrote: >> On 28 Oct 2012, at 12:02, Andre Oppermann wrote: >>=20 >>> Author: andre >>> Date: Sun Oct 28 19:02:07 2012 >>> New Revision: 242261 >>> URL: http://svn.freebsd.org/changeset/base/242261 >>>=20 >>> Log: >>> For retransmits of SYN|ACK from the syncache use the slightly more >>> aggressive special tcp_syn_backoff[] retransmit schedule instead of >>> the normal tcp_backoff[] schedule for established connections. >>=20 >>=20 >> How did you came up with the values for tcp_syn_backoff? I obviously > > understand the aggressiveness, but did you measure any significant > > improvement in connection establishment time and if so, on what type of l= inks? >=20 > I didn't come up with the values. tcp_syn_backoff[] was introduced > almost 12 years ago by jlemon. For syncache it got lost somewhere > along the line. Oh, I see. I read it backwards.=20 >=20 > There has been recent talk by some large FreeBSD web server operators > of reducing SYN|ACK retransmit timeouts. This change fixes a part of > the problem. The recent RFC on reducing the RTO will fix the other > part. Which RFC? I'm only aware of draft-hurtig-tcpm-rtorestart.=20= From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 22:12:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ED7B30A for ; Sun, 28 Oct 2012 22:12:52 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0535D8FC0A for ; Sun, 28 Oct 2012 22:12:51 +0000 (UTC) Received: (qmail 93116 invoked from network); 28 Oct 2012 23:49:53 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 28 Oct 2012 23:49:53 -0000 Message-ID: <508DADE1.6050900@freebsd.org> Date: Sun, 28 Oct 2012 23:12:49 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r242261 - head/sys/netinet References: <201210281902.q9SJ272D078237@svn.freebsd.org> <6FC10C06-9288-4E2C-A1A2-33C5CC8086C5@felyko.com> <508DAA07.9090103@freebsd.org> <81A9846E-CC54-4822-A5B4-EF37D00B42B3@felyko.com> In-Reply-To: <81A9846E-CC54-4822-A5B4-EF37D00B42B3@felyko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 22:12:52 -0000 On 28.10.2012 23:01, Rui Paulo wrote: > On Oct 28, 2012, at 14:56, Andre Oppermann wrote: > >> On 28.10.2012 22:34, Rui Paulo wrote: >>> On 28 Oct 2012, at 12:02, Andre Oppermann wrote: >>> >>>> Author: andre >>>> Date: Sun Oct 28 19:02:07 2012 >>>> New Revision: 242261 >>>> URL: http://svn.freebsd.org/changeset/base/242261 >>>> >>>> Log: >>>> For retransmits of SYN|ACK from the syncache use the slightly more >>>> aggressive special tcp_syn_backoff[] retransmit schedule instead of >>>> the normal tcp_backoff[] schedule for established connections. >>> >>> >>> How did you came up with the values for tcp_syn_backoff? I obviously >>> understand the aggressiveness, but did you measure any significant >>> improvement in connection establishment time and if so, on what type of links? >> >> I didn't come up with the values. tcp_syn_backoff[] was introduced >> almost 12 years ago by jlemon. For syncache it got lost somewhere >> along the line. > > Oh, I see. I read it backwards. > >> >> There has been recent talk by some large FreeBSD web server operators >> of reducing SYN|ACK retransmit timeouts. This change fixes a part of >> the problem. The recent RFC on reducing the RTO will fix the other >> part. > > Which RFC? I'm only aware of draft-hurtig-tcpm-rtorestart. RFC6298. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 22:25:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C1DDC7FE for ; Sun, 28 Oct 2012 22:25:13 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 15B3F8FC08 for ; Sun, 28 Oct 2012 22:25:12 +0000 (UTC) Received: (qmail 93166 invoked from network); 29 Oct 2012 00:02:14 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Oct 2012 00:02:14 -0000 Message-ID: <508DB0C6.5050902@freebsd.org> Date: Sun, 28 Oct 2012 23:25:10 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Rui Paulo Subject: Re: svn commit: r242266 - head/sys/netinet References: <201210281947.q9SJlku2085767@svn.freebsd.org> <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> <508DA4B3.4080002@freebsd.org> <8CE1596C-A1E2-49BA-985D-D4D6C891C544@felyko.com> In-Reply-To: <8CE1596C-A1E2-49BA-985D-D4D6C891C544@felyko.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 22:25:13 -0000 On 28.10.2012 22:44, Rui Paulo wrote: > On 28 Oct 2012, at 14:33, Andre Oppermann wrote: >> IW10 has been heavily discussed on IETF TCPM. A lot of research on >> the impact has been done and the overall result has been a significant >> improvement with very little downside. Linux has adopted it for quite >> some time already as default setting. > > I have followed the discussions at tcpm, but I did not find any conclusive evidence of the benefit of IW10. I'm sure it can help in multiple situations but, as always, there are tradeoffs. Section 6 of draft-ietf-tcpm-initcwnd never convinced me. Then please raise your points on TCPM. >> The bufferbloat issue is certainly real and should not be neglected. >> However the solution to bufferbloat is not to send less packets into >> the network. In fact that doesn't even make a difference simply because >> other packets with take their place. > > Right, my point is that sending more packets in an already congested link will negatively affect the throughput / latency of the network. I'm not saying that it won't help you download a YouTube video faster, but the overall fairness of TCP will be reduced. That's always the case. Reality is that the majority of links these days is very fast compared to twenty years ago. We can afford to be a bit more aggressive here. Otherwise taking your point to the extreme would mean that IW can only ever be 1 MSS. Then there is the unfairness of low RTT to high RTT transfers. But that's inherent in any end to end feedback system. >> Buffer bloat can only be fixed >> in the devices that actually do the buffering. A much discussed and >> apparently good approach seems to be the Codel algorithm for active >> buffer management. > > Are you working on CoDel? :-) I'm looking into how the whole interface stuff including ALTQ can be improved in an SMP world. -- Andre From owner-svn-src-head@FreeBSD.ORG Sun Oct 28 22:30:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A6239D4; Sun, 28 Oct 2012 22:30:58 +0000 (UTC) (envelope-from rpaulo@felyko.com) Received: from felyko.com (unknown [IPv6:2607:f2f8:a528::3:1337:ca7]) by mx1.freebsd.org (Postfix) with ESMTP id 64F7F8FC0A; Sun, 28 Oct 2012 22:30:58 +0000 (UTC) Received: from [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb] (unknown [IPv6:2601:9:4d00:85:8077:b284:3e1f:accb]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by felyko.com (Postfix) with ESMTPSA id B1FF439828; Sun, 28 Oct 2012 15:30:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=felyko.com; s=mail; t=1351463457; bh=RYY108MdpK3TwN2pkk8H5yUfSc0sKubj8TBU/ecteuA=; h=Subject:From:In-Reply-To:Date:Cc:References:To; b=PC7qvFLvRQthH14w1U/0Yp1lBjS5uIcYGP+RRnWNEU9FbA1VLI7FArY3jnDzsqhKj DKIz+MeyrEzn7OD9gjMEfnl8FJ0+FarNdrQt0GB63ky3e42njcINsb5VWOvalw0rLL 0+392G2iC2m17N6icUItcloDW9Qgb8bmeKwAwJ7E= Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: svn commit: r242266 - head/sys/netinet From: Rui Paulo In-Reply-To: <508DB0C6.5050902@freebsd.org> Date: Sun, 28 Oct 2012 15:30:53 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: <3E1E3E49-CB09-474B-878E-45962C74685F@felyko.com> References: <201210281947.q9SJlku2085767@svn.freebsd.org> <4532DEB1-4EFE-4E4B-BE1F-A99FFC58DBA3@felyko.com> <508DA4B3.4080002@freebsd.org> <8CE1596C-A1E2-49BA-985D-D4D6C891C544@felyko.com> <508DB0C6.5050902@freebsd.org> To: Andre Oppermann X-Mailer: Apple Mail (2.1499) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Oct 2012 22:30:58 -0000 On 28 Oct 2012, at 15:25, Andre Oppermann wrote: > That's always the case. Reality is that the majority of links these > days is very fast compared to twenty years ago. We can afford to be > a bit more aggressive here. Otherwise taking your point to the = extreme > would mean that IW can only ever be 1 MSS. Not really. My point was that raising the initial window to overcome = deficiencies somewhere else is the wrong approach. Regards, -- Rui Paulo From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 00:17:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9343A9BE; Mon, 29 Oct 2012 00:17:13 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 778998FC12; Mon, 29 Oct 2012 00:17:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T0HDEK034333; Mon, 29 Oct 2012 00:17:13 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T0HDJc034331; Mon, 29 Oct 2012 00:17:13 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210290017.q9T0HDJc034331@svn.freebsd.org> From: Juli Mallett Date: Mon, 29 Oct 2012 00:17:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242272 - head/sys/dev/mii X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 00:17:13 -0000 Author: jmallett Date: Mon Oct 29 00:17:12 2012 New Revision: 242272 URL: http://svn.freebsd.org/changeset/base/242272 Log: Recognize the Marvell 88E1145 Quad Gigabit PHY. Modified: head/sys/dev/mii/e1000phy.c Modified: head/sys/dev/mii/e1000phy.c ============================================================================== --- head/sys/dev/mii/e1000phy.c Sun Oct 28 21:13:12 2012 (r242271) +++ head/sys/dev/mii/e1000phy.c Mon Oct 29 00:17:12 2012 (r242272) @@ -108,6 +108,7 @@ static const struct mii_phydesc e1000phy MII_PHY_DESC(xxMARVELL, E1116R), MII_PHY_DESC(xxMARVELL, E1116R_29), MII_PHY_DESC(xxMARVELL, E1118), + MII_PHY_DESC(xxMARVELL, E1145), MII_PHY_DESC(xxMARVELL, E1149R), MII_PHY_DESC(xxMARVELL, E3016), MII_PHY_DESC(xxMARVELL, PHYG65G), From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 00:51:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3AB3E88; Mon, 29 Oct 2012 00:51:54 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E9A58FC08; Mon, 29 Oct 2012 00:51:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T0psuH039991; Mon, 29 Oct 2012 00:51:54 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T0pssZ039984; Mon, 29 Oct 2012 00:51:54 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210290051.q9T0pssZ039984@svn.freebsd.org> From: Juli Mallett Date: Mon, 29 Oct 2012 00:51:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242273 - in head/sys: contrib/octeon-sdk mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 00:51:54 -0000 Author: jmallett Date: Mon Oct 29 00:51:53 2012 New Revision: 242273 URL: http://svn.freebsd.org/changeset/base/242273 Log: Use Simple Executive LED display routines, which correctly use the LED base address passed from the bootloader, rather than using a hard-coded value. Make FreeBSD announce itself on the LED display similar to other kernels. Remove uses of the previous LED routines, which were under-used and only used in drivers for what seem like debugging purposes, despite those drivers being widely-tested. Remove several inlines for accessing memory that duplicate other functions which are now used instead, as they are now entirely unused. Modified: head/sys/contrib/octeon-sdk/cvmx-ebt3000.c head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_pcmap_regs.h head/sys/mips/cavium/uart_dev_oct16550.c Modified: head/sys/contrib/octeon-sdk/cvmx-ebt3000.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-ebt3000.c Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/contrib/octeon-sdk/cvmx-ebt3000.c Mon Oct 29 00:51:53 2012 (r242273) @@ -52,15 +52,18 @@ * */ +#if !defined(__FreeBSD__) || !defined(_KERNEL) #include "cvmx-config.h" +#endif #include "cvmx.h" +#include "cvmx-ebt3000.h" #include "cvmx-sysinfo.h" void ebt3000_char_write(int char_position, char val) { /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ - void *led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); + char *led_base = CASTPTR(char , CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); if (!led_base) return; if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) @@ -82,10 +85,10 @@ void ebt3000_char_write(int char_positio void ebt3000_str_write(const char *str) { /* Note: phys_to_ptr won't work here, as we are most likely going to access the boot bus. */ - void *led_base; + char *led_base; if (!cvmx_sysinfo_get()->led_display_base_addr) return; - led_base = CASTPTR(void, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); + led_base = CASTPTR(char, CVMX_ADD_SEG32(CVMX_MIPS32_SPACE_KSEG0, cvmx_sysinfo_get()->led_display_base_addr)); if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && cvmx_sysinfo_get()->board_rev_major == 1) { char *ptr = (char *)(led_base + 4); Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/mips/cavium/files.octeon1 Mon Oct 29 00:51:53 2012 (r242273) @@ -58,6 +58,7 @@ mips/cavium/octeon_gpio.c optional gpi contrib/octeon-sdk/cvmx-cmd-queue.c standard contrib/octeon-sdk/cvmx-bootmem.c standard contrib/octeon-sdk/cvmx-clock.c standard +contrib/octeon-sdk/cvmx-ebt3000.c standard contrib/octeon-sdk/cvmx-fpa.c standard contrib/octeon-sdk/cvmx-helper.c standard contrib/octeon-sdk/cvmx-helper-board.c standard Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Mon Oct 29 00:51:53 2012 (r242273) @@ -326,15 +326,10 @@ static int cf_cmd_read (uint32_t nr_sect uint8_t *ptr_8; int error; -//#define OCTEON_VISUAL_CF_0 1 -#ifdef OCTEON_VISUAL_CF_0 - octeon_led_write_char(0, 'R'); -#endif ptr_8 = (uint8_t*)buf; ptr_16 = (uint16_t*)buf; lba = start_sector; - while (nr_sectors--) { error = cf_send_cmd(lba, CMD_READ_SECTOR); if (error != 0) { @@ -366,9 +361,6 @@ static int cf_cmd_read (uint32_t nr_sect lba++; } -#ifdef OCTEON_VISUAL_CF_0 - octeon_led_write_char(0, ' '); -#endif return (0); } @@ -387,10 +379,6 @@ static int cf_cmd_write (uint32_t nr_sec uint8_t *ptr_8; int error; -//#define OCTEON_VISUAL_CF_1 1 -#ifdef OCTEON_VISUAL_CF_1 - octeon_led_write_char(1, 'W'); -#endif lba = start_sector; ptr_8 = (uint8_t*)buf; ptr_16 = (uint16_t*)buf; @@ -425,9 +413,6 @@ static int cf_cmd_write (uint32_t nr_sec lba++; } -#ifdef OCTEON_VISUAL_CF_1 - octeon_led_write_char(1, ' '); -#endif return (0); } @@ -543,13 +528,6 @@ static int cf_wait_busy (void) { uint8_t status; -//#define OCTEON_VISUAL_CF_2 1 -#ifdef OCTEON_VISUAL_CF_2 - static int where0 = 0; - - octeon_led_run_wheel(&where0, 2); -#endif - switch (bus_type) { case CF_8: @@ -585,9 +563,6 @@ static int cf_wait_busy (void) return (ENXIO); } -#ifdef OCTEON_VISUAL_CF_2 - octeon_led_write_char(2, ' '); -#endif return (0); } Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 00:51:53 2012 (r242273) @@ -74,6 +74,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -159,88 +160,6 @@ platform_reset(void) cvmx_write_csr(CVMX_CIU_SOFT_RST, 1); } -void -octeon_led_write_char(int char_position, char val) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - - if (octeon_is_simulation()) - return; - - char_position &= 0x7; /* only 8 chars */ - ptr += char_position; - oct_write8_x8(ptr, val); -} - -void -octeon_led_write_char0(char val) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - - if (octeon_is_simulation()) - return; - oct_write8_x8(ptr, val); -} - -void -octeon_led_write_hexchar(int char_position, char hexval) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - char char1, char2; - - if (octeon_is_simulation()) - return; - - char1 = (hexval >> 4) & 0x0f; char1 = (char1 < 10)?char1+'0':char1+'7'; - char2 = (hexval & 0x0f); char2 = (char2 < 10)?char2+'0':char2+'7'; - char_position &= 0x7; /* only 8 chars */ - if (char_position > 6) - char_position = 6; - ptr += char_position; - oct_write8_x8(ptr, char1); - ptr++; - oct_write8_x8(ptr, char2); -} - -void -octeon_led_write_string(const char *str) -{ - uint64_t ptr = (OCTEON_CHAR_LED_BASE_ADDR | 0xf8); - int i; - - if (octeon_is_simulation()) - return; - - for (i=0; i<8; i++, ptr++) { - if (str && *str) - oct_write8_x8(ptr, *str++); - else - oct_write8_x8(ptr, ' '); - (void)cvmx_read_csr(CVMX_MIO_BOOT_BIST_STAT); - } -} - -static char progress[8] = { '-', '/', '|', '\\', '-', '/', '|', '\\'}; - -void -octeon_led_run_wheel(int *prog_count, int led_position) -{ - if (octeon_is_simulation()) - return; - octeon_led_write_char(led_position, progress[*prog_count]); - *prog_count += 1; - *prog_count &= 0x7; -} - -void -octeon_led_write_hex(uint32_t wl) -{ - char nbuf[80]; - - sprintf(nbuf, "%X", wl); - octeon_led_write_string(nbuf); -} - /* * octeon_debug_symbol * @@ -600,6 +519,7 @@ octeon_process_app_desc_ver_6(void) cvmx_sysinfo_get()->compact_flash_attribute_base_addr = octeon_bootinfo->compact_flash_attribute_base_addr; cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask; + cvmx_sysinfo_get()->led_display_base_addr = octeon_bootinfo->led_display_base_addr; } static void @@ -616,6 +536,18 @@ octeon_boot_params_init(register_t ptr) KASSERT(octeon_bootinfo != NULL, ("octeon_bootinfo should be set")); + if (cvmx_sysinfo_get()->led_display_base_addr != 0) { + /* + * Revision 1.x of the EBT3000 only supports 4 characters, but + * other devices support 8. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && + cvmx_sysinfo_get()->board_rev_major == 1) + ebt3000_str_write("FBSD"); + else + ebt3000_str_write("FreeBSD!"); + } + if (cvmx_sysinfo_get()->phy_mem_desc_addr == (uint64_t)0) panic("Your boot loader did not supply a memory descriptor."); cvmx_bootmem_init(cvmx_sysinfo_get()->phy_mem_desc_addr); Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Mon Oct 29 00:51:53 2012 (r242273) @@ -54,7 +54,6 @@ #if defined(__mips_n64) #define oct_write64(a, v) (*(volatile uint64_t *)(a) = (uint64_t)(v)) -#define oct_write8_x8(a, v) (*(volatile uint8_t *)(a) = (uint8_t)(v)) #define OCT_READ(n, t) \ static inline t oct_read ## n(uintptr_t a) \ @@ -63,9 +62,6 @@ static inline t oct_read ## n(uintptr_t return (*p); \ } -OCT_READ(8, uint8_t); -OCT_READ(16, uint16_t); -OCT_READ(32, uint32_t); OCT_READ(64, uint64_t); #elif defined(__mips_n32) || defined(__mips_o32) @@ -81,17 +77,6 @@ static inline void oct_write64 (uint64_t : "r"(val64), "r"(csr_addr)); } -static inline void oct_write8_x8 (uint64_t csr_addr, uint8_t val8) -{ - __asm __volatile ( - ".set push\n" - ".set mips64\n" - "sb %0, 0(%1)\n" - ".set pop\n" - : - : "r"(val8), "r"(csr_addr)); -} - #define OCT_READ(n, t, insn) \ static inline t oct_read ## n(uint64_t a) \ { \ @@ -107,9 +92,6 @@ static inline t oct_read ## n(uint64_t a return ((t)tmp); \ } -OCT_READ(8, uint8_t, "lb"); -OCT_READ(16, uint16_t, "lh"); -OCT_READ(32, uint32_t, "lw"); OCT_READ(64, uint64_t, "ld"); #else @@ -158,66 +140,6 @@ static inline void oct_write64 (uint64_t intr_restore(sr); } -static inline void oct_write8_x8 (uint64_t csr_addr, uint8_t val8) -{ - uint32_t csr_addrh = csr_addr >> 32; - uint32_t csr_addrl = csr_addr; - uint32_t tmp1; - uint32_t tmp2; - register_t sr; - - sr = intr_disable(); - - __asm __volatile ( - ".set push\n" - ".set mips64\n" - ".set noreorder\n" - ".set noat\n" - "dsll %0, %3, 32\n" - "dsll %1, %4, 32\n" - "dsrl %1, %1, 32\n" - "or %0, %0, %1\n" - "sb %2, 0(%0)\n" - ".set pop\n" - : "=&r" (tmp1), "=&r" (tmp2) - : "r" (val8), "r" (csr_addrh), "r" (csr_addrl)); - - intr_restore(sr); -} - -#define OCT_READ(n, t, insn) \ -static inline t oct_read ## n(uint64_t csr_addr) \ -{ \ - uint32_t csr_addrh = csr_addr >> 32; \ - uint32_t csr_addrl = csr_addr; \ - uint32_t tmp1, tmp2; \ - register_t sr; \ - \ - sr = intr_disable(); \ - \ - __asm __volatile ( \ - ".set push\n" \ - ".set mips64\n" \ - ".set noreorder\n" \ - ".set noat\n" \ - "dsll %1, %2, 32\n" \ - "dsll %0, %3, 32\n" \ - "dsrl %0, %0, 32\n" \ - "or %1, %1, %0\n" \ - "lb %1, 0(%1)\n" \ - ".set pop\n" \ - : "=&r" (tmp1), "=&r" (tmp2) \ - : "r" (csr_addrh), "r" (csr_addrl)); \ - \ - intr_restore(sr); \ - \ - return ((t)tmp2); \ -} - -OCT_READ(8, uint8_t, "lb"); -OCT_READ(16, uint16_t, "lh"); -OCT_READ(32, uint32_t, "lw"); - static inline uint64_t oct_read64 (uint64_t csr_addr) { uint32_t csr_addrh = csr_addr >> 32; @@ -253,51 +175,18 @@ static inline uint64_t oct_read64 (uint6 #endif -#define oct_write64_int64(a, v) (oct_write64(a, (int64_t)(v))) - -/* - * Most write bus transactions are actually 64-bit on Octeon. - */ -static inline void oct_write8 (uint64_t csr_addr, uint8_t val8) -{ - oct_write64(csr_addr, (uint64_t) val8); -} - -static inline void oct_write16 (uint64_t csr_addr, uint16_t val16) -{ - oct_write64(csr_addr, (uint64_t) val16); -} - -static inline void oct_write32 (uint64_t csr_addr, uint32_t val32) -{ - oct_write64(csr_addr, (uint64_t) val32); -} - -#define oct_readint32(a) ((int32_t)oct_read32((a))) - /* * octeon_machdep.c * * Direct to Board Support level. */ -extern void octeon_led_write_char(int char_position, char val); -extern void octeon_led_write_hexchar(int char_position, char hexval); -extern void octeon_led_write_hex(uint32_t wl); -extern void octeon_led_write_string(const char *str); extern void octeon_reset(void); -extern void octeon_led_write_char0(char val); -extern void octeon_led_run_wheel(int *pos, int led_position); extern void octeon_debug_symbol(void); extern void octeon_ciu_reset(void); extern int octeon_is_simulation(void); #endif /* LOCORE */ /* - * EBT3000 LED Unit - */ -#define OCTEON_CHAR_LED_BASE_ADDR (0x1d020000 | (0x1ffffffffull << 31)) - -/* * Default FLASH device (physical) base address */ #define OCTEON_FLASH_BASE_ADDR (0x1d040000ull) Modified: head/sys/mips/cavium/uart_dev_oct16550.c ============================================================================== --- head/sys/mips/cavium/uart_dev_oct16550.c Mon Oct 29 00:17:12 2012 (r242272) +++ head/sys/mips/cavium/uart_dev_oct16550.c Mon Oct 29 00:51:53 2012 (r242273) @@ -632,13 +632,6 @@ oct16550_bus_ipend(struct uart_softc *sc } uart_unlock(sc->sc_hwmtx); -//#define OCTEON_VISUAL_UART 1 -#ifdef OCTEON_VISUAL_UART - static int where1 = 0; - - if (ipend) octeon_led_run_wheel(&where1, 6 + device_get_unit(sc->sc_dev)); -#endif - return (ipend); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 01:35:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC3203FA; Mon, 29 Oct 2012 01:35:17 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38608FC12; Mon, 29 Oct 2012 01:35:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T1ZHUQ047283; Mon, 29 Oct 2012 01:35:17 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T1ZHUJ047280; Mon, 29 Oct 2012 01:35:17 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210290135.q9T1ZHUJ047280@svn.freebsd.org> From: Attilio Rao Date: Mon, 29 Oct 2012 01:35:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242274 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 01:35:18 -0000 Author: attilio Date: Mon Oct 29 01:35:17 2012 New Revision: 242274 URL: http://svn.freebsd.org/changeset/base/242274 Log: Compiler have a precise knowledge of the content of sched_pin() and sched_unpin() as they are functions static and inline. This way it can do two dangerous things: - Reorder instructions around both of them, taking out from the safe path operations that are supposed to be (ie. per-cpu accesses) - Cache the value of td_pinned in CPU registers not making visible in kernel context to the scheduler once it is scanning the runqueue, as td_pinned is not marked volatile. In order to avoid both possible bugs explicitly, protect the safe path with compiler memory barriers. This will prevent reordering and caching by the compiler about td_pinned operations. Generally this could lead to suboptimal code traversing the pinnings but this is not the case as can be easilly verified: http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html Discussed with: jeff, jhb MFC after: 2 weeks Modified: head/sys/sys/sched.h Modified: head/sys/sys/sched.h ============================================================================== --- head/sys/sys/sched.h Mon Oct 29 00:51:53 2012 (r242273) +++ head/sys/sys/sched.h Mon Oct 29 01:35:17 2012 (r242274) @@ -151,11 +151,13 @@ static __inline void sched_pin(void) { curthread->td_pinned++; + __compiler_membar(); } static __inline void sched_unpin(void) { + __compiler_membar(); curthread->td_pinned--; } From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 02:10:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32FB8C5F; Mon, 29 Oct 2012 02:10:21 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B1658FC12; Mon, 29 Oct 2012 02:10:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T2AKv7052813; Mon, 29 Oct 2012 02:10:20 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T2AKOd052811; Mon, 29 Oct 2012 02:10:20 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210290210.q9T2AKOd052811@svn.freebsd.org> From: Juli Mallett Date: Mon, 29 Oct 2012 02:10:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242276 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 02:10:21 -0000 Author: jmallett Date: Mon Oct 29 02:10:20 2012 New Revision: 242276 URL: http://svn.freebsd.org/changeset/base/242276 Log: Wrap some long lines and display board serial numbers at boot. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 01:51:24 2012 (r242275) +++ head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 02:10:20 2012 (r242276) @@ -512,14 +512,19 @@ octeon_process_app_desc_ver_6(void) octeon_bootinfo->board_rev_major, octeon_bootinfo->board_rev_minor, octeon_bootinfo->eclock_hz); - memcpy(cvmx_sysinfo_get()->mac_addr_base, octeon_bootinfo->mac_addr_base, 6); + memcpy(cvmx_sysinfo_get()->mac_addr_base, + octeon_bootinfo->mac_addr_base, 6); cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; cvmx_sysinfo_get()->compact_flash_common_base_addr = octeon_bootinfo->compact_flash_common_base_addr; cvmx_sysinfo_get()->compact_flash_attribute_base_addr = octeon_bootinfo->compact_flash_attribute_base_addr; cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask; - cvmx_sysinfo_get()->led_display_base_addr = octeon_bootinfo->led_display_base_addr; + cvmx_sysinfo_get()->led_display_base_addr = + octeon_bootinfo->led_display_base_addr; + memcpy(cvmx_sysinfo_get()->board_serial_number, + octeon_bootinfo->board_serial_number, + sizeof cvmx_sysinfo_get()->board_serial_number); } static void @@ -588,5 +593,6 @@ octeon_boot_params_init(register_t ptr) #endif strcpy(cpu_model, octeon_model_get_string(cvmx_get_proc_id())); printf("Model: %s\n", cpu_model); + printf("Serial number: %s\n", cvmx_sysinfo_get()->board_serial_number); } /* impEND: This stuff should move back into the Cavium SDK */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 03:31:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9DF7A9B; Mon, 29 Oct 2012 03:31:22 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D19788FC08; Mon, 29 Oct 2012 03:31:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T3VMSS066382; Mon, 29 Oct 2012 03:31:22 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T3VMw7066380; Mon, 29 Oct 2012 03:31:22 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201210290331.q9T3VMw7066380@svn.freebsd.org> From: Tim Kientzle Date: Mon, 29 Oct 2012 03:31:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242277 - head/usr.sbin/kldxref X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 03:31:23 -0000 Author: kientzle Date: Mon Oct 29 03:31:22 2012 New Revision: 242277 URL: http://svn.freebsd.org/changeset/base/242277 Log: Clarify a warning message. Modified: head/usr.sbin/kldxref/ef.c Modified: head/usr.sbin/kldxref/ef.c ============================================================================== --- head/usr.sbin/kldxref/ef.c Mon Oct 29 02:10:20 2012 (r242276) +++ head/usr.sbin/kldxref/ef.c Mon Oct 29 03:31:22 2012 (r242277) @@ -600,7 +600,8 @@ ef_open(const char *filename, struct elf printf("\n"); ef->ef_nsegs = nsegs; if (phdyn == NULL) { - warnx("file isn't dynamically-linked"); + warnx("Skipping %s: not dynamically-linked", + filename); break; } if (ef_read_entry(ef, phdyn->p_offset, From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 04:41:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 10B6F75B; Mon, 29 Oct 2012 04:41:12 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id B29988FC08; Mon, 29 Oct 2012 04:41:11 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so2294046dad.13 for ; Sun, 28 Oct 2012 21:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wU5qdmCDtC4hXDYcqXksFwZupBDAv31xt5DpvnEYcSY=; b=wqDJqRI6YQca2V6IAWFpj4mh7wn12ydpxHy08cLHwtWyQmoDvSW9ZoNwJ3gOWb/B1V mt6u//nxr3cQy0X/hHwzCULobkRSrDsIIvSfWpRtIJomixdpCEPot/6Mpwaz7SazeL0a q/1vZIKcGrytY2k7KSpHoqHO5MTAS0J7zscpi4x7RhOHqX+d1q0RGMBHGvRfcI5DinVu DkzYsA1kKUr1x/GQB7jt0yJ4DzdXYAt63Z9ENWueOaBOYgYOn4vIkoCH4OC+ZiEfMYcQ 9Jf2tU9PBxqht4fovUR7oIkNpdoVUpOcCKU54MHgIejjU8eN6A/RhvlhYqDajX1WX/o8 0fgw== Received: by 10.68.239.198 with SMTP id vu6mr90403684pbc.109.1351485671110; Sun, 28 Oct 2012 21:41:11 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id nu8sm5332364pbc.45.2012.10.28.21.41.07 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 28 Oct 2012 21:41:10 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 29 Oct 2012 13:41:04 -0700 From: YongHyeon PYUN Date: Mon, 29 Oct 2012 13:41:04 -0700 To: Gleb Smirnoff Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf Message-ID: <20121029204104.GA1431@michelle.cdnetworks.com> References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121027220137.GJ70741@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 04:41:12 -0000 On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: > A> > Author: glebius > A> > Date: Fri Oct 26 21:06:33 2012 > A> > New Revision: 242161 > A> > URL: http://svn.freebsd.org/changeset/base/242161 > A> > > A> > Log: > A> > o Remove last argument to ip_fragment(), and obtain all needed information > A> > on checksums directly from mbuf flags. This simplifies code. > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in I'm not sure whether ti(4)'s checksum offloading for IP fragmented packets(CSUM_IP_FRAGS) still works after this change. ti(4) requires CSUM_IP should be set for IP fragmented packets. Not sure whether it's a bug or not. I have a ti(4) controller but I don't remember where I can find it and don't have a link parter(1000baseSX) to test it. :-( > A> > hardware. Some driver may not announce CSUM_IP in theur if_hwassist, > A> > although try to do checksums if CSUM_IP set on mbuf. Example is em(4). em(4) had TX IP checksum offloading support but it was removed without justification. There could be some reason on that decision but I don't see any compelling reason. > A> > A> I'm not getting your description here? Why work around a bug in a driver > A> in ip_fragment() when we can fix the bug in the driver? > > Well, that was actually bug in the stack and a very special driver that > demonstrates it. I may even agree that driver is incorrect, but the stack was > incorrect, too. > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 05:02:31 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4A96A797; Mon, 29 Oct 2012 05:02:31 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id B80418FC0A; Mon, 29 Oct 2012 05:02:30 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9T52Lk5027223; Mon, 29 Oct 2012 09:02:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9T52LRb027222; Mon, 29 Oct 2012 09:02:21 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Oct 2012 09:02:21 +0400 From: Gleb Smirnoff To: Attilio Rao Subject: Re: svn commit: r242274 - head/sys/sys Message-ID: <20121029050221.GM70741@FreeBSD.org> References: <201210290135.q9T1ZHUJ047280@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210290135.q9T1ZHUJ047280@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 05:02:31 -0000 On Mon, Oct 29, 2012 at 01:35:17AM +0000, Attilio Rao wrote: A> Author: attilio A> Date: Mon Oct 29 01:35:17 2012 A> New Revision: 242274 A> URL: http://svn.freebsd.org/changeset/base/242274 A> A> Log: A> Compiler have a precise knowledge of the content of sched_pin() and A> sched_unpin() as they are functions static and inline. This way it A> can do two dangerous things: A> - Reorder instructions around both of them, taking out from the safe A> path operations that are supposed to be (ie. per-cpu accesses) A> - Cache the value of td_pinned in CPU registers not making visible A> in kernel context to the scheduler once it is scanning the runqueue, A> as td_pinned is not marked volatile. A> A> In order to avoid both possible bugs explicitly, protect the safe path A> with compiler memory barriers. This will prevent reordering and caching A> by the compiler about td_pinned operations. A> A> Generally this could lead to suboptimal code traversing the pinnings A> but this is not the case as can be easilly verified: A> http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html Now __compiler_membar() can be removed from kern_rmlock.c:360 -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 05:21:02 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A8ADBAED; Mon, 29 Oct 2012 05:21:02 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 17FB58FC08; Mon, 29 Oct 2012 05:21:01 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9T5L0T7027295; Mon, 29 Oct 2012 09:21:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9T5L0FT027294; Mon, 29 Oct 2012 09:21:00 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Mon, 29 Oct 2012 09:21:00 +0400 From: Gleb Smirnoff To: YongHyeon PYUN Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf Message-ID: <20121029052100.GO70741@FreeBSD.org> References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <20121029204104.GA1431@michelle.cdnetworks.com> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 05:21:02 -0000 On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: Y> > A> > Author: glebius Y> > A> > Date: Fri Oct 26 21:06:33 2012 Y> > A> > New Revision: 242161 Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 Y> > A> > Y> > A> > Log: Y> > A> > o Remove last argument to ip_fragment(), and obtain all needed information Y> > A> > on checksums directly from mbuf flags. This simplifies code. Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in Y> Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) Y> requires CSUM_IP should be set for IP fragmented packets. Not sure Y> whether it's a bug or not. I have a ti(4) controller but I don't Y> remember where I can find it and don't have a link Y> parter(1000baseSX) to test it. :-( ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do software checksums, and thus won't clear these flags. Potentially a driver that announces one flag in if_hwassist but relies on couple of flags to be set on mbuf is not correct. If a driver can't do single checksum processing independently from others, then it should set or clear appropriate flags in if_hwassist as a group. Y> > A> > hardware. Some driver may not announce CSUM_IP in theur if_hwassist, ^^^^^^^^ Oh, that was a typo! Software was meant. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 05:40:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86089EC5; Mon, 29 Oct 2012 05:40:45 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 307158FC08; Mon, 29 Oct 2012 05:40:44 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so4190331pbb.13 for ; Sun, 28 Oct 2012 22:40:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=CD5HfW5hjsvvIKtmgFV/SDx5VBE1tffZ7m6pxBzQCY4=; b=zN+Q09DU1pTcLbCxeoPNrUnyAbs8yiCnnx/TJ93UPmw8C5pdvwpJLusfdxES60ah70 SLpby/IF/HAPolqueM+IqAWkAPVnPq4D8eCgTBJArGizPY1oN66jT9Qxijc8ItEPWwhc MGk1kmMLR5ZBvQGtg+AGbD93mZKzktOX0vBEOuhhpbB+qIYjllYLc89yBC5Nc8GJp4Rw CiJsIZC2HYoisUO8jJfmjPL/k6jeQNSDiiFNQRx/sjbGK10sLYtenyJo4W2+2POd1CFw EC54vw5NUZUbn10a5qkE6jYk31y/4kVGLRP/GhmYGejvheRx+3qQaJwrousEqWXNhdmD Mkqw== Received: by 10.66.78.136 with SMTP id b8mr80631562pax.26.1351489244857; Sun, 28 Oct 2012 22:40:44 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id bc8sm5371713pab.5.2012.10.28.22.40.41 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 28 Oct 2012 22:40:44 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Mon, 29 Oct 2012 14:40:38 -0700 From: YongHyeon PYUN Date: Mon, 29 Oct 2012 14:40:38 -0700 To: Gleb Smirnoff Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf Message-ID: <20121029214038.GD1431@michelle.cdnetworks.com> References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> <20121029052100.GO70741@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20121029052100.GO70741@FreeBSD.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Andre Oppermann X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 05:40:45 -0000 On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote: > On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: > Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: > Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: > Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: > Y> > A> > Author: glebius > Y> > A> > Date: Fri Oct 26 21:06:33 2012 > Y> > A> > New Revision: 242161 > Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 > Y> > A> > > Y> > A> > Log: > Y> > A> > o Remove last argument to ip_fragment(), and obtain all needed information > Y> > A> > on checksums directly from mbuf flags. This simplifies code. > Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in > Y> > Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented > Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) > Y> requires CSUM_IP should be set for IP fragmented packets. Not sure > Y> whether it's a bug or not. I have a ti(4) controller but I don't > Y> remember where I can find it and don't have a link > Y> parter(1000baseSX) to test it. :-( > > ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4) is the only controller that supports TCP/UDP checksum offloading for an IP fragmented packet. > software checksums, and thus won't clear these flags. > > Potentially a driver that announces one flag in if_hwassist but relies on > couple of flags to be set on mbuf is not correct. If a driver can't do single > checksum processing independently from others, then it should set or clear > appropriate flags in if_hwassist as a group. Hmm, then what would be best way to achieve CSUM_IP_FRAGS in driver? I don't have clear idea how to utilize the hardware feature. The stack should tell that the mbuf needs TCP/UDP checksum offloading for IP fragmented packet(i.e. CSUM_IP_FRAGS is not set by upper stack). > > Y> > A> > hardware. Some driver may not announce CSUM_IP in theur if_hwassist, > ^^^^^^^^ > > Oh, that was a typo! Software was meant. > > -- > Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 06:15:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9099C513; Mon, 29 Oct 2012 06:15:05 +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 6C3398FC0A; Mon, 29 Oct 2012 06:15:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T6F5Av094383; Mon, 29 Oct 2012 06:15:05 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T6F5Ds094380; Mon, 29 Oct 2012 06:15:05 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201210290615.q9T6F5Ds094380@svn.freebsd.org> From: Alan Cox Date: Mon, 29 Oct 2012 06:15:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242300 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 06:15:05 -0000 Author: alc Date: Mon Oct 29 06:15:04 2012 New Revision: 242300 URL: http://svn.freebsd.org/changeset/base/242300 Log: Replace the page hold queue, PQ_HOLD, by a new page flag, PG_UNHOLDFREE, because the queue itself serves no purpose. When a held page is freed, inserting the page into the hold queue has the side effect of setting the page's "queue" field to PQ_HOLD. Later, when the page is unheld, it will be freed because the "queue" field is PQ_HOLD. In other words, PQ_HOLD is used as a flag, not a queue. So, this change replaces it with a flag. To accomodate the new page flag, make the page's "flags" field wider and "oflags" field narrower. Reviewed by: kib Modified: head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Mon Oct 29 04:51:51 2012 (r242299) +++ head/sys/vm/vm_page.c Mon Oct 29 06:15:04 2012 (r242300) @@ -308,7 +308,6 @@ vm_page_startup(vm_offset_t vaddr) TAILQ_INIT(&vm_page_queues[i].pl); vm_page_queues[PQ_INACTIVE].cnt = &cnt.v_inactive_count; vm_page_queues[PQ_ACTIVE].cnt = &cnt.v_active_count; - vm_page_queues[PQ_HOLD].cnt = &cnt.v_active_count; /* * Allocate memory for use when boot strapping the kernel memory @@ -540,7 +539,7 @@ vm_page_unhold(vm_page_t mem) vm_page_lock_assert(mem, MA_OWNED); --mem->hold_count; KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!")); - if (mem->hold_count == 0 && mem->queue == PQ_HOLD) + if (mem->hold_count == 0 && (mem->flags & PG_UNHOLDFREE) != 0) vm_page_free_toq(mem); } @@ -2042,9 +2041,9 @@ vm_page_free_toq(vm_page_t m) panic("vm_page_free: freeing wired page %p", m); if (m->hold_count != 0) { m->flags &= ~PG_ZERO; - vm_page_lock_queues(); - vm_page_enqueue(PQ_HOLD, m); - vm_page_unlock_queues(); + KASSERT((m->flags & PG_UNHOLDFREE) == 0, + ("vm_page_free: freeing PG_UNHOLDFREE page %p", m)); + m->flags |= PG_UNHOLDFREE; } else { /* * Restore the default memory attribute to the page. Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Mon Oct 29 04:51:51 2012 (r242299) +++ head/sys/vm/vm_page.h Mon Oct 29 06:15:04 2012 (r242300) @@ -145,8 +145,8 @@ struct vm_page { u_short cow; /* page cow mapping count (P) */ u_int wire_count; /* wired down maps refs (P) */ uint8_t aflags; /* access is atomic */ - uint8_t flags; /* see below, often immutable after alloc */ - u_short oflags; /* page flags (O) */ + uint8_t oflags; /* page VPO_* flags (O) */ + uint16_t flags; /* page PG_* flags (P) */ u_char act_count; /* page usage count (O) */ u_char busy; /* page busy count (O) */ /* NOTE that these must support one bit per DEV_BSIZE in a page!!! */ @@ -169,17 +169,16 @@ struct vm_page { * mappings, and such pages are also not on any PQ queue. * */ -#define VPO_BUSY 0x0001 /* page is in transit */ -#define VPO_WANTED 0x0002 /* someone is waiting for page */ -#define VPO_UNMANAGED 0x0004 /* No PV management for page */ -#define VPO_SWAPINPROG 0x0200 /* swap I/O in progress on page */ -#define VPO_NOSYNC 0x0400 /* do not collect for syncer */ +#define VPO_BUSY 0x01 /* page is in transit */ +#define VPO_WANTED 0x02 /* someone is waiting for page */ +#define VPO_UNMANAGED 0x04 /* no PV management for page */ +#define VPO_SWAPINPROG 0x08 /* swap I/O in progress on page */ +#define VPO_NOSYNC 0x10 /* do not collect for syncer */ #define PQ_NONE 255 #define PQ_INACTIVE 0 #define PQ_ACTIVE 1 -#define PQ_HOLD 2 -#define PQ_COUNT 3 +#define PQ_COUNT 2 struct vpgqueues { struct pglist pl; @@ -263,14 +262,15 @@ extern struct vpglocks pa_lock[]; * Page flags. If changed at any other time than page allocation or * freeing, the modification must be protected by the vm_page lock. */ -#define PG_CACHED 0x01 /* page is cached */ -#define PG_FREE 0x02 /* page is free */ -#define PG_FICTITIOUS 0x04 /* physical page doesn't exist */ -#define PG_ZERO 0x08 /* page is zeroed */ -#define PG_MARKER 0x10 /* special queue marker page */ -#define PG_SLAB 0x20 /* object pointer is actually a slab */ -#define PG_WINATCFLS 0x40 /* flush dirty page on inactive q */ -#define PG_NODUMP 0x80 /* don't include this page in a dump */ +#define PG_CACHED 0x0001 /* page is cached */ +#define PG_FREE 0x0002 /* page is free */ +#define PG_FICTITIOUS 0x0004 /* physical page doesn't exist */ +#define PG_ZERO 0x0008 /* page is zeroed */ +#define PG_MARKER 0x0010 /* special queue marker page */ +#define PG_SLAB 0x0020 /* object pointer is actually a slab */ +#define PG_WINATCFLS 0x0040 /* flush dirty page on inactive q */ +#define PG_NODUMP 0x0080 /* don't include this page in a dump */ +#define PG_UNHOLDFREE 0x0100 /* delayed free of a held page */ /* * Misc constants. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 06:31:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 967DB7D8; Mon, 29 Oct 2012 06:31:52 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B71C8FC08; Mon, 29 Oct 2012 06:31:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T6VqsQ097167; Mon, 29 Oct 2012 06:31:52 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T6VqbC097165; Mon, 29 Oct 2012 06:31:52 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201210290631.q9T6VqbC097165@svn.freebsd.org> From: Hiroki Sato Date: Mon, 29 Oct 2012 06:31:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242301 - head/etc/rc.d X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 06:31:52 -0000 Author: hrs Date: Mon Oct 29 06:31:51 2012 New Revision: 242301 URL: http://svn.freebsd.org/changeset/base/242301 Log: Load ipdivert.ko when natd_enable=YES. PR: conf/167566 Modified: head/etc/rc.d/ipfw Modified: head/etc/rc.d/ipfw ============================================================================== --- head/etc/rc.d/ipfw Mon Oct 29 06:15:04 2012 (r242300) +++ head/etc/rc.d/ipfw Mon Oct 29 06:31:51 2012 (r242301) @@ -25,11 +25,11 @@ ipfw_prestart() if checkyesno dummynet_enable; then required_modules="$required_modules dummynet" fi - + if checkyesno natd_enable; then + required_modules="$required_modules ipdivert" + fi if checkyesno firewall_nat_enable; then - if ! checkyesno natd_enable; then - required_modules="$required_modules ipfw_nat" - fi + required_modules="$required_modules ipfw_nat" fi } From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 06:52:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB9B4AC8; Mon, 29 Oct 2012 06:52:59 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id E70FF8FC08; Mon, 29 Oct 2012 06:52:58 +0000 (UTC) Received: from c122-106-175-26.carlnfd1.nsw.optusnet.com.au (c122-106-175-26.carlnfd1.nsw.optusnet.com.au [122.106.175.26]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q9T6qsmt021991 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 29 Oct 2012 17:52:55 +1100 Date: Mon, 29 Oct 2012 17:52:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Juli Mallett Subject: Re: svn commit: r242276 - head/sys/mips/cavium In-Reply-To: <201210290210.q9T2AKOd052811@svn.freebsd.org> Message-ID: <20121029173544.Y1261@besplex.bde.org> References: <201210290210.q9T2AKOd052811@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-Cloudmark-Score: 0 X-Optus-Cloudmark-Analysis: v=2.0 cv=F/YP7ddN c=1 sm=1 a=wBP4FV5UvGQA:10 a=kj9zAlcOel0A:10 a=PO7r1zJSAAAA:8 a=JzwRw_2MAAAA:8 a=4HK1B-gzULkA:10 a=7nL5cK90jzteqgzt_1EA:9 a=CjuIK1q_8ugA:10 a=-W88bXlIhmuAOjfG:21 a=mCyrQilsO2o-PBxE:21 a=bxQHXO5Py4tHmhUgaywp5w==:117 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 06:52:59 -0000 On Mon, 29 Oct 2012, Juli Mallett wrote: > Log: > Wrap some long lines and display board serial numbers at boot. Any chance of using FreeBSD style instead of gnu style for the wrapping? > Modified: head/sys/mips/cavium/octeon_machdep.c > ============================================================================== > --- head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 01:51:24 2012 (r242275) > +++ head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 02:10:20 2012 (r242276) > @@ -512,14 +512,19 @@ octeon_process_app_desc_ver_6(void) > octeon_bootinfo->board_rev_major, > octeon_bootinfo->board_rev_minor, > octeon_bootinfo->eclock_hz); This old wrapping uses gnu style (indent -lp). The struct member names in it are verbose, but not verbose enough to have normal style with a struct-dependent prefix. > - memcpy(cvmx_sysinfo_get()->mac_addr_base, octeon_bootinfo->mac_addr_base, 6); > + memcpy(cvmx_sysinfo_get()->mac_addr_base, > + octeon_bootinfo->mac_addr_base, 6); This new wrapping is in gnu style. FreeBSD style is indent -ci4. > cvmx_sysinfo_get()->mac_addr_count = octeon_bootinfo->mac_addr_count; > cvmx_sysinfo_get()->compact_flash_common_base_addr = > octeon_bootinfo->compact_flash_common_base_addr; > cvmx_sysinfo_get()->compact_flash_attribute_base_addr = > octeon_bootinfo->compact_flash_attribute_base_addr; The last 2 wrappings aren't in either gnu style or FreeBSD style. FreeBSD style is indent -ci4 again. Gnu style is to put the operator on the new line, and IIRC, line up the operator with the variable, resulting in no indentation for the operator. This has the FreeBSD style for the operator, but a contination indent of 8. > cvmx_sysinfo_get()->core_mask = octeon_bootinfo->core_mask; > - cvmx_sysinfo_get()->led_display_base_addr = octeon_bootinfo->led_display_base_addr; > + cvmx_sysinfo_get()->led_display_base_addr = > + octeon_bootinfo->led_display_base_addr; This matches the above for neither gnu not FreeBSD style. > + memcpy(cvmx_sysinfo_get()->board_serial_number, > + octeon_bootinfo->board_serial_number, > + sizeof cvmx_sysinfo_get()->board_serial_number); This matches the above for the gnu style of the indentation. It also doesn't follow FreeBSD style for the explicit "sizeof is not followed by a space" or the implicit "sizeof is followed by a left parentheses (without a space)". The former implies the latter, because the identifiers would coalesce without the space. My normal style would omit the parentheses for `sizeof object' and everywhere else possible, but here they are needed for another reason for people who like excessive parentheses: the pointer is returned by a function so it has parentheses in it, so it is not as clear as usual what the object is. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 07:06:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5A1CFDCD; Mon, 29 Oct 2012 07:06:24 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3E9B38FC08; Mon, 29 Oct 2012 07:06:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9T76OfA002544; Mon, 29 Oct 2012 07:06:24 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9T76O0R002542; Mon, 29 Oct 2012 07:06:24 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210290706.q9T76O0R002542@svn.freebsd.org> From: Juli Mallett Date: Mon, 29 Oct 2012 07:06:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242302 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 07:06:24 -0000 Author: jmallett Date: Mon Oct 29 07:06:23 2012 New Revision: 242302 URL: http://svn.freebsd.org/changeset/base/242302 Log: Add a sysctl to change the LED display. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 06:31:51 2012 (r242301) +++ head/sys/mips/cavium/octeon_machdep.c Mon Oct 29 07:06:23 2012 (r242302) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -366,6 +367,46 @@ octeon_get_timecount(struct timecounter return ((unsigned)octeon_get_ticks()); } +static int +sysctl_machdep_led_display(SYSCTL_HANDLER_ARGS) +{ + size_t buflen; + char buf[9]; + int error; + + if (req->newptr == NULL) + return (EINVAL); + + if (cvmx_sysinfo_get()->led_display_base_addr == 0) + return (ENODEV); + + /* + * Revision 1.x of the EBT3000 only supports 4 characters, but + * other devices support 8. + */ + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_EBT3000 && + cvmx_sysinfo_get()->board_rev_major == 1) + buflen = 4; + else + buflen = 8; + + if (req->newlen > buflen) + return (E2BIG); + + error = SYSCTL_IN(req, buf, req->newlen); + if (error != 0) + return (error); + + buf[req->newlen] = '\0'; + ebt3000_str_write(buf); + + return (0); +} + +SYSCTL_PROC(_machdep, OID_AUTO, led_display, CTLTYPE_STRING | CTLFLAG_WR, + NULL, 0, sysctl_machdep_led_display, "A", + "String to display on LED display"); + /** * version of printf that works better in exception context. * From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 08:21:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9F93D7BA for ; Mon, 29 Oct 2012 08:21:03 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 0453A8FC1A for ; Mon, 29 Oct 2012 08:21:02 +0000 (UTC) Received: (qmail 95451 invoked from network); 29 Oct 2012 09:57:59 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Oct 2012 09:57:59 -0000 Message-ID: <508E3C6B.2090102@freebsd.org> Date: Mon, 29 Oct 2012 09:20:59 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: pyunyh@gmail.com Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> <20121029052100.GO70741@FreeBSD.org> <20121029214038.GD1431@michelle.cdnetworks.com> In-Reply-To: <20121029214038.GD1431@michelle.cdnetworks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 08:21:03 -0000 On 29.10.2012 22:40, YongHyeon PYUN wrote: > On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote: >> On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: >> Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: >> Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: >> Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: >> Y> > A> > Author: glebius >> Y> > A> > Date: Fri Oct 26 21:06:33 2012 >> Y> > A> > New Revision: 242161 >> Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 >> Y> > A> > >> Y> > A> > Log: >> Y> > A> > o Remove last argument to ip_fragment(), and obtain all needed information >> Y> > A> > on checksums directly from mbuf flags. This simplifies code. >> Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did checksums in >> Y> >> Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented >> Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) >> Y> requires CSUM_IP should be set for IP fragmented packets. Not sure >> Y> whether it's a bug or not. I have a ti(4) controller but I don't >> Y> remember where I can find it and don't have a link >> Y> parter(1000baseSX) to test it. :-( >> >> ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do > > Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4) > is the only controller that supports TCP/UDP checksum offloading > for an IP fragmented packet. This is a bit weird if it doesn't do the fragmentation itself. Computing the IP header checksum doesn't differ for normal and fragmented packets. The protocol checksum (TCP or UDP) stays the same for in the case of IP level fragmentation. It is only visible in the first fragment which includes the protocol header. >> software checksums, and thus won't clear these flags. >> >> Potentially a driver that announces one flag in if_hwassist but relies on >> couple of flags to be set on mbuf is not correct. If a driver can't do single >> checksum processing independently from others, then it should set or clear >> appropriate flags in if_hwassist as a group. > > Hmm, then what would be best way to achieve CSUM_IP_FRAGS in > driver? I don't have clear idea how to utilize the hardware > feature. The stack should tell that the mbuf needs TCP/UDP checksum > offloading for IP fragmented packet(i.e. CSUM_IP_FRAGS is not set by > upper stack). As I said there can't be fragment checksumming without hardware based fragmentation. We have three cases here: 1. TSO where the hardware does the segmentation, TCP and IP header checksums for each generated packet. 2. IP packet fragmentation where a packet is split, the IP header checksum is recomputed for each fragment, but the protocol csum stays the same and is not modified. 3. UDP fragmentation where a large packet is sent to the hardware and it generates first the UDP checksum and then splits it into IP fragments each with its own IP header checksum. So we end up with these possible large send hardware offload capabilities: TSO: including IPv4hdr and TCP checksumming UDP fragmentation: including IPv4hdr and UDP checksumming IP fragmentation: including IPv4hdr checksumming Besides that we have the packet <= MTU sized offload capabilities: TCP checksumming UDP checksumming SCTP checksumming IPv4hdr checksumming >> Y> > A> > hardware. Some driver may not announce CSUM_IP in theur if_hwassist, >> ^^^^^^^^ >> >> Oh, that was a typo! Software was meant. That explains quite a bit of confusion. -- Andre From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 10:04:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 63C73219; Mon, 29 Oct 2012 10:04:29 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4935F8FC12; Mon, 29 Oct 2012 10:04:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TA4TUp036974; Mon, 29 Oct 2012 10:04:29 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TA4T2R036971; Mon, 29 Oct 2012 10:04:29 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201210291004.q9TA4T2R036971@svn.freebsd.org> From: Kevin Lo Date: Mon, 29 Oct 2012 10:04:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242304 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 10:04:29 -0000 Author: kevlo Date: Mon Oct 29 10:04:28 2012 New Revision: 242304 URL: http://svn.freebsd.org/changeset/base/242304 Log: Since the macro dtom() has been removed, fix comments about the dtom. Reviewed by: glebius Modified: head/sys/kern/kern_mbuf.c head/sys/kern/uipc_mbuf.c Modified: head/sys/kern/kern_mbuf.c ============================================================================== --- head/sys/kern/kern_mbuf.c Mon Oct 29 08:16:31 2012 (r242303) +++ head/sys/kern/kern_mbuf.c Mon Oct 29 10:04:28 2012 (r242304) @@ -244,7 +244,7 @@ static void mb_reclaim(void *); static void mbuf_init(void *); static void *mbuf_jumbo_alloc(uma_zone_t, int, uint8_t *, int); -/* Ensure that MSIZE doesn't break dtom() - it must be a power of 2 */ +/* Ensure that MSIZE must be a power of 2. */ CTASSERT((((MSIZE - 1) ^ MSIZE) + 1) >> 1 == MSIZE); /* Modified: head/sys/kern/uipc_mbuf.c ============================================================================== --- head/sys/kern/uipc_mbuf.c Mon Oct 29 08:16:31 2012 (r242303) +++ head/sys/kern/uipc_mbuf.c Mon Oct 29 10:04:28 2012 (r242304) @@ -1000,8 +1000,8 @@ m_adj(struct mbuf *mp, int req_len) /* * Rearange an mbuf chain so that len bytes are contiguous - * and in the data area of an mbuf (so that mtod and dtom - * will work for a structure of size len). Returns the resulting + * and in the data area of an mbuf (so that mtod will work + * for a structure of size len). Returns the resulting * mbuf chain on success, frees it and returns null on failure. * If there is room, it will add up to max_protohdr-len extra bytes to the * contiguous region in an attempt to avoid being called next time. From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 10:22:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 01CFEB24; Mon, 29 Oct 2012 10:22:01 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC2398FC19; Mon, 29 Oct 2012 10:22:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TAM0w1039808; Mon, 29 Oct 2012 10:22:00 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TAM06a039804; Mon, 29 Oct 2012 10:22:00 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210291022.q9TAM06a039804@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 29 Oct 2012 10:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242305 - head/sys/dev/acpi_support X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 10:22:01 -0000 Author: bapt Date: Mon Oct 29 10:22:00 2012 New Revision: 242305 URL: http://svn.freebsd.org/changeset/base/242305 Log: add support for newer Lenovo ThinkPads to acpi_ibm PR: kern/164538 Submitted by: Pierre Imai MFC after: 2 weeks Modified: head/sys/dev/acpi_support/acpi_ibm.c Modified: head/sys/dev/acpi_support/acpi_ibm.c ============================================================================== --- head/sys/dev/acpi_support/acpi_ibm.c Mon Oct 29 10:04:28 2012 (r242304) +++ head/sys/dev/acpi_support/acpi_ibm.c Mon Oct 29 10:22:00 2012 (r242305) @@ -317,7 +317,7 @@ static devclass_t acpi_ibm_devclass; DRIVER_MODULE(acpi_ibm, acpi, acpi_ibm_driver, acpi_ibm_devclass, 0, 0); MODULE_DEPEND(acpi_ibm, acpi, 1, 1, 1); -static char *ibm_ids[] = {"IBM0068", NULL}; +static char *ibm_ids[] = {"IBM0068", "LEN0068", NULL}; static void ibm_led(void *softc, int onoff) From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 12:14:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 31DD593D; Mon, 29 Oct 2012 12:14:58 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F1A048FC0C; Mon, 29 Oct 2012 12:14:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TCEvB3058400; Mon, 29 Oct 2012 12:14:57 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TCEvAM058398; Mon, 29 Oct 2012 12:14:57 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291214.q9TCEvAM058398@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 12:14:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242306 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 12:14:58 -0000 Author: andre Date: Mon Oct 29 12:14:57 2012 New Revision: 242306 URL: http://svn.freebsd.org/changeset/base/242306 Log: Add logging for socket attach failures in sonewconn() during accept(2). Include the pointer to the PCB so it can be attributed to a particular application by corresponding it to "netstat -A" output. MFC after: 2 weeks Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Oct 29 10:22:00 2012 (r242305) +++ head/sys/kern/uipc_socket.c Mon Oct 29 12:14:57 2012 (r242306) @@ -135,6 +135,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -500,16 +501,24 @@ sonewconn(struct socket *head, int conns over = (head->so_qlen > 3 * head->so_qlimit / 2); ACCEPT_UNLOCK(); #ifdef REGRESSION - if (regression_sonewconn_earlytest && over) + if (regression_sonewconn_earlytest && over) { #else - if (over) + if (over) { #endif + log(LOG_DEBUG, "%s: pcb %p: Listen queue overflow: " + "%i already in queue awaiting acceptance\n", + __func__, head->so_pcb, over); return (NULL); + } VNET_ASSERT(head->so_vnet != NULL, ("%s:%d so_vnet is NULL, head=%p", __func__, __LINE__, head)); so = soalloc(head->so_vnet); - if (so == NULL) + if (so == NULL) { + log(LOG_DEBUG, "%s: pcb %p: New socket allocation failure: " + "limit reached or out of memory\n", + __func__, head->so_pcb); return (NULL); + } if ((head->so_options & SO_ACCEPTFILTER) != 0) connstatus = 0; so->so_head = head; @@ -526,9 +535,16 @@ sonewconn(struct socket *head, int conns knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv)); knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd)); VNET_SO_ASSERT(head); - if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) || - (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { + if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat)) { + sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: soreserve() failed\n", + __func__, head->so_pcb); + return (NULL); + } + if ((*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) { sodealloc(so); + log(LOG_DEBUG, "%s: pcb %p: pru_attach() failed\n", + __func__, head->so_pcb); return (NULL); } so->so_rcv.sb_lowat = head->so_rcv.sb_lowat; From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 12:17:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 804FACB4; Mon, 29 Oct 2012 12:17:03 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 66B6B8FC14; Mon, 29 Oct 2012 12:17:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TCH3GH058828; Mon, 29 Oct 2012 12:17:03 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TCH3gd058826; Mon, 29 Oct 2012 12:17:03 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291217.q9TCH3gd058826@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 12:17:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242308 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 12:17:03 -0000 Author: andre Date: Mon Oct 29 12:17:02 2012 New Revision: 242308 URL: http://svn.freebsd.org/changeset/base/242308 Log: Define the delayed ACK timeout value directly as hz/10 instead of obfuscating it by going through PR_FASTHZ. No functional change. MFC after: 2 weeks Modified: head/sys/netinet/tcp_timer.h Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Mon Oct 29 12:16:19 2012 (r242307) +++ head/sys/netinet/tcp_timer.h Mon Oct 29 12:17:02 2012 (r242308) @@ -118,7 +118,7 @@ #define TCP_MAXRXTSHIFT 12 /* maximum retransmits */ -#define TCPTV_DELACK (hz / PR_FASTHZ / 2) /* 100ms timeout */ +#define TCPTV_DELACK ( hz/10 ) /* 100ms timeout */ #ifdef TCPTIMERS static const char *tcptimers[] = From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 12:31:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC6092E9; Mon, 29 Oct 2012 12:31:12 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BB9C48FC1D; Mon, 29 Oct 2012 12:31:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TCVCcf061087; Mon, 29 Oct 2012 12:31:12 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TCVCsb061085; Mon, 29 Oct 2012 12:31:12 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291231.q9TCVCsb061085@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 12:31:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242309 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 12:31:13 -0000 Author: andre Date: Mon Oct 29 12:31:12 2012 New Revision: 242309 URL: http://svn.freebsd.org/changeset/base/242309 Log: In soreceive_stream() don't drop an already dequeued mbuf chain by overwriting the return mbuf pointer with newly received data after a loop. Instead append the new mbuf chain to the existing one. Fix up sb_lastrecord when dequeuing mbuf's so that sbappend_stream() doesn't get confused. For the remainder copy case in the mbuf delivery part deduct the copied length len instead of the whole mbuf length. Additionally don't depend on 'n' being being available which isn't true in the case of MSG_PEEK. Fix the MSG_WAITALL case by comparing against sb_hiwat. Before it was looping for every receive as sb_lowat normally is zero. Add comment about issue with (MSG_WAITALL | MSG_PEEK) which isn't properly handled. Submitted by: trociny (except for the change in last paragraph) Modified: head/sys/kern/uipc_socket.c Modified: head/sys/kern/uipc_socket.c ============================================================================== --- head/sys/kern/uipc_socket.c Mon Oct 29 12:17:02 2012 (r242308) +++ head/sys/kern/uipc_socket.c Mon Oct 29 12:31:12 2012 (r242309) @@ -1962,6 +1962,7 @@ release: /* * Optimized version of soreceive() for stream (TCP) sockets. + * XXXAO: (MSG_WAITALL | MSG_PEEK) isn't properly handled. */ int soreceive_stream(struct socket *so, struct sockaddr **psa, struct uio *uio, @@ -2050,7 +2051,7 @@ restart: /* On MSG_WAITALL we must wait until all data or error arrives. */ if ((flags & MSG_WAITALL) && - (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_lowat)) + (sb->sb_cc >= uio->uio_resid || sb->sb_cc >= sb->sb_hiwat)) goto deliver; /* @@ -2076,7 +2077,11 @@ deliver: if (mp0 != NULL) { /* Dequeue as many mbufs as possible. */ if (!(flags & MSG_PEEK) && len >= sb->sb_mb->m_len) { - for (*mp0 = m = sb->sb_mb; + if (*mp0 == NULL) + *mp0 = sb->sb_mb; + else + m_cat(*mp0, sb->sb_mb); + for (m = sb->sb_mb; m != NULL && m->m_len <= len; m = m->m_next) { len -= m->m_len; @@ -2084,10 +2089,11 @@ deliver: sbfree(sb, m); n = m; } + n->m_next = NULL; sb->sb_mb = m; + sb->sb_lastrecord = sb->sb_mb; if (sb->sb_mb == NULL) SB_EMPTY_FIXUP(sb); - n->m_next = NULL; } /* Copy the remainder. */ if (len > 0) { @@ -2098,9 +2104,9 @@ deliver: if (m == NULL) len = 0; /* Don't flush data from sockbuf. */ else - uio->uio_resid -= m->m_len; + uio->uio_resid -= len; if (*mp0 != NULL) - n->m_next = m; + m_cat(*mp0, m); else *mp0 = m; if (*mp0 == NULL) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 13:13:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9BB27955; Mon, 29 Oct 2012 13:13:53 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 789268FC08; Mon, 29 Oct 2012 13:13:52 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4779807lag.13 for ; Mon, 29 Oct 2012 06:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=1VXbBd055rsRk0k+NOR+oTT1fOqBs+pn0UO7HudE0bA=; b=L0So07s5wPG9j7/zBCmByiYZcW0R5Qeei50vrmDhvnQ8nryMWJfNNGyB1FZSNIlZAK oH+JDL92SBqlpZaz3Nc5o0AvdygDuxpy1AfZqfCZ92FIZTICNl/SA/BBAW9CUXWy9e+F mN54q0K1eT2WXdfNpK15Fqi0XtGrdk+EX9csy4w8/pqbv1EXtQikNjztirGBYhmhETSk 9NsA6Bvon+hls2okip03h6oUy0AVNX1XmzjZcEs2enIadvfAmTIn4Gl2Q3N2wQpb++4N CjZog/caAnsCobj6IXV3+85jY7C+ZNeAdPOyrrsrU9vMM0umZNdB/BdnBxgPuFa0VZE6 cbaA== MIME-Version: 1.0 Received: by 10.152.123.103 with SMTP id lz7mr26974534lab.21.1351516430910; Mon, 29 Oct 2012 06:13:50 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Mon, 29 Oct 2012 06:13:50 -0700 (PDT) In-Reply-To: <20121029050221.GM70741@FreeBSD.org> References: <201210290135.q9T1ZHUJ047280@svn.freebsd.org> <20121029050221.GM70741@FreeBSD.org> Date: Mon, 29 Oct 2012 13:13:50 +0000 X-Google-Sender-Auth: 818PEocCNr0rrUGyD0a_nMDD9-c Message-ID: Subject: Re: svn commit: r242274 - head/sys/sys From: Attilio Rao To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 13:13:53 -0000 On 10/29/12, Gleb Smirnoff wrote: > On Mon, Oct 29, 2012 at 01:35:17AM +0000, Attilio Rao wrote: > A> Author: attilio > A> Date: Mon Oct 29 01:35:17 2012 > A> New Revision: 242274 > A> URL: http://svn.freebsd.org/changeset/base/242274 > A> > A> Log: > A> Compiler have a precise knowledge of the content of sched_pin() and > A> sched_unpin() as they are functions static and inline. This way it > A> can do two dangerous things: > A> - Reorder instructions around both of them, taking out from the safe > A> path operations that are supposed to be (ie. per-cpu accesses) > A> - Cache the value of td_pinned in CPU registers not making visible > A> in kernel context to the scheduler once it is scanning the runqueue, > A> as td_pinned is not marked volatile. > A> > A> In order to avoid both possible bugs explicitly, protect the safe path > A> with compiler memory barriers. This will prevent reordering and > caching > A> by the compiler about td_pinned operations. > A> > A> Generally this could lead to suboptimal code traversing the pinnings > A> but this is not the case as can be easilly verified: > A> > http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html > > Now __compiler_membar() can be removed from kern_rmlock.c:360 No, they are there to protect td_critnest which has nothing to do with sched_pin(). Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 13:16:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A5D8ECCC; Mon, 29 Oct 2012 13:16:33 +0000 (UTC) (envelope-from andre@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E7668FC15; Mon, 29 Oct 2012 13:16:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TDGXia068333; Mon, 29 Oct 2012 13:16:33 GMT (envelope-from andre@svn.freebsd.org) Received: (from andre@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TDGXIX068331; Mon, 29 Oct 2012 13:16:33 GMT (envelope-from andre@svn.freebsd.org) Message-Id: <201210291316.q9TDGXIX068331@svn.freebsd.org> From: Andre Oppermann Date: Mon, 29 Oct 2012 13:16:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242311 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 13:16:33 -0000 Author: andre Date: Mon Oct 29 13:16:33 2012 New Revision: 242311 URL: http://svn.freebsd.org/changeset/base/242311 Log: Forced commit to provide the correct commit message to r242251: Defer sending an independent window update if a delayed ACK is pending saving a packet. The window update then gets piggy-backed on the next already scheduled ACK. Added grammar fixes as well. MFC after: 2 weeks Modified: head/sys/netinet/tcp_output.c Modified: head/sys/netinet/tcp_output.c ============================================================================== --- head/sys/netinet/tcp_output.c Mon Oct 29 12:37:39 2012 (r242310) +++ head/sys/netinet/tcp_output.c Mon Oct 29 13:16:33 2012 (r242311) @@ -547,13 +547,13 @@ after_sack_rexmit: /* * Sending of standalone window updates. * - * Window updates important when we close our window due to a full - * socket buffer and are opening it again after the application + * Window updates are important when we close our window due to a + * full socket buffer and are opening it again after the application * reads data from it. Once the window has opened again and the * remote end starts to send again the ACK clock takes over and * provides the most current window information. * - * We must avoid to the silly window syndrome whereas every read + * We must avoid the silly window syndrome whereas every read * from the receive buffer, no matter how small, causes a window * update to be sent. We also should avoid sending a flurry of * window updates when the socket buffer had queued a lot of data From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 13:18:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 73826E73 for ; Mon, 29 Oct 2012 13:18:15 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id C50558FC1A for ; Mon, 29 Oct 2012 13:18:13 +0000 (UTC) Received: (qmail 39879 invoked from network); 29 Oct 2012 14:55:08 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 29 Oct 2012 14:55:08 -0000 Message-ID: <508E8211.5020903@freebsd.org> Date: Mon, 29 Oct 2012 14:18:09 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Andre Oppermann Subject: Re: svn commit: r242251 - head/sys/netinet References: <201210281730.q9SHUT6U062773@svn.freebsd.org> In-Reply-To: <201210281730.q9SHUT6U062773@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 13:18:15 -0000 On 28.10.2012 18:30, Andre Oppermann wrote: > Author: andre > Date: Sun Oct 28 17:30:28 2012 > New Revision: 242251 > URL: http://svn.freebsd.org/changeset/base/242251 > > Log: > When SYN or SYN/ACK had to be retransmitted RFC5681 requires us to > reduce the initial CWND to one segment. This reduction got lost > some time ago due to a change in initialization ordering. > > Additionally in tcp_timer_rexmt() avoid entering fast recovery when > we're still in TCPS_SYN_SENT state. Oops, this was the wrong commit message for this change. Here is the correct one: Defer sending an independent window update if a delayed ACK is pending saving a packet. The window update then gets piggy-backed on the next already scheduled ACK. I've forced commit r242311 with some grammar fixes to provide this information. -- Andre > MFC after: 2 weeks > > Modified: > head/sys/netinet/tcp_output.c > > Modified: head/sys/netinet/tcp_output.c > ============================================================================== > --- head/sys/netinet/tcp_output.c Sun Oct 28 17:25:08 2012 (r242250) > +++ head/sys/netinet/tcp_output.c Sun Oct 28 17:30:28 2012 (r242251) > @@ -551,10 +551,14 @@ after_sack_rexmit: > * max size segments, or at least 50% of the maximum possible > * window, then want to send a window update to peer. > * Skip this if the connection is in T/TCP half-open state. > - * Don't send pure window updates when the peer has closed > - * the connection and won't ever send more data. > + * > + * Don't send an independent window update if a delayed > + * ACK is pending (it will get piggy-backed on it) or the > + * remote side already has done a half-close and won't send > + * more data. > */ > if (recwin > 0 && !(tp->t_flags & TF_NEEDSYN) && > + !(tp->t_flags & TF_DELACK) && > !TCPS_HAVERCVDFIN(tp->t_state)) { > /* > * "adv" is the amount we can increase the window, > > From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 14:18:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 39F04236; Mon, 29 Oct 2012 14:18:55 +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 2238E8FC12; Mon, 29 Oct 2012 14:18:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TEIso4078109; Mon, 29 Oct 2012 14:18:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TEIsrZ078107; Mon, 29 Oct 2012 14:18:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210291418.q9TEIsrZ078107@svn.freebsd.org> From: Alexander Motin Date: Mon, 29 Oct 2012 14:18:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242314 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 14:18:55 -0000 Author: mav Date: Mon Oct 29 14:18:54 2012 New Revision: 242314 URL: http://svn.freebsd.org/changeset/base/242314 Log: Make GEOM RAID more aggressive in marking volumes as clean on shutdown and move that action from shutdown_pre_sync to shutdown_post_sync stage to avoid extra flapping. ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID to shutdown gracefully. To handle that, mark volume as clean just when shutdown time comes and there are no active writes. MFC after: 2 weeks Modified: head/sys/geom/raid/g_raid.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Mon Oct 29 13:58:11 2012 (r242313) +++ head/sys/geom/raid/g_raid.c Mon Oct 29 14:18:54 2012 (r242314) @@ -108,8 +108,9 @@ LIST_HEAD(, g_raid_tr_class) g_raid_tr_c LIST_HEAD(, g_raid_volume) g_raid_volumes = LIST_HEAD_INITIALIZER(g_raid_volumes); -static eventhandler_tag g_raid_pre_sync = NULL; +static eventhandler_tag g_raid_post_sync = NULL; static int g_raid_started = 0; +static int g_raid_shutdown = 0; static int g_raid_destroy_geom(struct gctl_req *req, struct g_class *mp, struct g_geom *gp); @@ -881,7 +882,7 @@ g_raid_orphan(struct g_consumer *cp) G_RAID_EVENT_DISK); } -static int +static void g_raid_clean(struct g_raid_volume *vol, int acw) { struct g_raid_softc *sc; @@ -892,22 +893,21 @@ g_raid_clean(struct g_raid_volume *vol, sx_assert(&sc->sc_lock, SX_XLOCKED); // if ((sc->sc_flags & G_RAID_DEVICE_FLAG_NOFAILSYNC) != 0) -// return (0); +// return; if (!vol->v_dirty) - return (0); + return; if (vol->v_writes > 0) - return (0); + return; if (acw > 0 || (acw == -1 && vol->v_provider != NULL && vol->v_provider->acw > 0)) { timeout = g_raid_clean_time - (time_uptime - vol->v_last_write); - if (timeout > 0) - return (timeout); + if (!g_raid_shutdown && timeout > 0) + return; } vol->v_dirty = 0; G_RAID_DEBUG1(1, sc, "Volume %s marked as clean.", vol->v_name); g_raid_write_metadata(sc, vol, NULL, NULL); - return (0); } static void @@ -1520,8 +1520,7 @@ process: g_raid_disk_done_request(bp); } else if (rv == EWOULDBLOCK) { TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) { - if (vol->v_writes == 0 && vol->v_dirty) - g_raid_clean(vol, -1); + g_raid_clean(vol, -1); if (bioq_first(&vol->v_inflight) == NULL && vol->v_tr) { t.tv_sec = g_raid_idle_threshold / 1000000; @@ -1783,7 +1782,7 @@ g_raid_access(struct g_provider *pp, int error = ENXIO; goto out; } - if (dcw == 0 && vol->v_dirty) + if (dcw == 0) g_raid_clean(vol, dcw); vol->v_provider_open += acr + acw + ace; /* Handle delayed node destruction. */ @@ -2379,21 +2378,25 @@ g_raid_dumpconf(struct sbuf *sb, const c } static void -g_raid_shutdown_pre_sync(void *arg, int howto) +g_raid_shutdown_post_sync(void *arg, int howto) { struct g_class *mp; struct g_geom *gp, *gp2; struct g_raid_softc *sc; + struct g_raid_volume *vol; int error; mp = arg; DROP_GIANT(); g_topology_lock(); + g_raid_shutdown = 1; LIST_FOREACH_SAFE(gp, &mp->geom, geom, gp2) { if ((sc = gp->softc) == NULL) continue; g_topology_unlock(); sx_xlock(&sc->sc_lock); + TAILQ_FOREACH(vol, &sc->sc_volumes, v_next) + g_raid_clean(vol, -1); g_cancel_event(sc); error = g_raid_destroy(sc, G_RAID_DESTROY_DELAYED); if (error != 0) @@ -2408,9 +2411,9 @@ static void g_raid_init(struct g_class *mp) { - g_raid_pre_sync = EVENTHANDLER_REGISTER(shutdown_pre_sync, - g_raid_shutdown_pre_sync, mp, SHUTDOWN_PRI_FIRST); - if (g_raid_pre_sync == NULL) + g_raid_post_sync = EVENTHANDLER_REGISTER(shutdown_post_sync, + g_raid_shutdown_post_sync, mp, SHUTDOWN_PRI_FIRST); + if (g_raid_post_sync == NULL) G_RAID_DEBUG(0, "Warning! Cannot register shutdown event."); g_raid_started = 1; } @@ -2419,8 +2422,8 @@ static void g_raid_fini(struct g_class *mp) { - if (g_raid_pre_sync != NULL) - EVENTHANDLER_DEREGISTER(shutdown_pre_sync, g_raid_pre_sync); + if (g_raid_post_sync != NULL) + EVENTHANDLER_DEREGISTER(shutdown_post_sync, g_raid_post_sync); g_raid_started = 0; } From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 14:27:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B28734DF; Mon, 29 Oct 2012 14:27: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 96FD78FC08; Mon, 29 Oct 2012 14:27:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TERS7M079443; Mon, 29 Oct 2012 14:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TERS3Y079441; Mon, 29 Oct 2012 14:27:28 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201210291427.q9TERS3Y079441@svn.freebsd.org> From: Nathan Whitehorn Date: Mon, 29 Oct 2012 14:27:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242315 - head/sys/powerpc/powermac X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 14:27:29 -0000 Author: nwhitehorn Date: Mon Oct 29 14:27:28 2012 New Revision: 242315 URL: http://svn.freebsd.org/changeset/base/242315 Log: Work around broken device tree on last-generation PowerPC iMacs (PowerMac12,1), which have a mac-io MPIC cell that indifies itself as the root PIC despite the actual root PIC being on the northbridge. No CPC945 systems have a mac-io PIC that does anything so just don't attach on CPC945 (U4) systems. MFC after: 3 days Modified: head/sys/powerpc/powermac/openpic_macio.c Modified: head/sys/powerpc/powermac/openpic_macio.c ============================================================================== --- head/sys/powerpc/powermac/openpic_macio.c Mon Oct 29 14:18:54 2012 (r242314) +++ head/sys/powerpc/powermac/openpic_macio.c Mon Oct 29 14:27:28 2012 (r242315) @@ -94,6 +94,10 @@ openpic_macio_probe(device_t dev) if (strcmp(type, "open-pic") != 0) return (ENXIO); + /* On some U4 systems, there is a phantom MPIC in the mac-io cell */ + if (OF_finddevice("/u4") != (phandle_t)-1) + return (ENXIO); + device_set_desc(dev, OPENPIC_DEVSTR); return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 14:27:44 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4F036644; Mon, 29 Oct 2012 14:27:44 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 07F888FC08; Mon, 29 Oct 2012 14:27:42 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA15239; Mon, 29 Oct 2012 16:27:40 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <508E925C.3010707@FreeBSD.org> Date: Mon, 29 Oct 2012 16:27:40 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121014 Thunderbird/16.0.1 MIME-Version: 1.0 To: Alexander Motin Subject: Re: svn commit: r242314 - head/sys/geom/raid References: <201210291418.q9TEIsrZ078107@svn.freebsd.org> In-Reply-To: <201210291418.q9TEIsrZ078107@svn.freebsd.org> X-Enigmail-Version: 1.4.5 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 14:27:44 -0000 on 29/10/2012 16:18 Alexander Motin said the following: > Author: mav > Date: Mon Oct 29 14:18:54 2012 > New Revision: 242314 > URL: http://svn.freebsd.org/changeset/base/242314 > > Log: > Make GEOM RAID more aggressive in marking volumes as clean on shutdown > and move that action from shutdown_pre_sync to shutdown_post_sync stage > to avoid extra flapping. > > ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID > to shutdown gracefully. To handle that, mark volume as clean just when > shutdown time comes and there are no active writes. Perhaps something like what zfs_modevent(MOD_UNLOAD) does should also be done in one of the shutdown hooks? Maybe at the start of shutdown_post_sync (so that it is run before the hooks of lower level drivers like graid)? -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 14:37:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 590F1AAE; Mon, 29 Oct 2012 14:37:42 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3B24C8FC0C; Mon, 29 Oct 2012 14:37:40 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so3963872lbd.13 for ; Mon, 29 Oct 2012 07:37:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=pbl2Fo3RPlUuLqXj9NLjgbCkwjTEioQwQvDNtGCYL8s=; b=0DlDmlj4jArUDWwwTh/7GJV1r5gYsgCksLiRD0komI6WK5g5foVcIzf40iXxR8l6/l SfST7s2uGKSHp5NGiTX4R36hcMhLIsw8ZxQ0Sr0MtDx+w56i97PaN9xi1+8ndPe7vRRR 3zdIJCYBemMP2aQi6wVNPzX85pzOZ3i3JBcq8fYFG8ASrIK/BaeK0RTg+TNk8wonKa1e PXzumSE3ZX08akbpriznQtzU/l31mV8RHtoE5eEDn/4nEkpkzsLjx/qCgS3ab6ElW0/R Fsm+Ptj14wE+60mGufSQvL8QIVEWhsHA4w5echPrdnPNuHI8hCxBgd5bDiuIbKvBECrk rkHQ== Received: by 10.152.108.42 with SMTP id hh10mr27147556lab.4.1351521458593; Mon, 29 Oct 2012 07:37:38 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id nr2sm3180495lab.5.2012.10.29.07.37.37 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 07:37:38 -0700 (PDT) Sender: Alexander Motin Message-ID: <508E94B0.1040101@FreeBSD.org> Date: Mon, 29 Oct 2012 16:37:36 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r242314 - head/sys/geom/raid References: <201210291418.q9TEIsrZ078107@svn.freebsd.org> <508E925C.3010707@FreeBSD.org> In-Reply-To: <508E925C.3010707@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 14:37:42 -0000 On 29.10.2012 16:27, Andriy Gapon wrote: > on 29/10/2012 16:18 Alexander Motin said the following: >> Author: mav >> Date: Mon Oct 29 14:18:54 2012 >> New Revision: 242314 >> URL: http://svn.freebsd.org/changeset/base/242314 >> >> Log: >> Make GEOM RAID more aggressive in marking volumes as clean on shutdown >> and move that action from shutdown_pre_sync to shutdown_post_sync stage >> to avoid extra flapping. >> >> ZFS tends to not close devices on shutdown, that doesn't allow GEOM RAID >> to shutdown gracefully. To handle that, mark volume as clean just when >> shutdown time comes and there are no active writes. > > Perhaps something like what zfs_modevent(MOD_UNLOAD) does should also be done in > one of the shutdown hooks? May be, but I don't know ZFS very good. > Maybe at the start of shutdown_post_sync (so that it is run before the hooks of > lower level drivers like graid)? graid would be happy if device would be closed at any point of time, either before or after. But before is preferable to avoid some flapping between dirtying and added here cleaning. -- Alexander Motin From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 17:19:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F8FD56C; Mon, 29 Oct 2012 17:19:44 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 470DA8FC15; Mon, 29 Oct 2012 17:19:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9THJiwM006465; Mon, 29 Oct 2012 17:19:44 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9THJiP0006462; Mon, 29 Oct 2012 17:19:44 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210291719.q9THJiP0006462@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 29 Oct 2012 17:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242319 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 17:19:44 -0000 Author: bapt Date: Mon Oct 29 17:19:43 2012 New Revision: 242319 URL: http://svn.freebsd.org/changeset/base/242319 Log: make pw_init and gr_init fail if the specified master password or group file is a directory. MFC after: 1 month Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Mon Oct 29 16:58:45 2012 (r242318) +++ head/lib/libutil/gr_util.c Mon Oct 29 17:19:43 2012 (r242319) @@ -63,6 +63,8 @@ static const char group_line_format[] = int gr_init(const char *dir, const char *group) { + struct stat st; + if (dir == NULL) { strcpy(group_dir, _PATH_ETC); } else { @@ -88,6 +90,15 @@ gr_init(const char *dir, const char *gro } strcpy(group_file, group); } + + if (stat(group_file, &st) == -1) + return (-1); + + if (S_ISDIR(st.st_mode)) { + errno = EISDIR; + return (-1); + } + initialized = 1; return (0); } Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Mon Oct 29 16:58:45 2012 (r242318) +++ head/lib/libutil/pw_util.c Mon Oct 29 17:19:43 2012 (r242319) @@ -96,6 +96,7 @@ pw_init(const char *dir, const char *mas #if 0 struct rlimit rlim; #endif + struct stat st; if (dir == NULL) { strcpy(passwd_dir, _PATH_ETC); @@ -123,6 +124,14 @@ pw_init(const char *dir, const char *mas strcpy(masterpasswd, master); } + if (stat(masterpasswd, &st) == -1) + return (-1); + + if (S_ISDIR(st.st_mode)) { + errno = EISDIR; + return (-1); + } + /* * The code that follows is extremely disruptive to the calling * process, and is therefore disabled until someone can conceive From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 17:21:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CBC070E; Mon, 29 Oct 2012 17:21:59 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED2168FC0A; Mon, 29 Oct 2012 17:21:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9THLwfC006876; Mon, 29 Oct 2012 17:21:58 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9THLw0W006873; Mon, 29 Oct 2012 17:21:58 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201210291721.q9THLw0W006873@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 29 Oct 2012 17:21:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242320 - head/sys/dev/sdhci X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 17:21:59 -0000 Author: gonzo Date: Mon Oct 29 17:21:58 2012 New Revision: 242320 URL: http://svn.freebsd.org/changeset/base/242320 Log: Add new quirks: - Data timeout is broken - Data timeout uses SD clock - Capabilities register is unavailable Add calculations for clock divisor for SDHCI 3.0 Modified: head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Mon Oct 29 17:19:43 2012 (r242319) +++ head/sys/dev/sdhci/sdhci.c Mon Oct 29 17:21:58 2012 (r242320) @@ -221,6 +221,7 @@ sdhci_set_clock(struct sdhci_slot *slot, { uint32_t res; uint16_t clk; + uint16_t div; int timeout; if (clock == slot->clock) @@ -232,17 +233,39 @@ sdhci_set_clock(struct sdhci_slot *slot, /* If no clock requested - left it so. */ if (clock == 0) return; - /* Looking for highest freq <= clock. */ - res = slot->max_clk; - for (clk = 1; clk < 256; clk <<= 1) { - if (res <= clock) - break; - res >>= 1; + if (slot->version < SDHCI_SPEC_300) { + /* Looking for highest freq <= clock. */ + res = slot->max_clk; + for (div = 1; div < 256; div <<= 1) { + if (res <= clock) + break; + res >>= 1; + } + /* Divider 1:1 is 0x00, 2:1 is 0x01, 256:1 is 0x80 ... */ + div >>= 1; + } + else { + /* Version 3.0 divisors are multiples of two up to 1023*2 */ + if (clock > slot->max_clk) + div = 2; + else { + for (div = 2; div < 1023*2; div += 2) { + if ((slot->max_clk / div) <= clock) + break; + } + } + div >>= 1; } - /* Divider 1:1 is 0x00, 2:1 is 0x01, 256:1 is 0x80 ... */ - clk >>= 1; + + if (bootverbose || sdhci_debug) + slot_printf(slot, "Divider %d for freq %d (max %d)\n", + div, clock, slot->max_clk); + /* Now we have got divider, set it. */ - clk <<= SDHCI_DIVIDER_SHIFT; + clk = (div & SDHCI_DIVIDER_MASK) << SDHCI_DIVIDER_SHIFT; + clk |= ((div >> SDHCI_DIVIDER_MASK_LEN) & SDHCI_DIVIDER_HI_MASK) + << SDHCI_DIVIDER_HI_SHIFT; + WR2(slot, SDHCI_CLOCK_CONTROL, clk); /* Enable clock. */ clk |= SDHCI_CLOCK_INT_EN; @@ -488,7 +511,10 @@ sdhci_init_slot(device_t dev, struct sdh sdhci_init(slot); slot->version = (RD2(slot, SDHCI_HOST_VERSION) >> SDHCI_SPEC_VER_SHIFT) & SDHCI_SPEC_VER_MASK; - caps = RD4(slot, SDHCI_CAPABILITIES); + if (slot->quirks & SDHCI_QUIRK_MISSING_CAPS) + caps = slot->caps; + else + caps = RD4(slot, SDHCI_CAPABILITIES); /* Calculate base clock frequency. */ slot->max_clk = (caps & SDHCI_CLOCK_BASE_MASK) >> SDHCI_CLOCK_BASE_SHIFT; @@ -499,14 +525,19 @@ sdhci_init_slot(device_t dev, struct sdh } slot->max_clk *= 1000000; /* Calculate timeout clock frequency. */ - slot->timeout_clk = - (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + if (slot->quirks & SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK) { + slot->timeout_clk = slot->max_clk / 1000; + } else { + slot->timeout_clk = + (caps & SDHCI_TIMEOUT_CLK_MASK) >> SDHCI_TIMEOUT_CLK_SHIFT; + if (caps & SDHCI_TIMEOUT_CLK_UNIT) + slot->timeout_clk *= 1000; + } + if (slot->timeout_clk == 0) { device_printf(dev, "Hardware doesn't specify timeout clock " "frequency.\n"); } - if (caps & SDHCI_TIMEOUT_CLK_UNIT) - slot->timeout_clk *= 1000; slot->host.f_min = slot->max_clk / 256; slot->host.f_max = slot->max_clk; @@ -815,6 +846,8 @@ sdhci_start_data(struct sdhci_slot *slot slot_printf(slot, "Timeout too large!\n"); div = 0xE; } + if (slot->quirks & SDHCI_QUIRK_BROKEN_TIMEOUT_VAL) + div = 0xE; WR1(slot, SDHCI_TIMEOUT_CONTROL, div); if (data == NULL) Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Mon Oct 29 17:19:43 2012 (r242319) +++ head/sys/dev/sdhci/sdhci.h Mon Oct 29 17:21:58 2012 (r242320) @@ -51,12 +51,16 @@ #define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) /* Controller needs lowered frequency */ #define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) - +/* Data timeout is invalid, should use SD clock */ +#define SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK (1<<10) +/* Timeout value is invalid, should be overriden */ +#define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<11) +/* SDHCI_CAPABILITIES is invalid */ +#define SDHCI_QUIRK_MISSING_CAPS (1<<12) /* * Controller registers */ - #define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_BLOCK_SIZE 0x04 @@ -130,7 +134,11 @@ #define SDHCI_WAKE_UP_CONTROL 0x2B #define SDHCI_CLOCK_CONTROL 0x2C +#define SDHCI_DIVIDER_MASK 0xff +#define SDHCI_DIVIDER_MASK_LEN 8 #define SDHCI_DIVIDER_SHIFT 8 +#define SDHCI_DIVIDER_HI_MASK 3 +#define SDHCI_DIVIDER_HI_SHIFT 6 #define SDHCI_CLOCK_CARD_EN 0x0004 #define SDHCI_CLOCK_INT_STABLE 0x0002 #define SDHCI_CLOCK_INT_EN 0x0001 @@ -204,9 +212,13 @@ #define SDHCI_VENDOR_VER_SHIFT 8 #define SDHCI_SPEC_VER_MASK 0x00FF #define SDHCI_SPEC_VER_SHIFT 0 +#define SDHCI_SPEC_100 0 +#define SDHCI_SPEC_200 1 +#define SDHCI_SPEC_300 2 struct sdhci_slot { u_int quirks; /* Chip specific quirks */ + u_int caps; /* Override SDHCI_CAPABILITIES */ device_t bus; /* Bus device */ device_t dev; /* Slot device */ u_char num; /* Slot number */ From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 17:23:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9A47D893; Mon, 29 Oct 2012 17:23:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 80C618FC12; Mon, 29 Oct 2012 17:23:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9THNkZ8007217; Mon, 29 Oct 2012 17:23:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9THNkMd007213; Mon, 29 Oct 2012 17:23:46 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201210291723.q9THNkMd007213@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Mon, 29 Oct 2012 17:23:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242321 - in head/sys: arm/broadcom/bcm2835 arm/conf dev/mmc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 17:23:46 -0000 Author: gonzo Date: Mon Oct 29 17:23:45 2012 New Revision: 242321 URL: http://svn.freebsd.org/changeset/base/242321 Log: Add BCM2835 SDHCI driver and enable it in Raspberry Pi config Added: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c (contents, props changed) Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 head/sys/arm/conf/RPI-B head/sys/dev/mmc/mmc.c Added: head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/arm/broadcom/bcm2835/bcm2835_sdhci.c Mon Oct 29 17:23:45 2012 (r242321) @@ -0,0 +1,364 @@ +/*- + * Copyright (c) 2012 Oleksandr Tymoshenko + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + */ +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +#include +#include "sdhci_if.h" + +#define DEBUG + +#ifdef DEBUG +#define dprintf(fmt, args...) do { printf("%s(): ", __func__); \ + printf(fmt,##args); } while (0) +#else +#define dprintf(fmt, args...) +#endif + +struct bcm_sdhci_dmamap_arg { + bus_addr_t sc_dma_busaddr; +}; + +struct bcm_sdhci_softc { + device_t sc_dev; + struct mtx sc_mtx; + struct resource * sc_mem_res; + struct resource * sc_irq_res; + bus_space_tag_t sc_bst; + bus_space_handle_t sc_bsh; + void * sc_intrhand; + struct mmc_request * sc_req; + struct mmc_data * sc_data; + uint32_t sc_flags; +#define LPC_SD_FLAGS_IGNORECRC (1 << 0) + int sc_xfer_direction; +#define DIRECTION_READ 0 +#define DIRECTION_WRITE 1 + int sc_xfer_done; + int sc_bus_busy; + struct sdhci_slot sc_slot; +}; + +#define SD_MAX_BLOCKSIZE 1024 +/* XXX */ + +static int bcm_sdhci_probe(device_t); +static int bcm_sdhci_attach(device_t); +static int bcm_sdhci_detach(device_t); +static void bcm_sdhci_intr(void *); + +static int bcm_sdhci_get_ro(device_t, device_t); + +#define bcm_sdhci_lock(_sc) \ + mtx_lock(&_sc->sc_mtx); +#define bcm_sdhci_unlock(_sc) \ + mtx_unlock(&_sc->sc_mtx); + +static int +bcm_sdhci_probe(device_t dev) +{ + if (!ofw_bus_is_compatible(dev, "broadcom,bcm2835-sdhci")) + return (ENXIO); + + device_set_desc(dev, "Broadcom 2708 SDHCI controller"); + return (BUS_PROBE_DEFAULT); +} + +static int +bcm_sdhci_attach(device_t dev) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + int rid, err; + + sc->sc_dev = dev; + sc->sc_req = NULL; + + mtx_init(&sc->sc_mtx, "bcm sdhci", "sdhci", MTX_DEF); + + rid = 0; + sc->sc_mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid, + RF_ACTIVE); + if (!sc->sc_mem_res) { + device_printf(dev, "cannot allocate memory window\n"); + err = ENXIO; + goto fail; + } + + sc->sc_bst = rman_get_bustag(sc->sc_mem_res); + sc->sc_bsh = rman_get_bushandle(sc->sc_mem_res); + + rid = 0; + sc->sc_irq_res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, + RF_ACTIVE); + if (!sc->sc_irq_res) { + device_printf(dev, "cannot allocate interrupt\n"); + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + err = ENXIO; + goto fail; + } + + if (bus_setup_intr(dev, sc->sc_irq_res, INTR_TYPE_MISC | INTR_MPSAFE, + NULL, bcm_sdhci_intr, sc, &sc->sc_intrhand)) + { + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + device_printf(dev, "cannot setup interrupt handler\n"); + err = ENXIO; + goto fail; + } + + sc->sc_slot.caps = SDHCI_CAN_VDD_330 | SDHCI_CAN_VDD_180 | SDHCI_CAN_DO_HISPD; + sc->sc_slot.caps |= (50 << SDHCI_CLOCK_BASE_SHIFT); + sc->sc_slot.quirks = SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK + | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL + | SDHCI_QUIRK_MISSING_CAPS; + + sdhci_init_slot(dev, &sc->sc_slot, 0); + + bus_generic_probe(dev); + bus_generic_attach(dev); + + sdhci_start_slot(&sc->sc_slot); + + return (0); + +fail: + if (sc->sc_intrhand) + bus_teardown_intr(dev, sc->sc_irq_res, sc->sc_intrhand); + if (sc->sc_irq_res) + bus_release_resource(dev, SYS_RES_IRQ, 0, sc->sc_irq_res); + if (sc->sc_mem_res) + bus_release_resource(dev, SYS_RES_MEMORY, 0, sc->sc_mem_res); + + return (err); +} + +static int +bcm_sdhci_detach(device_t dev) +{ + + return (EBUSY); +} + +static void +bcm_sdhci_intr(void *arg) +{ + struct bcm_sdhci_softc *sc = arg; + + sdhci_generic_intr(&sc->sc_slot); +} + +static int +bcm_sdhci_get_ro(device_t bus, device_t child) +{ + + return (0); +} + +static inline uint32_t +RD4(struct bcm_sdhci_softc *sc, bus_size_t off) +{ + uint32_t val = bus_space_read_4(sc->sc_bst, sc->sc_bsh, off); + return val; +} + +static inline void +WR4(struct bcm_sdhci_softc *sc, bus_size_t off, uint32_t val) +{ + bus_space_write_4(sc->sc_bst, sc->sc_bsh, off, val); + + if ((off != SDHCI_BUFFER && off != SDHCI_INT_STATUS && off != SDHCI_CLOCK_CONTROL)) + { + int timeout = 100000; + while (val != bus_space_read_4(sc->sc_bst, sc->sc_bsh, off) + && --timeout > 0) + continue; + + if (timeout <= 0) + printf("sdhci_brcm: writing 0x%X to reg 0x%X " + "always gives 0x%X\n", + val, (uint32_t)off, + bus_space_read_4(sc->sc_bst, sc->sc_bsh, off)); + } +} + +static uint8_t +bcm_sdhci_read_1(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val = RD4(sc, off & ~3); + + return ((val >> (off & 3)*8) & 0xff); +} + +static uint16_t +bcm_sdhci_read_2(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val = RD4(sc, off & ~3); + + return ((val >> (off & 3)*8) & 0xffff); +} + +static uint32_t +bcm_sdhci_read_4(device_t dev, struct sdhci_slot *slot, bus_size_t off) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + return RD4(sc, off); +} + +static void +bcm_sdhci_read_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + bus_space_read_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count); +} + +static void +bcm_sdhci_write_1(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint8_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + uint32_t val32 = RD4(sc, off & ~3); + val32 &= ~(0xff << (off & 3)*8); + val32 |= (val << (off & 3)*8); + WR4(sc, off & ~3, val32); +} + +static void +bcm_sdhci_write_2(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint16_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + static uint32_t cmd_and_trandfer_mode; + uint32_t val32; + if (off == SDHCI_COMMAND_FLAGS) + val32 = cmd_and_trandfer_mode; + else + val32 = RD4(sc, off & ~3); + val32 &= ~(0xffff << (off & 3)*8); + val32 |= (val << (off & 3)*8); + if (off == SDHCI_TRANSFER_MODE) + cmd_and_trandfer_mode = val32; + else + WR4(sc, off & ~3, val32); +} + +static void +bcm_sdhci_write_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, uint32_t val) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + WR4(sc, off, val); +} + +static void +bcm_sdhci_write_multi_4(device_t dev, struct sdhci_slot *slot, bus_size_t off, + uint32_t *data, bus_size_t count) +{ + struct bcm_sdhci_softc *sc = device_get_softc(dev); + + bus_space_write_multi_4(sc->sc_bst, sc->sc_bsh, off, data, count); +} + +static device_method_t bcm_sdhci_methods[] = { + /* Device interface */ + DEVMETHOD(device_probe, bcm_sdhci_probe), + DEVMETHOD(device_attach, bcm_sdhci_attach), + DEVMETHOD(device_detach, bcm_sdhci_detach), + + /* Bus interface */ + DEVMETHOD(bus_read_ivar, sdhci_generic_read_ivar), + DEVMETHOD(bus_write_ivar, sdhci_generic_write_ivar), + DEVMETHOD(bus_print_child, bus_generic_print_child), + + /* MMC bridge interface */ + DEVMETHOD(mmcbr_update_ios, sdhci_generic_update_ios), + DEVMETHOD(mmcbr_request, sdhci_generic_request), + DEVMETHOD(mmcbr_get_ro, bcm_sdhci_get_ro), + DEVMETHOD(mmcbr_acquire_host, sdhci_generic_acquire_host), + DEVMETHOD(mmcbr_release_host, sdhci_generic_release_host), + + /* SDHCI registers accessors */ + DEVMETHOD(sdhci_read_1, bcm_sdhci_read_1), + DEVMETHOD(sdhci_read_2, bcm_sdhci_read_2), + DEVMETHOD(sdhci_read_4, bcm_sdhci_read_4), + DEVMETHOD(sdhci_read_multi_4, bcm_sdhci_read_multi_4), + DEVMETHOD(sdhci_write_1, bcm_sdhci_write_1), + DEVMETHOD(sdhci_write_2, bcm_sdhci_write_2), + DEVMETHOD(sdhci_write_4, bcm_sdhci_write_4), + DEVMETHOD(sdhci_write_multi_4, bcm_sdhci_write_multi_4), + + { 0, 0 } +}; + +static devclass_t bcm_sdhci_devclass; + +static driver_t bcm_sdhci_driver = { + "sdhci_bcm", + bcm_sdhci_methods, + sizeof(struct bcm_sdhci_softc), +}; + +DRIVER_MODULE(sdhci_bcm, simplebus, bcm_sdhci_driver, bcm_sdhci_devclass, 0, 0); +MODULE_DEPEND(sdhci_bcm, sdhci, 1, 1, 1); Modified: head/sys/arm/broadcom/bcm2835/files.bcm2835 ============================================================================== --- head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Oct 29 17:21:58 2012 (r242320) +++ head/sys/arm/broadcom/bcm2835/files.bcm2835 Mon Oct 29 17:23:45 2012 (r242321) @@ -4,6 +4,7 @@ arm/broadcom/bcm2835/bcm2835_fb.c optio arm/broadcom/bcm2835/bcm2835_intr.c standard arm/broadcom/bcm2835/bcm2835_machdep.c standard arm/broadcom/bcm2835/bcm2835_mbox.c standard +arm/broadcom/bcm2835/bcm2835_sdhci.c optional sdhci arm/broadcom/bcm2835/bcm2835_systimer.c standard arm/broadcom/bcm2835/bcm2835_wdog.c standard arm/broadcom/bcm2835/bus_space.c optional fdt Modified: head/sys/arm/conf/RPI-B ============================================================================== --- head/sys/arm/conf/RPI-B Mon Oct 29 17:21:58 2012 (r242320) +++ head/sys/arm/conf/RPI-B Mon Oct 29 17:23:45 2012 (r242321) @@ -61,7 +61,7 @@ options SYSVMSG #SYSV-style message q options SYSVSEM #SYSV-style semaphores options _KPOSIX_PRIORITY_SCHEDULING #Posix P1003_1B real-time extensions options KBD_INSTALL_CDEV # install a CDEV entry in /dev -#options ROOTDEVNAME=\"ufs:/dev/da0s1a\" +#options ROOTDEVNAME=\"ufs:mmcsd0s2\" options PREEMPTION @@ -80,6 +80,10 @@ device pty # options SC_DFLT_FONT # compile font in # makeoptions SC_DFLT_FONT=cp437 +device sdhci +device mmc +device mmcsd + options KDB options DDB #Enable the kernel debugger options INVARIANTS #Enable calls of extra sanity checking Modified: head/sys/dev/mmc/mmc.c ============================================================================== --- head/sys/dev/mmc/mmc.c Mon Oct 29 17:21:58 2012 (r242320) +++ head/sys/dev/mmc/mmc.c Mon Oct 29 17:23:45 2012 (r242321) @@ -1731,3 +1731,4 @@ static devclass_t mmc_devclass; DRIVER_MODULE(mmc, ti_mmchs, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, at91_mci, mmc_driver, mmc_devclass, NULL, NULL); DRIVER_MODULE(mmc, sdhci_pci, mmc_driver, mmc_devclass, NULL, NULL); +DRIVER_MODULE(mmc, sdhci_bcm, mmc_driver, mmc_devclass, NULL, NULL); From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 17:52:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F1FDE21F; Mon, 29 Oct 2012 17:52:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA12D8FC0A; Mon, 29 Oct 2012 17:52:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9THqhG9012852; Mon, 29 Oct 2012 17:52:43 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9THqhBo012848; Mon, 29 Oct 2012 17:52:43 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210291752.q9THqhBo012848@svn.freebsd.org> From: Edward Tomasz Napierala Date: Mon, 29 Oct 2012 17:52:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242322 - in head/sys: cam/scsi geom X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 17:52:44 -0000 Author: trasz Date: Mon Oct 29 17:52:43 2012 New Revision: 242322 URL: http://svn.freebsd.org/changeset/base/242322 Log: Fix locking problem in disk_resize(); previously it would run without topology lock, resulting in assertion when running with DIAGNOSTIC. Reviewed by: mav (earlier version) Modified: head/sys/cam/scsi/scsi_da.c head/sys/geom/geom_disk.c head/sys/geom/geom_disk.h Modified: head/sys/cam/scsi/scsi_da.c ============================================================================== --- head/sys/cam/scsi/scsi_da.c Mon Oct 29 17:23:45 2012 (r242321) +++ head/sys/cam/scsi/scsi_da.c Mon Oct 29 17:52:43 2012 (r242322) @@ -2673,6 +2673,7 @@ dasetgeom(struct cam_periph *periph, uin struct da_softc *softc; struct disk_params *dp; u_int lbppbe, lalba; + int error; softc = (struct da_softc *)periph->softc; @@ -2779,10 +2780,9 @@ dasetgeom(struct cam_periph *periph, uin else softc->disk->d_flags &= ~DISKFLAG_CANDELETE; -/* Currently as of 6/13/2012, panics if DIAGNOSTIC is set */ -#ifndef DIAGNOSTIC - disk_resize(softc->disk); -#endif + error = disk_resize(softc->disk, M_NOWAIT); + if (error != 0) + xpt_print(periph->path, "disk_resize(9) failed, error = %d\n", error); } static void Modified: head/sys/geom/geom_disk.c ============================================================================== --- head/sys/geom/geom_disk.c Mon Oct 29 17:23:45 2012 (r242321) +++ head/sys/geom/geom_disk.c Mon Oct 29 17:52:43 2012 (r242322) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include #include #include @@ -66,7 +65,6 @@ struct g_disk_softc { struct sysctl_oid *sysctl_tree; char led[64]; uint32_t state; - struct task resize_task; }; static struct mtx g_disk_done_mtx; @@ -443,17 +441,22 @@ g_disk_dumpconf(struct sbuf *sb, const c } static void -g_disk_resize_task(void *context, int pending) +g_disk_resize(void *ptr, int flag) { + struct disk *dp; struct g_geom *gp; struct g_provider *pp; - struct disk *dp; - struct g_disk_softc *sc; - sc = (struct g_disk_softc *)context; - dp = sc->dp; + if (flag == EV_CANCEL) + return; + g_topology_assert(); + + dp = ptr; gp = dp->d_geom; + if (dp->d_destroyed || gp == NULL) + return; + LIST_FOREACH(pp, &gp->provider, provider) { if (pp->sectorsize != 0 && pp->sectorsize != dp->d_sectorsize) @@ -501,7 +504,6 @@ g_disk_create(void *arg, int flag) CTLFLAG_RW | CTLFLAG_TUN, sc->led, sizeof(sc->led), "LED name"); } - TASK_INIT(&sc->resize_task, 0, g_disk_resize_task, sc); pp->private = sc; dp->d_geom = gp; g_error_provider(pp, 0); @@ -684,22 +686,14 @@ disk_media_gone(struct disk *dp, int fla } } -void -disk_resize(struct disk *dp) +int +disk_resize(struct disk *dp, int flag) { - struct g_geom *gp; - struct g_disk_softc *sc; - int error; - gp = dp->d_geom; - - if (gp == NULL) - return; - - sc = gp->softc; + if (dp->d_destroyed || dp->d_geom == NULL) + return (0); - error = taskqueue_enqueue(taskqueue_thread, &sc->resize_task); - KASSERT(error == 0, ("taskqueue_enqueue(9) failed.")); + return (g_post_event(g_disk_resize, dp, flag, NULL)); } static void Modified: head/sys/geom/geom_disk.h ============================================================================== --- head/sys/geom/geom_disk.h Mon Oct 29 17:23:45 2012 (r242321) +++ head/sys/geom/geom_disk.h Mon Oct 29 17:52:43 2012 (r242322) @@ -111,7 +111,7 @@ void disk_gone(struct disk *disk); void disk_attr_changed(struct disk *dp, const char *attr, int flag); void disk_media_changed(struct disk *dp, int flag); void disk_media_gone(struct disk *dp, int flag); -void disk_resize(struct disk *dp); +int disk_resize(struct disk *dp, int flag); #define DISK_VERSION_00 0x58561059 #define DISK_VERSION_01 0x5856105a From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 18:04:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9AB7FCF8; Mon, 29 Oct 2012 18:04:39 +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 771B28FC08; Mon, 29 Oct 2012 18:04:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TI4dZo014971; Mon, 29 Oct 2012 18:04:39 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TI4dUe014958; Mon, 29 Oct 2012 18:04:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210291804.q9TI4dUe014958@svn.freebsd.org> From: Alexander Motin Date: Mon, 29 Oct 2012 18:04:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242323 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 18:04:39 -0000 Author: mav Date: Mon Oct 29 18:04:38 2012 New Revision: 242323 URL: http://svn.freebsd.org/changeset/base/242323 Log: Add basic BIO_DELETE support to GEOM RAID class for all RAID levels. If at least one subdisk in the volume supports it, BIO_DELETE requests will be propagated down. Unfortunatelly, for RAID levels with redundancy unmapped blocks will be mapped back during first rebuild/resync process. Sponsored by: iXsystems, Inc. MFC after: 1 month Modified: head/sys/geom/raid/g_raid.c head/sys/geom/raid/g_raid.h head/sys/geom/raid/md_ddf.c head/sys/geom/raid/md_intel.c head/sys/geom/raid/md_jmicron.c head/sys/geom/raid/md_nvidia.c head/sys/geom/raid/md_promise.c head/sys/geom/raid/md_sii.c head/sys/geom/raid/tr_concat.c head/sys/geom/raid/tr_raid0.c head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c Modified: head/sys/geom/raid/g_raid.c ============================================================================== --- head/sys/geom/raid/g_raid.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/g_raid.c Mon Oct 29 18:04:38 2012 (r242323) @@ -499,6 +499,34 @@ g_raid_get_diskname(struct g_raid_disk * } void +g_raid_get_disk_info(struct g_raid_disk *disk) +{ + struct g_consumer *cp = disk->d_consumer; + int error, len; + + /* Read kernel dumping information. */ + disk->d_kd.offset = 0; + disk->d_kd.length = OFF_MAX; + len = sizeof(disk->d_kd); + error = g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); + if (error) + disk->d_kd.di.dumper = NULL; + if (disk->d_kd.di.dumper == NULL) + G_RAID_DEBUG1(2, disk->d_softc, + "Dumping not supported by %s: %d.", + cp->provider->name, error); + + /* Read BIO_DELETE support. */ + error = g_getattr("GEOM::candelete", cp, &disk->d_candelete); + if (error) + disk->d_candelete = 0; + if (!disk->d_candelete) + G_RAID_DEBUG1(2, disk->d_softc, + "BIO_DELETE not supported by %s: %d.", + cp->provider->name, error); +} + +void g_raid_report_disk_state(struct g_raid_disk *disk) { struct g_raid_subdisk *sd; @@ -1052,6 +1080,31 @@ g_raid_kerneldump(struct g_raid_softc *s } static void +g_raid_candelete(struct g_raid_softc *sc, struct bio *bp) +{ + struct g_provider *pp; + struct g_raid_volume *vol; + struct g_raid_subdisk *sd; + int *val; + int i; + + val = (int *)bp->bio_data; + pp = bp->bio_to; + vol = pp->private; + *val = 0; + for (i = 0; i < vol->v_disks_count; i++) { + sd = &vol->v_subdisks[i]; + if (sd->sd_state == G_RAID_SUBDISK_S_NONE) + continue; + if (sd->sd_disk->d_candelete) { + *val = 1; + break; + } + } + g_io_deliver(bp, 0); +} + +static void g_raid_start(struct bio *bp) { struct g_raid_softc *sc; @@ -1073,7 +1126,9 @@ g_raid_start(struct bio *bp) case BIO_FLUSH: break; case BIO_GETATTR: - if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) + if (!strcmp(bp->bio_attribute, "GEOM::candelete")) + g_raid_candelete(sc, bp); + else if (!strcmp(bp->bio_attribute, "GEOM::kerneldump")) g_raid_kerneldump(sc, bp); else g_io_deliver(bp, EOPNOTSUPP); Modified: head/sys/geom/raid/g_raid.h ============================================================================== --- head/sys/geom/raid/g_raid.h Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/g_raid.h Mon Oct 29 18:04:38 2012 (r242323) @@ -153,6 +153,7 @@ struct g_raid_disk { struct g_consumer *d_consumer; /* GEOM disk consumer. */ void *d_md_data; /* Disk's metadata storage. */ struct g_kerneldump d_kd; /* Kernel dumping method/args. */ + int d_candelete; /* BIO_DELETE supported. */ uint64_t d_flags; /* Additional flags. */ u_int d_state; /* Disk state. */ u_int d_load; /* Disk average load. */ @@ -418,6 +419,7 @@ struct g_raid_volume * g_raid_create_vol const char *name, int id); struct g_raid_disk * g_raid_create_disk(struct g_raid_softc *sc); const char * g_raid_get_diskname(struct g_raid_disk *disk); +void g_raid_get_disk_info(struct g_raid_disk *disk); int g_raid_start_volume(struct g_raid_volume *vol); Modified: head/sys/geom/raid/md_ddf.c ============================================================================== --- head/sys/geom/raid/md_ddf.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_ddf.c Mon Oct 29 18:04:38 2012 (r242323) @@ -2087,7 +2087,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj struct g_raid_md_ddf_perdisk *pd; struct g_raid_md_ddf_object *mdi; struct g_geom *geom; - int error, result, len, be; + int error, result, be; char name[16]; G_RAID_DEBUG(1, "Tasting DDF on %s", cp->provider->name); @@ -2154,14 +2154,7 @@ g_raid_md_taste_ddf(struct g_raid_md_obj disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_ddf_new_disk(disk); @@ -2348,15 +2341,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec ddf_meta_update(&mdi->mdio_meta, &pd->pd_meta); g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, GET64(&pd->pd_meta, @@ -2675,15 +2660,7 @@ g_raid_md_ctl_ddf(struct g_raid_md_objec disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: head/sys/geom/raid/md_intel.c ============================================================================== --- head/sys/geom/raid/md_intel.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_intel.c Mon Oct 29 18:04:38 2012 (r242323) @@ -1369,14 +1369,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_intel_new_disk(disk); @@ -1556,15 +1549,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); intel_set_disk_sectors(&pd->pd_disk_meta, pp->mediasize / pp->sectorsize); @@ -2080,15 +2065,7 @@ g_raid_md_ctl_intel(struct g_raid_md_obj disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); memcpy(&pd->pd_disk_meta.serial[0], &serial[0], INTEL_SERIAL_LEN); Modified: head/sys/geom/raid/md_jmicron.c ============================================================================== --- head/sys/geom/raid/md_jmicron.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_jmicron.c Mon Oct 29 18:04:38 2012 (r242323) @@ -826,7 +826,7 @@ g_raid_md_taste_jmicron(struct g_raid_md struct jmicron_raid_conf *meta; struct g_raid_md_jmicron_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[16]; uint16_t vendor; @@ -945,14 +945,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_jmicron_new_disk(disk); @@ -1115,15 +1108,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1374,15 +1359,7 @@ g_raid_md_ctl_jmicron(struct g_raid_md_o cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_jmicron_start_disk(disk); Modified: head/sys/geom/raid/md_nvidia.c ============================================================================== --- head/sys/geom/raid/md_nvidia.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_nvidia.c Mon Oct 29 18:04:38 2012 (r242323) @@ -830,7 +830,7 @@ g_raid_md_taste_nvidia(struct g_raid_md_ struct nvidia_raid_conf *meta; struct g_raid_md_nvidia_perdisk *pd; struct g_geom *geom; - int error, result, spare, len; + int result, spare, len; char name[32]; uint16_t vendor; @@ -939,14 +939,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_nvidia_new_disk(disk); @@ -1117,15 +1110,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1377,15 +1362,7 @@ g_raid_md_ctl_nvidia(struct g_raid_md_ob cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_nvidia_start_disk(disk); Modified: head/sys/geom/raid/md_promise.c ============================================================================== --- head/sys/geom/raid/md_promise.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_promise.c Mon Oct 29 18:04:38 2012 (r242323) @@ -1046,7 +1046,7 @@ g_raid_md_taste_promise(struct g_raid_md struct promise_raid_conf *meta, *metaarr[4]; struct g_raid_md_promise_perdisk *pd; struct g_geom *geom; - int error, i, j, result, len, subdisks; + int i, j, result, len, subdisks; char name[16]; uint16_t vendor; @@ -1142,14 +1142,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_promise_new_disk(disk); @@ -1337,15 +1330,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o break; } - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Reserve some space for metadata. */ size = MIN(size, pp->mediasize - 131072llu * pp->sectorsize); @@ -1659,15 +1644,7 @@ g_raid_md_ctl_promise(struct g_raid_md_o disk->d_md_data = (void *)pd; cp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ g_raid_change_disk_state(disk, G_RAID_DISK_S_SPARE); Modified: head/sys/geom/raid/md_sii.c ============================================================================== --- head/sys/geom/raid/md_sii.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/md_sii.c Mon Oct 29 18:04:38 2012 (r242323) @@ -912,7 +912,7 @@ g_raid_md_taste_sii(struct g_raid_md_obj struct sii_raid_conf *meta; struct g_raid_md_sii_perdisk *pd; struct g_geom *geom; - int error, disk_pos, result, spare, len; + int disk_pos, result, spare, len; char name[32]; uint16_t vendor; @@ -1032,14 +1032,7 @@ search: disk->d_consumer = rcp; rcp->private = disk; - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - error = g_io_getattr("GEOM::kerneldump", rcp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, "Dumping not supported by %s: %d.", - rcp->provider->name, error); + g_raid_get_disk_info(disk); g_raid_md_sii_new_disk(disk); @@ -1201,15 +1194,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); pd->pd_disk_size = pp->mediasize; if (size > pp->mediasize) @@ -1459,15 +1444,7 @@ g_raid_md_ctl_sii(struct g_raid_md_objec cp->private = disk; g_topology_unlock(); - /* Read kernel dumping information. */ - disk->d_kd.offset = 0; - disk->d_kd.length = OFF_MAX; - len = sizeof(disk->d_kd); - g_io_getattr("GEOM::kerneldump", cp, &len, &disk->d_kd); - if (disk->d_kd.di.dumper == NULL) - G_RAID_DEBUG1(2, sc, - "Dumping not supported by %s.", - cp->provider->name); + g_raid_get_disk_info(disk); /* Welcome the "new" disk. */ update += g_raid_md_sii_start_disk(disk); Modified: head/sys/geom/raid/tr_concat.c ============================================================================== --- head/sys/geom/raid/tr_concat.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/tr_concat.c Mon Oct 29 18:04:38 2012 (r242323) @@ -248,7 +248,8 @@ g_raid_tr_iostart_concat(struct g_raid_t cbp->bio_caller1 = sd; bioq_insert_tail(&queue, cbp); remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; offset = 0; no++; KASSERT(no < vol->v_disks_count || remain == 0, Modified: head/sys/geom/raid/tr_raid0.c ============================================================================== --- head/sys/geom/raid/tr_raid0.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/tr_raid0.c Mon Oct 29 18:04:38 2012 (r242323) @@ -234,7 +234,8 @@ g_raid_tr_iostart_raid0(struct g_raid_tr offset += strip_size; } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } while (remain > 0); for (cbp = bioq_first(&queue); cbp != NULL; Modified: head/sys/geom/raid/tr_raid1.c ============================================================================== --- head/sys/geom/raid/tr_raid1.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/tr_raid1.c Mon Oct 29 18:04:38 2012 (r242323) @@ -647,10 +647,8 @@ g_raid_tr_iostart_raid1(struct g_raid_tr g_raid_tr_iostart_raid1_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -893,7 +891,7 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_cmd == BIO_WRITE) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; if (bp->bio_error != 0) { Modified: head/sys/geom/raid/tr_raid1e.c ============================================================================== --- head/sys/geom/raid/tr_raid1e.c Mon Oct 29 17:52:43 2012 (r242322) +++ head/sys/geom/raid/tr_raid1e.c Mon Oct 29 18:04:38 2012 (r242323) @@ -802,7 +802,8 @@ nextdisk: } } remain -= length; - addr += length; + if (bp->bio_cmd != BIO_DELETE) + addr += length; start = 0; } for (cbp = bioq_first(&queue); cbp != NULL; @@ -858,10 +859,8 @@ g_raid_tr_iostart_raid1e(struct g_raid_t g_raid_tr_iostart_raid1e_read(tr, bp); break; case BIO_WRITE: - g_raid_tr_iostart_raid1e_write(tr, bp); - break; case BIO_DELETE: - g_raid_iodone(bp, EIO); + g_raid_tr_iostart_raid1e_write(tr, bp); break; case BIO_FLUSH: g_raid_tr_flush_common(tr, bp); @@ -1119,7 +1118,7 @@ rebuild_round_done: G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length); } - if (pbp->bio_cmd != BIO_READ) { + if (pbp->bio_cmd == BIO_WRITE) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; if (bp->bio_error != 0) { From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 18:06:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 826D5E7F; Mon, 29 Oct 2012 18:06:10 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 687558FC0A; Mon, 29 Oct 2012 18:06:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TI6AeV015264; Mon, 29 Oct 2012 18:06:10 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TI6AeU015261; Mon, 29 Oct 2012 18:06:10 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210291806.q9TI6AeU015261@svn.freebsd.org> From: Baptiste Daroussin Date: Mon, 29 Oct 2012 18:06:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242324 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 18:06:10 -0000 Author: bapt Date: Mon Oct 29 18:06:09 2012 New Revision: 242324 URL: http://svn.freebsd.org/changeset/base/242324 Log: backout r242319, racy and not done in the right place Reported by: Garrett Cooper Modified: head/lib/libutil/gr_util.c head/lib/libutil/pw_util.c Modified: head/lib/libutil/gr_util.c ============================================================================== --- head/lib/libutil/gr_util.c Mon Oct 29 18:04:38 2012 (r242323) +++ head/lib/libutil/gr_util.c Mon Oct 29 18:06:09 2012 (r242324) @@ -63,7 +63,6 @@ static const char group_line_format[] = int gr_init(const char *dir, const char *group) { - struct stat st; if (dir == NULL) { strcpy(group_dir, _PATH_ETC); @@ -91,14 +90,6 @@ gr_init(const char *dir, const char *gro strcpy(group_file, group); } - if (stat(group_file, &st) == -1) - return (-1); - - if (S_ISDIR(st.st_mode)) { - errno = EISDIR; - return (-1); - } - initialized = 1; return (0); } Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Mon Oct 29 18:04:38 2012 (r242323) +++ head/lib/libutil/pw_util.c Mon Oct 29 18:06:09 2012 (r242324) @@ -96,7 +96,6 @@ pw_init(const char *dir, const char *mas #if 0 struct rlimit rlim; #endif - struct stat st; if (dir == NULL) { strcpy(passwd_dir, _PATH_ETC); @@ -124,14 +123,6 @@ pw_init(const char *dir, const char *mas strcpy(masterpasswd, master); } - if (stat(masterpasswd, &st) == -1) - return (-1); - - if (S_ISDIR(st.st_mode)) { - errno = EISDIR; - return (-1); - } - /* * The code that follows is extremely disruptive to the calling * process, and is therefore disabled until someone can conceive From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 20:42:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD8A54FB; Mon, 29 Oct 2012 20:42:48 +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 C4A338FC12; Mon, 29 Oct 2012 20:42:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TKgmfV040406; Mon, 29 Oct 2012 20:42:48 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TKgmY5040403; Mon, 29 Oct 2012 20:42:48 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201210292042.q9TKgmY5040403@svn.freebsd.org> From: Michael Tuexen Date: Mon, 29 Oct 2012 20:42:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242325 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 20:42:48 -0000 Author: tuexen Date: Mon Oct 29 20:42:48 2012 New Revision: 242325 URL: http://svn.freebsd.org/changeset/base/242325 Log: Use ntohs() and htons() in correct order. However, this doesn't change functionality. Modified: head/sys/netinet/sctputil.c Modified: head/sys/netinet/sctputil.c ============================================================================== --- head/sys/netinet/sctputil.c Mon Oct 29 18:06:09 2012 (r242324) +++ head/sys/netinet/sctputil.c Mon Oct 29 20:42:48 2012 (r242325) @@ -6821,7 +6821,7 @@ sctp_recv_udp_tunneled_packet(struct mbu switch (iph->ip_v) { #ifdef INET case IPVERSION: - iph->ip_len = ntohs(htons(iph->ip_len) - sizeof(struct udphdr)); + iph->ip_len = htons(ntohs(iph->ip_len) - sizeof(struct udphdr)); sctp_input_with_port(m, off, port); break; #endif From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 20:44:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 093BA68B; Mon, 29 Oct 2012 20:44:30 +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 DFFC38FC0A; Mon, 29 Oct 2012 20:44:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TKiTKT040697; Mon, 29 Oct 2012 20:44:29 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TKiTWR040695; Mon, 29 Oct 2012 20:44:29 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201210292044.q9TKiTWR040695@svn.freebsd.org> From: Michael Tuexen Date: Mon, 29 Oct 2012 20:44:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242326 - head/sys/netinet X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 20:44:30 -0000 Author: tuexen Date: Mon Oct 29 20:44:29 2012 New Revision: 242326 URL: http://svn.freebsd.org/changeset/base/242326 Log: Add braces (as used elsewhere in the SCTP code). Modified: head/sys/netinet/sctp_output.c Modified: head/sys/netinet/sctp_output.c ============================================================================== --- head/sys/netinet/sctp_output.c Mon Oct 29 20:42:48 2012 (r242325) +++ head/sys/netinet/sctp_output.c Mon Oct 29 20:44:29 2012 (r242326) @@ -3981,9 +3981,9 @@ sctp_lowlevel_chunk_output(struct sctp_i } if ((nofragment_flag) && (port == 0)) { ip->ip_off = htons(IP_DF); - } else + } else { ip->ip_off = htons(0); - + } /* FreeBSD has a function for ip_id's */ ip->ip_id = ip_newid(); From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 20:47:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB86683F; Mon, 29 Oct 2012 20:47:33 +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 85D108FC0C; Mon, 29 Oct 2012 20:47:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TKlXrn041192; Mon, 29 Oct 2012 20:47:33 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TKlXDF041188; Mon, 29 Oct 2012 20:47:33 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201210292047.q9TKlXDF041188@svn.freebsd.org> From: Michael Tuexen Date: Mon, 29 Oct 2012 20:47:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242327 - in head/sys: netinet netinet6 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 20:47:33 -0000 Author: tuexen Date: Mon Oct 29 20:47:32 2012 New Revision: 242327 URL: http://svn.freebsd.org/changeset/base/242327 Log: Whitespace changes due to upstream integration of SCTP changes in the FreeBSD code base. Modified: head/sys/netinet/sctp_uio.h head/sys/netinet/sctp_var.h head/sys/netinet6/sctp6_var.h Modified: head/sys/netinet/sctp_uio.h ============================================================================== --- head/sys/netinet/sctp_uio.h Mon Oct 29 20:44:29 2012 (r242326) +++ head/sys/netinet/sctp_uio.h Mon Oct 29 20:47:32 2012 (r242327) @@ -1278,33 +1278,39 @@ void sctp_freeladdrs(struct sockaddr *); int sctp_opt_info(int, sctp_assoc_t, int, void *, socklen_t *); /* deprecated */ -ssize_t sctp_sendmsg -(int, const void *, size_t, const struct sockaddr *, +ssize_t +sctp_sendmsg(int, const void *, size_t, const struct sockaddr *, socklen_t, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); /* deprecated */ - ssize_t sctp_send(int, const void *, size_t, - const struct sctp_sndrcvinfo *, int); +ssize_t +sctp_send(int, const void *, size_t, + const struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendx(int, const void *, size_t, struct sockaddr *, - int, struct sctp_sndrcvinfo *, int); +ssize_t +sctp_sendx(int, const void *, size_t, struct sockaddr *, + int, struct sctp_sndrcvinfo *, int); /* deprecated */ - ssize_t sctp_sendmsgx(int sd, const void *, size_t, struct sockaddr *, - int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); +ssize_t +sctp_sendmsgx(int sd, const void *, size_t, struct sockaddr *, + int, uint32_t, uint32_t, uint16_t, uint32_t, uint32_t); - sctp_assoc_t sctp_getassocid(int, struct sockaddr *); +sctp_assoc_t sctp_getassocid(int, struct sockaddr *); /* deprecated */ - ssize_t sctp_recvmsg(int, void *, size_t, struct sockaddr *, socklen_t *, - struct sctp_sndrcvinfo *, int *); - - ssize_t sctp_sendv(int, const struct iovec *, int, struct sockaddr *, - int, void *, socklen_t, unsigned int, int); - - ssize_t sctp_recvv(int, const struct iovec *, int, struct sockaddr *, - socklen_t *, void *, socklen_t *, unsigned int *, int *); +ssize_t +sctp_recvmsg(int, void *, size_t, struct sockaddr *, socklen_t *, + struct sctp_sndrcvinfo *, int *); + +ssize_t +sctp_sendv(int, const struct iovec *, int, struct sockaddr *, + int, void *, socklen_t, unsigned int, int); + +ssize_t +sctp_recvv(int, const struct iovec *, int, struct sockaddr *, + socklen_t *, void *, socklen_t *, unsigned int *, int *); __END_DECLS Modified: head/sys/netinet/sctp_var.h ============================================================================== --- head/sys/netinet/sctp_var.h Mon Oct 29 20:44:29 2012 (r242326) +++ head/sys/netinet/sctp_var.h Mon Oct 29 20:47:32 2012 (r242327) @@ -321,48 +321,34 @@ struct sctphdr; void sctp_close(struct socket *so); int sctp_disconnect(struct socket *so); - void sctp_ctlinput(int, struct sockaddr *, void *); int sctp_ctloutput(struct socket *, struct sockopt *); #ifdef INET void sctp_input_with_port(struct mbuf *, int, uint16_t); - -#endif -#ifdef INET void sctp_input(struct mbuf *, int); #endif void sctp_pathmtu_adjustment(struct sctp_tcb *, uint16_t); void sctp_drain(void); void sctp_init(void); - void sctp_finish(void); - int sctp_flush(struct socket *, int); int sctp_shutdown(struct socket *); -void sctp_notify -(struct sctp_inpcb *, struct ip *ip, struct sctphdr *, +void +sctp_notify(struct sctp_inpcb *, struct ip *ip, struct sctphdr *, struct sockaddr *, struct sctp_tcb *, struct sctp_nets *); - - int sctp_bindx(struct socket *, int, struct sockaddr_storage *, - int, int, struct proc *); +int +sctp_bindx(struct socket *, int, struct sockaddr_storage *, + int, int, struct proc *); /* can't use sctp_assoc_t here */ - int sctp_peeloff(struct socket *, struct socket *, int, caddr_t, int *); - - int sctp_ingetaddr(struct socket *, - struct sockaddr ** -); - - int sctp_peeraddr(struct socket *, - struct sockaddr ** -); - - int sctp_listen(struct socket *, int, struct thread *); - - int sctp_accept(struct socket *, struct sockaddr **); +int sctp_peeloff(struct socket *, struct socket *, int, caddr_t, int *); +int sctp_ingetaddr(struct socket *, struct sockaddr **); +int sctp_peeraddr(struct socket *, struct sockaddr **); +int sctp_listen(struct socket *, int, struct thread *); +int sctp_accept(struct socket *, struct sockaddr **); #endif /* _KERNEL */ Modified: head/sys/netinet6/sctp6_var.h ============================================================================== --- head/sys/netinet6/sctp6_var.h Mon Oct 29 20:44:29 2012 (r242326) +++ head/sys/netinet6/sctp6_var.h Mon Oct 29 20:47:32 2012 (r242327) @@ -41,21 +41,15 @@ __FBSDID("$FreeBSD$"); SYSCTL_DECL(_net_inet6_sctp6); extern struct pr_usrreqs sctp6_usrreqs; - int sctp6_input(struct mbuf **, int *, int); -int sctp6_output -(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, +int +sctp6_output(struct sctp_inpcb *, struct mbuf *, struct sockaddr *, struct mbuf *, struct proc *); - void sctp6_ctlinput(int, struct sockaddr *, void *); - - - extern void sctp6_notify(struct sctp_inpcb *inp, - struct icmp6_hdr *icmph, - struct sctphdr *sh, - struct sockaddr *to, - struct sctp_tcb *stcb, - struct sctp_nets *net); +void sctp6_ctlinput(int, struct sockaddr *, void *); +extern void +sctp6_notify(struct sctp_inpcb *, struct icmp6_hdr *, + struct sctphdr *, struct sockaddr *, + struct sctp_tcb *, struct sctp_nets *); - -#endif /* _KERNEL */ +#endif #endif From owner-svn-src-head@FreeBSD.ORG Mon Oct 29 21:08:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 948BDFA; Mon, 29 Oct 2012 21:08: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 792AE8FC0A; Mon, 29 Oct 2012 21:08:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9TL877V044498; Mon, 29 Oct 2012 21:08:07 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9TL87r8044495; Mon, 29 Oct 2012 21:08:07 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210292108.q9TL87r8044495@svn.freebsd.org> From: Alexander Motin Date: Mon, 29 Oct 2012 21:08:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242328 - head/sys/geom/raid X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Oct 2012 21:08:07 -0000 Author: mav Date: Mon Oct 29 21:08:06 2012 New Revision: 242328 URL: http://svn.freebsd.org/changeset/base/242328 Log: Minor addition to r242323: Alike to BIO_WRITE, report success if at least one subdisk succeeded with BIO_DELETE. But unlike BIO_WRITE don't fail disk on BIO_DELETE error. Sponsored by: iXsystems, Inc. MFC after: 1 month Modified: head/sys/geom/raid/tr_raid1.c head/sys/geom/raid/tr_raid1e.c Modified: head/sys/geom/raid/tr_raid1.c ============================================================================== --- head/sys/geom/raid/tr_raid1.c Mon Oct 29 20:47:32 2012 (r242327) +++ head/sys/geom/raid/tr_raid1.c Mon Oct 29 21:08:06 2012 (r242328) @@ -891,10 +891,10 @@ rebuild_round_done: g_raid_unlock_range(sd->sd_volume, bp->bio_offset, bp->bio_length); } - if (pbp->bio_cmd == BIO_WRITE) { + if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1_fail_disk(sd->sd_softc, sd, sd->sd_disk); } Modified: head/sys/geom/raid/tr_raid1e.c ============================================================================== --- head/sys/geom/raid/tr_raid1e.c Mon Oct 29 20:47:32 2012 (r242327) +++ head/sys/geom/raid/tr_raid1e.c Mon Oct 29 21:08:06 2012 (r242328) @@ -1118,10 +1118,10 @@ rebuild_round_done: G_RAID_LOGREQ(2, bp, "REMAP done %d.", bp->bio_error); g_raid_unlock_range(sd->sd_volume, virtual, bp->bio_length); } - if (pbp->bio_cmd == BIO_WRITE) { + if (pbp->bio_cmd != BIO_READ) { if (pbp->bio_inbed == 1 || pbp->bio_error != 0) pbp->bio_error = bp->bio_error; - if (bp->bio_error != 0) { + if (pbp->bio_cmd == BIO_WRITE && bp->bio_error != 0) { G_RAID_LOGREQ(0, bp, "Write failed: failing subdisk."); g_raid_tr_raid1e_fail_disk(sd->sd_softc, sd, sd->sd_disk); } From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 01:29:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D19A9D4; Tue, 30 Oct 2012 01:29:46 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 74C5A8FC14; Tue, 30 Oct 2012 01:29:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U1Tk64085151; Tue, 30 Oct 2012 01:29:46 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U1TkrJ085149; Tue, 30 Oct 2012 01:29:46 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201210300129.q9U1TkrJ085149@svn.freebsd.org> From: Xin LI Date: Tue, 30 Oct 2012 01:29:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242332 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 01:29:46 -0000 Author: delphij Date: Tue Oct 30 01:29:45 2012 New Revision: 242332 URL: http://svn.freebsd.org/changeset/base/242332 Log: s/dettach/detach/g Approved by: pjd MFC after: 1 month Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Mon Oct 29 23:58:15 2012 (r242331) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/vdev_geom.c Tue Oct 30 01:29:45 2012 (r242332) @@ -332,7 +332,7 @@ vdev_geom_attach_taster(struct g_consume } static void -vdev_geom_dettach_taster(struct g_consumer *cp) +vdev_geom_detach_taster(struct g_consumer *cp) { g_access(cp, -1, 0, 0); g_detach(cp); @@ -373,7 +373,7 @@ vdev_geom_read_pool_label(const char *na g_topology_unlock(); error = vdev_geom_read_config(zcp, &vdev_cfg); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (error) continue; ZFS_LOG(1, "successfully read vdev config"); @@ -442,7 +442,7 @@ vdev_geom_attach_by_guid(uint64_t guid) g_topology_unlock(); pguid = vdev_geom_read_guid(zcp); g_topology_lock(); - vdev_geom_dettach_taster(zcp); + vdev_geom_detach_taster(zcp); if (pguid != guid) continue; cp = vdev_geom_attach(pp); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 01:52:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2EDB18E; Tue, 30 Oct 2012 01:52:49 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C83FC8FC0A; Tue, 30 Oct 2012 01:52:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U1qnBA088922; Tue, 30 Oct 2012 01:52:49 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U1qnM9088920; Tue, 30 Oct 2012 01:52:49 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201210300152.q9U1qnM9088920@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 30 Oct 2012 01:52:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242333 - head/sys/dev/uart X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 01:52:50 -0000 Author: gonzo Date: Tue Oct 30 01:52:49 2012 New Revision: 242333 URL: http://svn.freebsd.org/changeset/base/242333 Log: Separate interrupts enable/disable logic from setting port parameters. Otherwise setting baud rate in TTY mode effectively disables TX/RX interrupts and renders port unusable. Modified: head/sys/dev/uart/uart_dev_pl011.c Modified: head/sys/dev/uart/uart_dev_pl011.c ============================================================================== --- head/sys/dev/uart/uart_dev_pl011.c Tue Oct 30 01:29:45 2012 (r242332) +++ head/sys/dev/uart/uart_dev_pl011.c Tue Oct 30 01:52:49 2012 (r242333) @@ -120,16 +120,12 @@ uart_pl011_probe(struct uart_bas *bas) } static void -uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, +uart_pl011_param(struct uart_bas *bas, int baudrate, int databits, int stopbits, int parity) { uint32_t ctrl, line; uint32_t baud; - /* Mask all interrupts */ - __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & - ~IMSC_MASK_ALL); - /* * Zero all settings to make sure * UART is disabled and not configured @@ -179,6 +175,17 @@ uart_pl011_init(struct uart_bas *bas, in } static void +uart_pl011_init(struct uart_bas *bas, int baudrate, int databits, int stopbits, + int parity) +{ + /* Mask all interrupts */ + __uart_setreg(bas, UART_IMSC, __uart_getreg(bas, UART_IMSC) & + ~IMSC_MASK_ALL); + + uart_pl011_param(bas, baudrate, databits, stopbits, parity); +} + +static void uart_pl011_term(struct uart_bas *bas) { } @@ -358,7 +365,7 @@ uart_pl011_bus_param(struct uart_softc * { uart_lock(sc->sc_hwmtx); - uart_pl011_init(&sc->sc_bas, baudrate, databits, stopbits, parity); + uart_pl011_param(&sc->sc_bas, baudrate, databits, stopbits, parity); uart_unlock(sc->sc_hwmtx); return (0); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 02:25:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 485849B6; Tue, 30 Oct 2012 02:25:45 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id E91408FC08; Tue, 30 Oct 2012 02:25:44 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so4914043pbb.13 for ; Mon, 29 Oct 2012 19:25:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=6EzEyETw8/byRhcC1Lwp4LefEWR5u0Zbj8WPps0Mny8=; b=wnN0iDFYAOguuZxWzhhE6GZkn78tHkI1i1Q2pjY15RyQHCxeQNrGitEPxVCfHcZZWZ imZSMT6UGKNOvtiX0t6IeWWixgvcvW+PYP7mrg751Tyeokl117PvffwRdaUEg6PrLMAl 323za9Qif86QUi3oMwL4jd2XlO6aBH3Hu3bvNnl/mCA41pGKPkP0aUHGnJu/1Us4aNvf m49ngqpHrV0JANabR7lGJTkmCduPDw8vV6KzJavFCv5auDcm7UTLCXfTTYHjnonuRhlo OUv7zEooKn+4/zd51GFwP1sr9yRDhANIwQNF3XPmKyaasKyEcslKPwBmOr7Fip31cKCd UYlw== Received: by 10.68.204.2 with SMTP id ku2mr98713956pbc.59.1351563944507; Mon, 29 Oct 2012 19:25:44 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id j8sm6885067paz.30.2012.10.29.19.25.38 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 29 Oct 2012 19:25:41 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 30 Oct 2012 11:25:07 +0900 From: YongHyeon PYUN Date: Tue, 30 Oct 2012 11:25:07 +0900 To: Andre Oppermann Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf Message-ID: <20121030022507.GB4298@michelle.cdnetworks.com> References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> <20121029052100.GO70741@FreeBSD.org> <20121029214038.GD1431@michelle.cdnetworks.com> <508E3C6B.2090102@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <508E3C6B.2090102@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 02:25:45 -0000 On Mon, Oct 29, 2012 at 09:20:59AM +0100, Andre Oppermann wrote: > On 29.10.2012 22:40, YongHyeon PYUN wrote: > >On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote: > >>On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: > >>Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: > >>Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: > >>Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: > >>Y> > A> > Author: glebius > >>Y> > A> > Date: Fri Oct 26 21:06:33 2012 > >>Y> > A> > New Revision: 242161 > >>Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 > >>Y> > A> > > >>Y> > A> > Log: > >>Y> > A> > o Remove last argument to ip_fragment(), and obtain all > >>needed information > >>Y> > A> > on checksums directly from mbuf flags. This simplifies > >>code. > >>Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did > >>checksums in > >>Y> > >>Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented > >>Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) > >>Y> requires CSUM_IP should be set for IP fragmented packets. Not sure > >>Y> whether it's a bug or not. I have a ti(4) controller but I don't > >>Y> remember where I can find it and don't have a link > >>Y> parter(1000baseSX) to test it. :-( > >> > >>ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do > > > >Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4) > >is the only controller that supports TCP/UDP checksum offloading > >for an IP fragmented packet. > > This is a bit weird if it doesn't do the fragmentation itself. > Computing the IP header checksum doesn't differ for normal and > fragmented packets. The protocol checksum (TCP or UDP) stays > the same for in the case of IP level fragmentation. It is only > visible in the first fragment which includes the protocol header. My interpretation for CSUM_IP_FRAGS works like the following. - Only peuso header checksum for TCP/UDP is computed by upper stack. - Controller has no ability to fragment the packet so it should done in upper stack(i.e. ip_output()). - When ip_output() has to fragment the packet, it just fragments the packet without completing TCP/UDP and IP checksum. If controller does not support CSUM_IP_FRAGS feature, ip_output() can't delay TCP/UDP checksum in this stage. - The fragmented packets are sent to driver. Driver sets appropriate bits of DMA descriptor based on fragmentation field of mbuf(M_FRAG, M_LASTFRAG) and issue the frame to controller. - The firmware of controller queues the fragmented frames up in its internal memory and hold off sending out the frames since it has to compute TCP/UDP checksum. When it sees a frame which indicates the end of fragmented frame it finally computes TCP/UDP checksum and send each frame out to wire by computing IP checksum on the fly. The difference is which one(upper stack vs. controller) computes TCP/UDP/IP checksum. > > >>software checksums, and thus won't clear these flags. > >> > >>Potentially a driver that announces one flag in if_hwassist but relies on > >>couple of flags to be set on mbuf is not correct. If a driver can't do > >>single > >>checksum processing independently from others, then it should set or > >>clear > >>appropriate flags in if_hwassist as a group. > > > >Hmm, then what would be best way to achieve CSUM_IP_FRAGS in > >driver? I don't have clear idea how to utilize the hardware > >feature. The stack should tell that the mbuf needs TCP/UDP checksum > >offloading for IP fragmented packet(i.e. CSUM_IP_FRAGS is not set by > >upper stack). > > As I said there can't be fragment checksumming without hardware It's up to controller's firmware. It does not send the fragmented frame until it computes TCP/UDP checksum. > based fragmentation. We have three cases here: > > 1. TSO where the hardware does the segmentation, TCP and IP header > checksums for each generated packet. > 2. IP packet fragmentation where a packet is split, the IP header > checksum is recomputed for each fragment, but the protocol csum > stays the same and is not modified. > 3. UDP fragmentation where a large packet is sent to the hardware > and it generates first the UDP checksum and then splits it into > IP fragments each with its own IP header checksum. > > So we end up with these possible large send hardware offload capabilities: > TSO: including IPv4hdr and TCP checksumming > UDP fragmentation: including IPv4hdr and UDP checksumming > IP fragmentation: including IPv4hdr checksumming > > Besides that we have the packet <= MTU sized offload capabilities: > TCP checksumming > UDP checksumming > SCTP checksumming > IPv4hdr checksumming > > >>Y> > A> > hardware. Some driver may not announce CSUM_IP in theur > >>if_hwassist, > >> ^^^^^^^^ > >> > >>Oh, that was a typo! Software was meant. > > That explains quite a bit of confusion. > > -- > Andre > From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 06:07:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 835D234F; Tue, 30 Oct 2012 06:07:31 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A18F8FC12; Tue, 30 Oct 2012 06:07:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U67V5Q028944; Tue, 30 Oct 2012 06:07:31 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U67VFd028939; Tue, 30 Oct 2012 06:07:31 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210300607.q9U67VFd028939@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Oct 2012 06:07:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242342 - in head/sys: contrib/octeon-sdk mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 06:07:31 -0000 Author: jmallett Date: Tue Oct 30 06:07:30 2012 New Revision: 242342 URL: http://svn.freebsd.org/changeset/base/242342 Log: Speed feature tests and initialize helper configuration that some CPUs require. Modified: head/sys/contrib/octeon-sdk/octeon-feature.c head/sys/contrib/octeon-sdk/octeon-feature.h head/sys/mips/cavium/files.octeon1 head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/contrib/octeon-sdk/octeon-feature.c ============================================================================== --- head/sys/contrib/octeon-sdk/octeon-feature.c Tue Oct 30 04:31:32 2012 (r242341) +++ head/sys/contrib/octeon-sdk/octeon-feature.c Tue Oct 30 06:07:30 2012 (r242342) @@ -139,7 +139,7 @@ feature_check: cvmx_dprintf("unknown error %d.\n", val); break; } -#if !defined(CVMX_BUILD_FOR_LINUX_KERNEL) && !defined(__U_BOOT__) && !defined(CVMX_BUILD_FOR_TOOLCHAIN) +#if !defined(CVMX_BUILD_FOR_LINUX_KERNEL) && !defined(__U_BOOT__) && !defined(CVMX_BUILD_FOR_TOOLCHAIN) && !defined(CVMX_BUILD_FOR_FREEBSD_KERNEL) exit (1); #endif } Modified: head/sys/contrib/octeon-sdk/octeon-feature.h ============================================================================== --- head/sys/contrib/octeon-sdk/octeon-feature.h Tue Oct 30 04:31:32 2012 (r242341) +++ head/sys/contrib/octeon-sdk/octeon-feature.h Tue Oct 30 06:07:30 2012 (r242342) @@ -281,7 +281,7 @@ extern uint8_t octeon_feature_map[FEATUR #if defined(__U_BOOT__) || defined(CVMX_BUILD_FOR_LINUX_HOST) || defined(CVMX_BUILD_FOR_TOOLCHAIN) #define octeon_has_feature old_octeon_has_feature #else -#if defined(USE_RUNTIME_MODEL_CHECKS) +#if defined(USE_RUNTIME_MODEL_CHECKS) || (defined(__FreeBSD__) && defined(_KERNEL)) static inline int octeon_has_feature(octeon_feature_t feature) { int byte, bit; Modified: head/sys/mips/cavium/files.octeon1 ============================================================================== --- head/sys/mips/cavium/files.octeon1 Tue Oct 30 04:31:32 2012 (r242341) +++ head/sys/mips/cavium/files.octeon1 Tue Oct 30 06:07:30 2012 (r242342) @@ -61,6 +61,7 @@ contrib/octeon-sdk/cvmx-clock.c standa contrib/octeon-sdk/cvmx-ebt3000.c standard contrib/octeon-sdk/cvmx-fpa.c standard contrib/octeon-sdk/cvmx-helper.c standard +contrib/octeon-sdk/cvmx-helper-cfg.c standard contrib/octeon-sdk/cvmx-helper-board.c standard contrib/octeon-sdk/cvmx-helper-cfg.c standard contrib/octeon-sdk/cvmx-helper-errata.c standard @@ -89,6 +90,7 @@ contrib/octeon-sdk/cvmx-sysinfo.c stand contrib/octeon-sdk/cvmx-thunder.c standard contrib/octeon-sdk/cvmx-twsi.c standard contrib/octeon-sdk/cvmx-warn.c standard +contrib/octeon-sdk/octeon-feature.c standard contrib/octeon-sdk/octeon-model.c standard # HWPMC Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 04:31:32 2012 (r242341) +++ head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:07:30 2012 (r242342) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -598,6 +599,10 @@ octeon_boot_params_init(register_t ptr) panic("Your boot loader did not supply a memory descriptor."); cvmx_bootmem_init(cvmx_sysinfo_get()->phy_mem_desc_addr); + octeon_feature_init(); + + __cvmx_helper_cfg_init(); + printf("Boot Descriptor Ver: %u -> %u/%u", app_desc_ptr->desc_version, octeon_bootinfo->major_version, octeon_bootinfo->minor_version); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 06:11:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 505204E4; Tue, 30 Oct 2012 06:11:10 +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 37FA88FC08; Tue, 30 Oct 2012 06:11:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U6BAaA029558; Tue, 30 Oct 2012 06:11:10 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U6BA10029556; Tue, 30 Oct 2012 06:11:10 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201210300611.q9U6BA10029556@svn.freebsd.org> From: Andrew Turner Date: Tue, 30 Oct 2012 06:11:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242343 - head/sys/arm/lpc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 06:11:10 -0000 Author: andrew Date: Tue Oct 30 06:11:09 2012 New Revision: 242343 URL: http://svn.freebsd.org/changeset/base/242343 Log: Move the call to platform_gpio_init() into initarm_gpio_init() to reduce the diff to the other FDT versions of initarm. Modified: head/sys/arm/lpc/lpc_machdep.c Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Tue Oct 30 06:07:30 2012 (r242342) +++ head/sys/arm/lpc/lpc_machdep.c Tue Oct 30 06:11:09 2012 (r242343) @@ -542,11 +542,6 @@ initarm(struct arm_boot_params *abp) */ physmap_init(); - /* - * Set initial values of GPIO output ports - */ - platform_gpio_init(); - /* Do basic tuning, hz etc */ init_param2(physmem); kdb_init(); @@ -569,6 +564,11 @@ initarm_lastaddr(void) void initarm_gpio_init(void) { + + /* + * Set initial values of GPIO output ports + */ + platform_gpio_init(); } void From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 06:19:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2117B7B3; Tue, 30 Oct 2012 06:19:47 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 091AC8FC12; Tue, 30 Oct 2012 06:19:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U6Jkwl031331; Tue, 30 Oct 2012 06:19:46 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U6Jkk1031329; Tue, 30 Oct 2012 06:19:46 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210300619.q9U6Jkk1031329@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Oct 2012 06:19:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242344 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 06:19:47 -0000 Author: jmallett Date: Tue Oct 30 06:19:46 2012 New Revision: 242344 URL: http://svn.freebsd.org/changeset/base/242344 Log: Remove stale declarations. Modified: head/sys/mips/cavium/octeon_machdep.c Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:11:09 2012 (r242343) +++ head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:19:46 2012 (r242344) @@ -130,9 +130,6 @@ static const struct octeon_feature_descr { 0, NULL } }; -uint64_t ciu_get_en_reg_addr_new(int corenum, int intx, int enx, int ciu_ip); -void ciu_dump_interrutps_enabled(int core_num, int intx, int enx, int ciu_ip); - static uint64_t octeon_get_ticks(void); static unsigned octeon_get_timecount(struct timecounter *tc); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 06:29:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 223BD984; Tue, 30 Oct 2012 06:29:18 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07D3D8FC08; Tue, 30 Oct 2012 06:29:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U6THvM033156; Tue, 30 Oct 2012 06:29:17 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U6THoX033153; Tue, 30 Oct 2012 06:29:17 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210300629.q9U6THoX033153@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Oct 2012 06:29:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242345 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 06:29:18 -0000 Author: jmallett Date: Tue Oct 30 06:29:17 2012 New Revision: 242345 URL: http://svn.freebsd.org/changeset/base/242345 Log: Remove oct_read64 and oct_write64 and use their equivalents from the Simple Executive, which are used everywhere else in the Octeon port. While here, remove other unused things from octeon_pcmap_regs.h. Modified: head/sys/mips/cavium/octeon_pcmap_regs.h head/sys/mips/cavium/uart_cpu_octeonusart.c Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:19:46 2012 (r242344) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:29:17 2012 (r242345) @@ -47,148 +47,14 @@ #define __OCTEON_PCMAP_REGS_H__ #ifndef LOCORE - -/* - * Utility inlines & macros - */ - -#if defined(__mips_n64) -#define oct_write64(a, v) (*(volatile uint64_t *)(a) = (uint64_t)(v)) - -#define OCT_READ(n, t) \ -static inline t oct_read ## n(uintptr_t a) \ -{ \ - volatile t *p = (volatile t *)a; \ - return (*p); \ -} - -OCT_READ(64, uint64_t); - -#elif defined(__mips_n32) || defined(__mips_o32) -#if defined(__mips_n32) -static inline void oct_write64 (uint64_t csr_addr, uint64_t val64) -{ - __asm __volatile ( - ".set push\n" - ".set mips64\n" - "sd %0, 0(%1)\n" - ".set pop\n" - : - : "r"(val64), "r"(csr_addr)); -} - -#define OCT_READ(n, t, insn) \ -static inline t oct_read ## n(uint64_t a) \ -{ \ - uint64_t tmp; \ - \ - __asm __volatile ( \ - ".set push\n" \ - ".set mips64\n" \ - insn "\t%0, 0(%1)\n" \ - ".set pop\n" \ - : "=r"(tmp) \ - : "r"(a)); \ - return ((t)tmp); \ -} - -OCT_READ(64, uint64_t, "ld"); -#else - -/* - * XXX - * Add o32 variants that load the address into a register and the result out - * of a register properly, and simply disable interrupts before and after and - * hope that we don't need to refill or modify the TLB to access the address. - * I'd be a lot happier if csr_addr were a physical address and we mapped it - * into XKPHYS here so that we could guarantee that interrupts were the only - * kind of exception we needed to worry about. - * - * Also, some of this inline assembly is needlessly verbose. Oh, well. - */ -static inline void oct_write64 (uint64_t csr_addr, uint64_t val64) -{ - uint32_t csr_addrh = csr_addr >> 32; - uint32_t csr_addrl = csr_addr; - uint32_t valh = val64 >> 32; - uint32_t vall = val64; - uint32_t tmp1; - uint32_t tmp2; - uint32_t tmp3; - register_t sr; - - sr = intr_disable(); - - __asm __volatile ( - ".set push\n" - ".set mips64\n" - ".set noreorder\n" - ".set noat\n" - "dsll %0, %3, 32\n" - "dsll %1, %5, 32\n" - "dsll %2, %4, 32\n" - "dsrl %2, %2, 32\n" - "or %0, %0, %2\n" - "dsll %2, %6, 32\n" - "dsrl %2, %2, 32\n" - "or %1, %1, %2\n" - "sd %0, 0(%1)\n" - ".set pop\n" - : "=&r" (tmp1), "=&r" (tmp2), "=&r" (tmp3) - : "r" (valh), "r" (vall), "r" (csr_addrh), "r" (csr_addrl)); - - intr_restore(sr); -} - -static inline uint64_t oct_read64 (uint64_t csr_addr) -{ - uint32_t csr_addrh = csr_addr >> 32; - uint32_t csr_addrl = csr_addr; - uint32_t valh; - uint32_t vall; - register_t sr; - - sr = intr_disable(); - - __asm __volatile ( - ".set push\n" - ".set mips64\n" - ".set noreorder\n" - ".set noat\n" - "dsll %0, %2, 32\n" - "dsll %1, %3, 32\n" - "dsrl %1, %1, 32\n" - "or %0, %0, %1\n" - "ld %1, 0(%0)\n" - "dsrl %0, %1, 32\n" - "dsll %1, %1, 32\n" - "dsrl %1, %1, 32\n" - ".set pop\n" - : "=&r" (valh), "=&r" (vall) - : "r" (csr_addrh), "r" (csr_addrl)); - - intr_restore(sr); - - return ((uint64_t)valh << 32) | vall; -} -#endif - -#endif - /* * octeon_machdep.c * * Direct to Board Support level. */ -extern void octeon_reset(void); -extern void octeon_debug_symbol(void); -extern void octeon_ciu_reset(void); -extern int octeon_is_simulation(void); +void octeon_debug_symbol(void); +void octeon_ciu_reset(void); +int octeon_is_simulation(void); #endif /* LOCORE */ -/* - * Default FLASH device (physical) base address - */ -#define OCTEON_FLASH_BASE_ADDR (0x1d040000ull) - #endif /* !OCTEON_PCMAP_REGS_H__ */ Modified: head/sys/mips/cavium/uart_cpu_octeonusart.c ============================================================================== --- head/sys/mips/cavium/uart_cpu_octeonusart.c Tue Oct 30 06:19:46 2012 (r242344) +++ head/sys/mips/cavium/uart_cpu_octeonusart.c Tue Oct 30 06:29:17 2012 (r242345) @@ -58,56 +58,56 @@ static uint8_t ou_bs_r_1(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + offset)); + return (cvmx_read64_uint64(handle + offset)); } static uint16_t ou_bs_r_2(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + offset)); + return (cvmx_read64_uint64(handle + offset)); } static uint32_t ou_bs_r_4(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + offset)); + return (cvmx_read64_uint64(handle + offset)); } static uint64_t ou_bs_r_8(void *t, bus_space_handle_t handle, bus_size_t offset) { - return (oct_read64(handle + offset)); + return (cvmx_read64_uint64(handle + offset)); } static void ou_bs_w_1(void *t, bus_space_handle_t bsh, bus_size_t offset, uint8_t value) { - oct_write64(bsh + offset, value); + cvmx_write64_uint64(bsh + offset, value); } static void ou_bs_w_2(void *t, bus_space_handle_t bsh, bus_size_t offset, uint16_t value) { - oct_write64(bsh + offset, value); + cvmx_write64_uint64(bsh + offset, value); } static void ou_bs_w_4(void *t, bus_space_handle_t bsh, bus_size_t offset, uint32_t value) { - oct_write64(bsh + offset, value); + cvmx_write64_uint64(bsh + offset, value); } static void ou_bs_w_8(void *t, bus_space_handle_t bsh, bus_size_t offset, uint64_t value) { - oct_write64(bsh + offset, value); + cvmx_write64_uint64(bsh + offset, value); } struct bus_space octeon_uart_tag = { From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 06:36:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D735C22; Tue, 30 Oct 2012 06:36:15 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 322518FC08; Tue, 30 Oct 2012 06:36:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U6aFVQ034384; Tue, 30 Oct 2012 06:36:15 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U6aEBs034375; Tue, 30 Oct 2012 06:36:14 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210300636.q9U6aEBs034375@svn.freebsd.org> From: Juli Mallett Date: Tue, 30 Oct 2012 06:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242346 - in head/sys/mips/cavium: . octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 06:36:15 -0000 Author: jmallett Date: Tue Oct 30 06:36:14 2012 New Revision: 242346 URL: http://svn.freebsd.org/changeset/base/242346 Log: Actually check board type rather than using a specialized octeon_is_simulation function. Modified: head/sys/mips/cavium/octe/ethernet-common.c head/sys/mips/cavium/octe/ethernet-rgmii.c head/sys/mips/cavium/octe/ethernet-sgmii.c head/sys/mips/cavium/octe/ethernet-xaui.c head/sys/mips/cavium/octe/ethernet.c head/sys/mips/cavium/octeon_ebt3000_cf.c head/sys/mips/cavium/octeon_machdep.c head/sys/mips/cavium/octeon_pcmap_regs.h Modified: head/sys/mips/cavium/octe/ethernet-common.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-common.c Tue Oct 30 06:36:14 2012 (r242346) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" -extern int octeon_is_simulation(void); - static uint64_t cvm_oct_mac_addr = 0; static uint32_t cvm_oct_mac_addr_offset = 0; @@ -243,7 +241,7 @@ int cvm_oct_common_open(struct ifnet *if /* * Set the link state unless we are using MII. */ - if (!octeon_is_simulation() && priv->miibus == NULL) { + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM && priv->miibus == NULL) { link_info = cvmx_helper_link_get(priv->port); if (!link_info.s.link_up) if_link_state_change(ifp, LINK_STATE_DOWN); @@ -282,7 +280,7 @@ void cvm_oct_common_poll(struct ifnet *i /* * If this is a simulation, do nothing. */ - if (octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) return; /* Modified: head/sys/mips/cavium/octe/ethernet-rgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-rgmii.c Tue Oct 30 06:36:14 2012 (r242346) @@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$"); #include "octebusvar.h" -extern int octeon_is_simulation(void); extern struct ifnet *cvm_oct_device[]; static struct mtx global_register_lock; @@ -256,7 +255,7 @@ int cvm_oct_rgmii_init(struct ifnet *ifp if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) || (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) { - if (!octeon_is_simulation()) { + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) { cvmx_gmxx_rxx_int_en_t gmx_rx_int_en; int interface = INTERFACE(priv->port); @@ -285,7 +284,7 @@ void cvm_oct_rgmii_uninit(struct ifnet * if (((priv->imode == CVMX_HELPER_INTERFACE_MODE_GMII) && (priv->port == 0)) || (priv->imode == CVMX_HELPER_INTERFACE_MODE_RGMII)) { - if (!octeon_is_simulation()) { + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) { cvmx_gmxx_rxx_int_en_t gmx_rx_int_en; int interface = INTERFACE(priv->port); Modified: head/sys/mips/cavium/octe/ethernet-sgmii.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-sgmii.c Tue Oct 30 06:36:14 2012 (r242346) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" -extern int octeon_is_simulation(void); - int cvm_oct_sgmii_init(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; Modified: head/sys/mips/cavium/octe/ethernet-xaui.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet-xaui.c Tue Oct 30 06:36:14 2012 (r242346) @@ -44,8 +44,6 @@ __FBSDID("$FreeBSD$"); #include "wrapper-cvmx-includes.h" #include "ethernet-headers.h" -extern int octeon_is_simulation(void); - int cvm_oct_xaui_init(struct ifnet *ifp) { cvm_oct_private_t *priv = (cvm_oct_private_t *)ifp->if_softc; Modified: head/sys/mips/cavium/octe/ethernet.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octe/ethernet.c Tue Oct 30 06:36:14 2012 (r242346) @@ -74,8 +74,6 @@ TUNABLE_INT("hw.octe.pow_receive_group", "\t\tgroup. Also any other software can submit packets to this\n" "\t\tgroup for the kernel to process." */ -extern int octeon_is_simulation(void); - /** * Periodic timer to check auto negotiation */ @@ -228,7 +226,7 @@ static void cvm_oct_configure_common_hw( num_packet_buffers/8); /* Enable the MII interface */ - if (!octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type != CVMX_BOARD_TYPE_SIM) cvmx_write_csr(CVMX_SMI_EN, 1); /* Register an IRQ hander for to receive POW interrupts */ Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Tue Oct 30 06:36:14 2012 (r242346) @@ -590,7 +590,7 @@ static void cf_swap_ascii (unsigned char static int cf_probe (device_t dev) { - if (octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) return (ENXIO); if (device_get_unit(dev) != 0) { @@ -618,7 +618,7 @@ static void cf_identify (driver_t *drv, cvmx_mio_boot_reg_cfgx_t cfg; uint64_t phys_base; - if (octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) return; phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr; @@ -694,7 +694,7 @@ static int cf_attach (device_t dev) struct cf_priv *cf_priv; int error; - if (octeon_is_simulation()) + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) return (ENXIO); cf_priv = device_get_softc(dev); Modified: head/sys/mips/cavium/octeon_machdep.c ============================================================================== --- head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_machdep.c Tue Oct 30 06:36:14 2012 (r242346) @@ -211,7 +211,7 @@ octeon_memory_init(void) phys_end = round_page(MIPS_KSEG0_TO_PHYS((vm_offset_t)&end)); - if (octeon_is_simulation()) { + if (cvmx_sysinfo_get()->board_type == CVMX_BOARD_TYPE_SIM) { /* Simulator we limit to 96 meg */ phys_avail[0] = phys_end; phys_avail[1] = 96 << 20; @@ -518,17 +518,6 @@ cvmx_bootinfo_t *octeon_bootinfo; static octeon_boot_descriptor_t *app_desc_ptr; -int -octeon_is_simulation(void) -{ - switch (cvmx_sysinfo_get()->board_type) { - case CVMX_BOARD_TYPE_SIM: - return 1; - default: - return 0; - } -} - static void octeon_process_app_desc_ver_6(void) { Modified: head/sys/mips/cavium/octeon_pcmap_regs.h ============================================================================== --- head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:29:17 2012 (r242345) +++ head/sys/mips/cavium/octeon_pcmap_regs.h Tue Oct 30 06:36:14 2012 (r242346) @@ -54,7 +54,6 @@ */ void octeon_debug_symbol(void); void octeon_ciu_reset(void); -int octeon_is_simulation(void); #endif /* LOCORE */ #endif /* !OCTEON_PCMAP_REGS_H__ */ From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 07:55:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 699B1A6C; Tue, 30 Oct 2012 07:55:04 +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 472328FC0A; Tue, 30 Oct 2012 07:55:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U7t4OY046180; Tue, 30 Oct 2012 07:55:04 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U7t4fZ046178; Tue, 30 Oct 2012 07:55:04 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201210300755.q9U7t4fZ046178@svn.freebsd.org> From: Pyun YongHyeon Date: Tue, 30 Oct 2012 07:55:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242348 - head/sys/dev/age X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 07:55:04 -0000 Author: yongari Date: Tue Oct 30 07:55:03 2012 New Revision: 242348 URL: http://svn.freebsd.org/changeset/base/242348 Log: TSO engine of L1 requires a separate DMA descriptor for TCP payload. This means driver has to split a TX buffer into two pieces of TX buffers when the TX buffer contains both ethernet/IP/TCP header and partial TCP payload. The controller does not require all header should be in a TX buffer but driver forced it to compute IP/TCP header size/offset which is required parameter to configure DMA descriptor for TSO. While here, slightly reorder DMA descriptor setup to enhance readability and remove unnecessary code for TSO(upper stack never requests TSO when the frame length is less than or equal to MTU). Reported by: Yamagi Burmeister yamagi dot org> Tested by: Yamagi Burmeister yamagi dot org> MFC After: 1 week Modified: head/sys/dev/age/if_age.c Modified: head/sys/dev/age/if_age.c ============================================================================== --- head/sys/dev/age/if_age.c Tue Oct 30 07:51:18 2012 (r242347) +++ head/sys/dev/age/if_age.c Tue Oct 30 07:55:03 2012 (r242348) @@ -1495,7 +1495,7 @@ age_encap(struct age_softc *sc, struct m struct tcphdr *tcp; bus_dma_segment_t txsegs[AGE_MAXTXSEGS]; bus_dmamap_t map; - uint32_t cflags, ip_off, poff, vtag; + uint32_t cflags, hdrlen, ip_off, poff, vtag; int error, i, nsegs, prod, si; AGE_LOCK_ASSERT(sc); @@ -1562,8 +1562,12 @@ age_encap(struct age_softc *sc, struct m *m_head = NULL; return (ENOBUFS); } - ip = (struct ip *)(mtod(m, char *) + ip_off); tcp = (struct tcphdr *)(mtod(m, char *) + poff); + m = m_pullup(m, poff + (tcp->th_off << 2)); + if (m == NULL) { + *m_head = NULL; + return (ENOBUFS); + } /* * L1 requires IP/TCP header size and offset as * well as TCP pseudo checksum which complicates @@ -1578,14 +1582,11 @@ age_encap(struct age_softc *sc, struct m * Reset IP checksum and recompute TCP pseudo * checksum as NDIS specification said. */ + ip = (struct ip *)(mtod(m, char *) + ip_off); + tcp = (struct tcphdr *)(mtod(m, char *) + poff); ip->ip_sum = 0; - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, - htons((tcp->th_off << 2) + IPPROTO_TCP)); - else - tcp->th_sum = in_pseudo(ip->ip_src.s_addr, - ip->ip_dst.s_addr, htons(IPPROTO_TCP)); + tcp->th_sum = in_pseudo(ip->ip_src.s_addr, + ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } *m_head = m; } @@ -1627,23 +1628,48 @@ age_encap(struct age_softc *sc, struct m } m = *m_head; + /* Configure VLAN hardware tag insertion. */ + if ((m->m_flags & M_VLANTAG) != 0) { + vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); + vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); + cflags |= AGE_TD_INSERT_VLAN_TAG; + } + + desc = NULL; + i = 0; if ((m->m_pkthdr.csum_flags & CSUM_TSO) != 0) { - /* Configure TSO. */ - if (poff + (tcp->th_off << 2) == m->m_pkthdr.len) { - /* Not TSO but IP/TCP checksum offload. */ - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - /* Clear TSO in order not to set AGE_TD_TSO_HDR. */ - m->m_pkthdr.csum_flags &= ~CSUM_TSO; - } else { - /* Request TSO and set MSS. */ - cflags |= AGE_TD_TSO_IPV4; - cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; - cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << - AGE_TD_TSO_MSS_SHIFT); - } + /* Request TSO and set MSS. */ + cflags |= AGE_TD_TSO_IPV4; + cflags |= AGE_TD_IPCSUM | AGE_TD_TCPCSUM; + cflags |= ((uint32_t)m->m_pkthdr.tso_segsz << + AGE_TD_TSO_MSS_SHIFT); /* Set IP/TCP header size. */ cflags |= ip->ip_hl << AGE_TD_IPHDR_LEN_SHIFT; cflags |= tcp->th_off << AGE_TD_TSO_TCPHDR_LEN_SHIFT; + /* + * L1 requires the first buffer should only hold IP/TCP + * header data. TCP payload should be handled in other + * descriptors. + */ + hdrlen = poff + (tcp->th_off << 2); + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr); + desc->len = htole32(AGE_TX_BYTES(hdrlen) | vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + if (m->m_len - hdrlen > 0) { + /* Handle remaining payload of the 1st fragment. */ + desc = &sc->age_rdata.age_tx_ring[prod]; + desc->addr = htole64(txsegs[0].ds_addr + hdrlen); + desc->len = htole32(AGE_TX_BYTES(m->m_len - hdrlen) | + vtag); + desc->flags = htole32(cflags); + sc->age_cdata.age_tx_cnt++; + AGE_DESC_INC(prod, AGE_TX_RING_CNT); + } + /* Handle remaining fragments. */ + i = 1; } else if ((m->m_pkthdr.csum_flags & AGE_CSUM_FEATURES) != 0) { /* Configure Tx IP/TCP/UDP checksum offload. */ cflags |= AGE_TD_CSUM; @@ -1657,16 +1683,7 @@ age_encap(struct age_softc *sc, struct m cflags |= ((poff + m->m_pkthdr.csum_data) << AGE_TD_CSUM_XSUMOFFSET_SHIFT); } - - /* Configure VLAN hardware tag insertion. */ - if ((m->m_flags & M_VLANTAG) != 0) { - vtag = AGE_TX_VLAN_TAG(m->m_pkthdr.ether_vtag); - vtag = ((vtag << AGE_TD_VLAN_SHIFT) & AGE_TD_VLAN_MASK); - cflags |= AGE_TD_INSERT_VLAN_TAG; - } - - desc = NULL; - for (i = 0; i < nsegs; i++) { + for (; i < nsegs; i++) { desc = &sc->age_rdata.age_tx_ring[prod]; desc->addr = htole64(txsegs[i].ds_addr); desc->len = htole32(AGE_TX_BYTES(txsegs[i].ds_len) | vtag); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 08:00:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28984E5D; Tue, 30 Oct 2012 08:00:54 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0F60D8FC08; Tue, 30 Oct 2012 08:00:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9U80rMc047092; Tue, 30 Oct 2012 08:00:53 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9U80rQ2047078; Tue, 30 Oct 2012 08:00:53 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210300800.q9U80rQ2047078@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 30 Oct 2012 08:00:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242349 - head/usr.sbin/pw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 08:00:54 -0000 Author: bapt Date: Tue Oct 30 08:00:53 2012 New Revision: 242349 URL: http://svn.freebsd.org/changeset/base/242349 Log: Teach pw(8) about how to use pw/gr API to reduce code duplication MFC after: 2 months Deleted: head/usr.sbin/pw/edgroup.c Modified: head/usr.sbin/pw/Makefile head/usr.sbin/pw/fileupd.c head/usr.sbin/pw/grupd.c head/usr.sbin/pw/pw.8 head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_group.c head/usr.sbin/pw/pw_log.c head/usr.sbin/pw/pw_nis.c head/usr.sbin/pw/pw_user.c head/usr.sbin/pw/pw_vpw.c head/usr.sbin/pw/pwupd.c head/usr.sbin/pw/pwupd.h Modified: head/usr.sbin/pw/Makefile ============================================================================== --- head/usr.sbin/pw/Makefile Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/Makefile Tue Oct 30 08:00:53 2012 (r242349) @@ -3,10 +3,10 @@ PROG= pw MAN= pw.conf.5 pw.8 SRCS= pw.c pw_conf.c pw_user.c pw_group.c pw_log.c pw_nis.c pw_vpw.c \ - grupd.c pwupd.c fileupd.c edgroup.c psdate.c \ + grupd.c pwupd.c fileupd.c psdate.c \ bitmap.c cpdir.c rm_r.c -WARNS?= 1 +WARNS?= 2 DPADD= ${LIBCRYPT} ${LIBUTIL} LDADD= -lcrypt -lutil Modified: head/usr.sbin/pw/fileupd.c ============================================================================== --- head/usr.sbin/pw/fileupd.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/fileupd.c Tue Oct 30 08:00:53 2012 (r242349) @@ -66,138 +66,3 @@ extendarray(char ***buf, int * buflen, i } return *buflen; } - - -int -fileupdate(char const * filename, mode_t fmode, char const * newline, char const * prefix, int pfxlen, int updmode) -{ - int rc = 0; - - if (pfxlen <= 1) - rc = EINVAL; - else { - int infd = open(filename, O_RDWR | O_CREAT | O_EXLOCK, fmode); - - if (infd == -1) - rc = errno; - else { - FILE *infp = fdopen(infd, "r+"); - - if (infp == NULL) { - rc = errno; /* Assumes fopen(3) sets errno from open(2) */ - close(infd); - } else { - int outfd; - char file[MAXPATHLEN]; - - strcpy(file, filename); - strcat(file, ".new"); - outfd = open(file, O_RDWR | O_CREAT | O_TRUNC, fmode); - if (outfd == -1) - rc = errno; - else { - FILE *outfp = fdopen(outfd, "w+"); - - if (outfp == NULL) { - rc = errno; - close(outfd); - } else { - int updated = UPD_CREATE; - int linesize = PWBUFSZ; - char *line = malloc(linesize); - - nextline: - while (fgets(line, linesize, infp) != NULL) { - char *p = strchr(line, '\n'); - - while ((p = strchr(line, '\n')) == NULL) { - int l; - if (extendline(&line, &linesize, linesize + PWBUFSZ) == -1) { - int ch; - fputs(line, outfp); - while ((ch = fgetc(infp)) != EOF) { - fputc(ch, outfp); - if (ch == '\n') - break; - } - goto nextline; - } - l = strlen(line); - if (fgets(line + l, linesize - l, infp) == NULL) - break; - } - if (*line != '#' && *line != '\n') { - if (!updated && strncmp(line, prefix, pfxlen) == 0) { - updated = updmode == UPD_REPLACE ? UPD_REPLACE : UPD_DELETE; - - /* - * Only actually write changes if updating - */ - if (updmode == UPD_REPLACE) - strcpy(line, newline); - else if (updmode == UPD_DELETE) - continue; - } - } - fputs(line, outfp); - } - - /* - * Now, we need to decide what to do: If we are in - * update mode, and no record was updated, then error If - * we are in insert mode, and record already exists, - * then error - */ - if (updmode != updated) - /* -1 return means: - * update,delete=no user entry - * create=entry exists - */ - rc = -1; - else { - - /* - * If adding a new record, append it to the end - */ - if (updmode == UPD_CREATE) - fputs(newline, outfp); - - /* - * Flush the file and check for the result - */ - if (fflush(outfp) == EOF) - rc = errno; /* Failed to update */ - else { - /* - * Copy data back into the - * original file and truncate - */ - rewind(infp); - rewind(outfp); - while (fgets(line, linesize, outfp) != NULL) - fputs(line, infp); - - /* - * If there was a problem with copying - * we will just rename 'file.new' - * to 'file'. - * This is a gross hack, but we may have - * corrupted the original file - */ - if (fflush(infp) == EOF || ferror(infp)) - rename(file, filename); - else - ftruncate(infd, ftell(infp)); - } - } - free(line); - fclose(outfp); - } - remove(file); - } - fclose(infp); - } - } - } - return rc; -} Modified: head/usr.sbin/pw/grupd.c ============================================================================== --- head/usr.sbin/pw/grupd.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/grupd.c Tue Oct 30 08:00:53 2012 (r242349) @@ -29,6 +29,9 @@ static const char rcsid[] = "$FreeBSD$"; #endif /* not lint */ +#include +#include +#include #include #include #include @@ -65,107 +68,62 @@ getgrpath(const char * file) return pathbuf; } -int -grdb(char *arg,...) -{ - /* - * This is a stub for now, but maybe eventually be functional - * if ever an indexed version of /etc/groups is implemented. - */ - arg=arg; - return 0; -} - -int -fmtgrentry(char **buf, int * buflen, struct group * grp, int type) +static int +gr_update(struct group * grp, char const * group) { - int i, l; - - /* - * Since a group line is of arbitrary length, - * we need to calculate up-front just how long - * it will need to be... - */ - /* groupname : password : gid : */ - l = strlen(grp->gr_name) + 1 + strlen(grp->gr_passwd) + 1 + 5 + 1; - /* group members + comma separator */ - for (i = 0; grp->gr_mem[i] != NULL; i++) { - l += strlen(grp->gr_mem[i]) + 1; - } - l += 2; /* For newline & NUL */ - if (extendline(buf, buflen, l) == -1) - l = -1; - else{ - /* - * Now we can safely format - */ - if (type == PWF_STANDARD) - l = sprintf(*buf, "%s:*:%ld:", grp->gr_name, (long) grp->gr_gid); - else - l = sprintf(*buf, "%s:%s:%ld:", grp->gr_name, grp->gr_passwd, (long) grp->gr_gid); - - /* - * List members - */ - for (i = 0; grp->gr_mem[i] != NULL; i++) { - l += sprintf(*buf + l, "%s%s", i ? "," : "", grp->gr_mem[i]); - } - - (*buf)[l++] = '\n'; - (*buf)[l] = '\0'; - } - return l; -} + int pfd, tfd; + struct group *gr = NULL; + struct group *old_gr = NULL; + if (grp != NULL) + gr = gr_dup(grp); -int -fmtgrent(char **buf, int * buflen, struct group * grp) -{ - return fmtgrentry(buf, buflen, grp, PWF_STANDARD); -} + if (group != NULL) + old_gr = GETGRNAM(group); + if (gr_init(grpath, NULL)) + err(1, "gr_init()"); -static int -gr_update(struct group * grp, char const * group, int mode) -{ - int l; - char pfx[64]; - int grbuflen = 0; - char *grbuf = NULL; - - ENDGRENT(); - l = snprintf(pfx, sizeof pfx, "%s:", group); - - /* - * Update the group file - */ - if (grp != NULL && fmtgrentry(&grbuf, &grbuflen, grp, PWF_PASSWD) == -1) - l = -1; - else { - l = fileupdate(getgrpath(_GROUP), 0644, grbuf, pfx, l, mode); - if (l == 0) - l = grdb(NULL); + if ((pfd = gr_lock()) == -1) { + gr_fini(); + err(1, "gr_lock()"); } - if (grbuf != NULL) - free(grbuf); - return l; + if ((tfd = gr_tmp(-1)) == -1) { + gr_fini(); + err(1, "gr_tmp()"); + } + if (gr_copy(pfd, tfd, gr, old_gr) == -1) { + gr_fini(); + err(1, "gr_copy()"); + } + if (gr_mkdb() == -1) { + gr_fini(); + err(1, "gr_mkdb()"); + } + free(gr); + gr_fini(); + return 0; } int addgrent(struct group * grp) { - return gr_update(grp, grp->gr_name, UPD_CREATE); + return gr_update(grp, NULL); } int chggrent(char const * login, struct group * grp) { - return gr_update(grp, login, UPD_REPLACE); + return gr_update(grp, login); } int delgrent(struct group * grp) { - return gr_update(NULL, grp->gr_name, UPD_DELETE); + char group[MAXLOGNAME]; + + strlcpy(group, grp->gr_name, MAXLOGNAME); + + return gr_update(NULL, group); } Modified: head/usr.sbin/pw/pw.8 ============================================================================== --- head/usr.sbin/pw/pw.8 Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw.8 Tue Oct 30 08:00:53 2012 (r242349) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 21, 2011 +.Dd October 29, 2012 .Dt PW 8 .Os .Sh NAME @@ -904,12 +904,6 @@ A Version 7 format password file The user capabilities database .It Pa /etc/group The group database -.It Pa /etc/master.passwd.new -Temporary copy of the master password file -.It Pa /etc/passwd.new -Temporary copy of the Version 7 password file -.It Pa /etc/group.new -Temporary copy of the group file .It Pa /etc/pw.conf Pw default options file .It Pa /var/log/userlog Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw.c Tue Oct 30 08:00:53 2012 (r242349) @@ -62,13 +62,11 @@ struct pwf PWF = getpwent, getpwuid, getpwnam, - pwdb, setgrent, endgrent, getgrent, getgrgid, getgrnam, - grdb }; struct pwf VPWF = @@ -79,13 +77,11 @@ struct pwf VPWF = vgetpwent, vgetpwuid, vgetpwnam, - vpwdb, vsetgrent, vendgrent, vgetgrent, vgetgrgid, vgetgrnam, - vgrdb }; static struct cargs arglist; Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw.h Tue Oct 30 08:00:53 2012 (r242349) @@ -109,19 +109,10 @@ int pw_user(struct userconf * cnf, int m int pw_group(struct userconf * cnf, int mode, struct cargs * _args); char *pw_checkname(u_char *name, int gecos); -int addpwent(struct passwd * pwd); -int delpwent(struct passwd * pwd); -int chgpwent(char const * login, struct passwd * pwd); -int fmtpwent(char *buf, struct passwd * pwd); - int addnispwent(const char *path, struct passwd *pwd); int delnispwent(const char *path, const char *login); int chgnispwent(const char *path, const char *login, struct passwd *pwd); -int addgrent(struct group * grp); -int delgrent(struct group * grp); -int chggrent(char const * login, struct group * grp); - int boolean_val(char const * str, int dflt); char const *boolean_str(int val); char *newstr(char const * p); Modified: head/usr.sbin/pw/pw_group.c ============================================================================== --- head/usr.sbin/pw/pw_group.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw_group.c Tue Oct 30 08:00:53 2012 (r242349) @@ -34,6 +34,8 @@ static const char rcsid[] = #include #include #include +#include +#include #include "pw.h" #include "bitmap.h" @@ -403,10 +405,9 @@ static int print_group(struct group * grp, int pretty) { if (!pretty) { - int buflen = 0; char *buf = NULL; - fmtgrent(&buf, &buflen, grp); + buf = gr_make(grp); fputs(buf, stdout); free(buf); } else { Modified: head/usr.sbin/pw/pw_log.c ============================================================================== --- head/usr.sbin/pw/pw_log.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw_log.c Tue Oct 30 08:00:53 2012 (r242349) @@ -51,7 +51,7 @@ pw_log(struct userconf * cnf, int mode, time_t now = time(NULL); struct tm *t = localtime(&now); char nfmt[256]; - char *name; + const char *name; if ((name = getenv("LOGNAME")) == NULL && (name = getenv("USER")) == NULL) name = "unknown"; Modified: head/usr.sbin/pw/pw_nis.c ============================================================================== --- head/usr.sbin/pw/pw_nis.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw_nis.c Tue Oct 30 08:00:53 2012 (r242349) @@ -33,40 +33,62 @@ static const char rcsid[] = #include #include #include +#include +#include +#include #include "pw.h" static int -pw_nisupdate(const char * path, struct passwd * pwd, char const * user, int mode) +pw_nisupdate(const char * path, struct passwd * pwd, char const * user) { - char pfx[32]; - char pwbuf[PWBUFSZ]; - int l = sprintf(pfx, "%s:", user); - - /* - * Update the passwd file first - */ - if (pwd == NULL) - *pwbuf = '\0'; - else - fmtpwentry(pwbuf, pwd, PWF_MASTER); - return fileupdate(path, 0600, pwbuf, pfx, l, mode) != 0; + int pfd, tfd; + struct passwd *pw = NULL; + struct passwd *old_pw = NULL; + + if (pwd != NULL) + pw = pw_dup(pwd); + + if (user != NULL) + old_pw = GETPWNAM(user); + + if (pw_init(NULL, path)) + err(1,"pw_init()"); + if ((pfd = pw_lock()) == -1) { + pw_fini(); + err(1, "pw_lock()"); + } + if ((tfd = pw_tmp(-1)) == -1) { + pw_fini(); + err(1, "pw_tmp()"); + } + if (pw_copy(pfd, tfd, pw, old_pw) == -1) { + pw_fini(); + err(1, "pw_copy()"); + } + if (rename(pw_tempname(), path) == -1) + err(1, "rename()"); + + free(pw); + pw_fini(); + + return (0); } int addnispwent(const char *path, struct passwd * pwd) { - return pw_nisupdate(path, pwd, pwd->pw_name, UPD_CREATE); + return pw_nisupdate(path, pwd, NULL); } int chgnispwent(const char *path, char const * login, struct passwd * pwd) { - return pw_nisupdate(path, pwd, login, UPD_REPLACE); + return pw_nisupdate(path, pwd, login); } int delnispwent(const char *path, const char *login) { - return pw_nisupdate(path, NULL, login, UPD_DELETE); + return pw_nisupdate(path, NULL, login); } Modified: head/usr.sbin/pw/pw_user.c ============================================================================== --- head/usr.sbin/pw/pw_user.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw_user.c Tue Oct 30 08:00:53 2012 (r242349) @@ -42,6 +42,9 @@ static const char rcsid[] = #include #include #include +#include +#include +#include #include "pw.h" #include "bitmap.h" @@ -292,7 +295,6 @@ pw_user(struct userconf * cnf, int mode, if (mode == M_PRINT && getarg(args, 'a')) { int pretty = getarg(args, 'P') != NULL; int v7 = getarg(args, '7') != NULL; - SETPWENT(); while ((pwd = GETPWENT()) != NULL) print_user(pwd, pretty, v7); @@ -422,7 +424,24 @@ pw_user(struct userconf * cnf, int mode, /* non-fatal */ } - editgroups(a_name->val, NULL); + grp = GETGRNAM(a_name->val); + if (*grp->gr_mem == NULL) + delgrent(GETGRNAM(a_name->val)); + SETGRENT(); + while ((grp = GETGRENT()) != NULL) { + int i; + char group[MAXLOGNAME]; + for (i = 0; grp->gr_mem[i] != NULL; i++) { + if (!strcmp(grp->gr_mem[i], a_name->val)) { + while (grp->gr_mem[i] != NULL) { + grp->gr_mem[i] = grp->gr_mem[i+1]; + } + strlcpy(group, grp->gr_name, MAXLOGNAME); + chggrent(group, grp); + } + } + } + ENDGRENT(); pw_log(cnf, mode, W_USER, "%s(%ld) account removed", a_name->val, (long) uid); @@ -725,8 +744,29 @@ pw_user(struct userconf * cnf, int mode, * Ok, user is created or changed - now edit group file */ - if (mode == M_ADD || getarg(args, 'G') != NULL) - editgroups(pwd->pw_name, cnf->groups); + if (mode == M_ADD || getarg(args, 'G') != NULL) { + int i, j; + for (i = 0; cnf->groups[i] != NULL; i++) { + grp = GETGRNAM(cnf->groups[i]); + for (j = 0; grp->gr_mem[j] != NULL; j++) { + if (!strcmp(grp->gr_mem[j], pwd->pw_name)) + break; + } + if (grp->gr_mem[j] != NULL) /* user already member of group */ + continue; + + if (j == 0) + grp->gr_mem = NULL; + + grp->gr_mem = reallocf(grp->gr_mem, sizeof(*grp->gr_mem) * + (j + 2)); + + grp->gr_mem[j] = pwd->pw_name; + grp->gr_mem[j+1] = NULL; + chggrent(cnf->groups[i], grp); + } + } + /* go get a current version of pwd */ pwd = GETPWNAM(a_name->val); @@ -1090,10 +1130,14 @@ static int print_user(struct passwd * pwd, int pretty, int v7) { if (!pretty) { - char buf[_UC_MAXLINE]; + char *buf; + + if (!v7) + pwd->pw_passwd = (pwd->pw_passwd == NULL) ? "" : "*"; - fmtpwentry(buf, pwd, v7 ? PWF_PASSWD : PWF_STANDARD); - fputs(buf, stdout); + buf = v7 ? pw_make_v7(pwd) : pw_make(pwd); + printf("%s\n", buf); + free(buf); } else { int j; char *p; Modified: head/usr.sbin/pw/pw_vpw.c ============================================================================== --- head/usr.sbin/pw/pw_vpw.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pw_vpw.c Tue Oct 30 08:00:53 2012 (r242349) @@ -170,13 +170,6 @@ vgetpwnam(const char * nam) return vnextpwent(nam, -1, 1); } -int vpwdb(char *arg, ...) -{ - arg=arg; - return 0; -} - - static FILE * grp_fp = NULL; @@ -221,7 +214,7 @@ vnextgrent(char const * nam, gid_t gid, int i, quickout = 0; int mno = 0; char * q, * p; - char * sep = ":\n"; + const char * sep = ":\n"; if ((p = strchr(grtmp, '\n')) == NULL) { int l; @@ -307,10 +300,3 @@ vgetgrnam(const char * nam) return vnextgrent(nam, -1, 1); } -int -vgrdb(char *arg, ...) -{ - arg=arg; - return 0; -} - Modified: head/usr.sbin/pw/pwupd.c ============================================================================== --- head/usr.sbin/pw/pwupd.c Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pwupd.c Tue Oct 30 08:00:53 2012 (r242349) @@ -34,7 +34,10 @@ static const char rcsid[] = #include #include #include +#include +#include #include +#include #include #include #include @@ -71,7 +74,7 @@ getpwpath(char const * file) return pathbuf; } -int +static int pwdb(char *arg,...) { int i = 0; @@ -106,44 +109,11 @@ pwdb(char *arg,...) return i; } -int -fmtpwentry(char *buf, struct passwd * pwd, int type) -{ - int l; - char *pw; - - pw = (type == PWF_MASTER) ? - ((pwd->pw_passwd == NULL) ? "" : pwd->pw_passwd) : "*"; - - if (type == PWF_PASSWD) - l = sprintf(buf, "%s:*:%ld:%ld:%s:%s:%s\n", - pwd->pw_name, (long) pwd->pw_uid, (long) pwd->pw_gid, - pwd->pw_gecos ? pwd->pw_gecos : "User &", - pwd->pw_dir, pwd->pw_shell); - else - l = sprintf(buf, "%s:%s:%ld:%ld:%s:%lu:%lu:%s:%s:%s\n", - pwd->pw_name, pw, (long) pwd->pw_uid, (long) pwd->pw_gid, - pwd->pw_class ? pwd->pw_class : "", - (unsigned long) pwd->pw_change, - (unsigned long) pwd->pw_expire, - pwd->pw_gecos, pwd->pw_dir, pwd->pw_shell); - return l; -} - - -int -fmtpwent(char *buf, struct passwd * pwd) -{ - return fmtpwentry(buf, pwd, PWF_STANDARD); -} - static int -pw_update(struct passwd * pwd, char const * user, int mode) +pw_update(struct passwd * pwd, char const * user) { int rc = 0; - ENDPWENT(); - /* * First, let's check the see if the database is alright * Note: -C is only available in FreeBSD 2.2 and above @@ -154,61 +124,57 @@ pw_update(struct passwd * pwd, char cons #else { /* No -C */ #endif - char pfx[PWBUFSZ]; - char pwbuf[PWBUFSZ]; - int l = snprintf(pfx, PWBUFSZ, "%s:", user); -#ifdef HAVE_PWDB_U - int isrename = pwd!=NULL && strcmp(user, pwd->pw_name); -#endif - - /* - * Update the passwd file first - */ - if (pwd == NULL) - *pwbuf = '\0'; - else - fmtpwentry(pwbuf, pwd, PWF_PASSWD); - - if (l < 0) - l = 0; - rc = fileupdate(getpwpath(_PASSWD), 0644, pwbuf, pfx, l, mode); - if (rc == 0) { - - /* - * Then the master.passwd file - */ - if (pwd != NULL) - fmtpwentry(pwbuf, pwd, PWF_MASTER); - rc = fileupdate(getpwpath(_MASTERPASSWD), 0600, pwbuf, pfx, l, mode); - if (rc == 0) { -#ifdef HAVE_PWDB_U - if (mode == UPD_DELETE || isrename) -#endif - rc = pwdb(NULL); -#ifdef HAVE_PWDB_U - else - rc = pwdb("-u", user, (char *)NULL); -#endif - } + int pfd, tfd; + struct passwd *pw = NULL; + struct passwd *old_pw = NULL; + + if (pwd != NULL) + pw = pw_dup(pwd); + + if (user != NULL) + old_pw = GETPWNAM(user); + + if (pw_init(pwpath, NULL)) + err(1, "pw_init()"); + if ((pfd = pw_lock()) == -1) { + pw_fini(); + err(1, "pw_lock()"); + } + if ((tfd = pw_tmp(-1)) == -1) { + pw_fini(); + err(1, "pw_tmp()"); + } + if (pw_copy(pfd, tfd, pw, old_pw) == -1) { + pw_fini(); + err(1, "pw_copy()"); } + if (pw_mkdb(user) == -1) { + pw_fini(); + err(1, "pw_mkdb()"); + } + free(pw); + pw_fini(); } - return rc; + return 0; } int addpwent(struct passwd * pwd) { - return pw_update(pwd, pwd->pw_name, UPD_CREATE); + return pw_update(pwd, NULL); } int chgpwent(char const * login, struct passwd * pwd) { - return pw_update(pwd, login, UPD_REPLACE); + return pw_update(pwd, login); } int delpwent(struct passwd * pwd) { - return pw_update(NULL, pwd->pw_name, UPD_DELETE); + char login[MAXLOGNAME]; + + strlcpy(login, pwd->pw_name, MAXLOGNAME); + return pw_update(NULL, login); } Modified: head/usr.sbin/pw/pwupd.h ============================================================================== --- head/usr.sbin/pw/pwupd.h Tue Oct 30 07:55:03 2012 (r242348) +++ head/usr.sbin/pw/pwupd.h Tue Oct 30 08:00:53 2012 (r242349) @@ -41,25 +41,6 @@ #define RET_SETGRENT void #endif -enum updtype -{ - UPD_DELETE = -1, - UPD_CREATE = 0, - UPD_REPLACE = 1 -}; - -__BEGIN_DECLS -int fileupdate(char const * fname, mode_t fm, char const * nline, char const * pfx, int pfxlen, int updmode); -__END_DECLS - -enum pwdfmttype -{ - PWF_STANDARD, /* MASTER format but with '*' as password */ - PWF_PASSWD, /* V7 format */ - PWF_GROUP = PWF_PASSWD, - PWF_MASTER /* MASTER format with password */ -}; - struct pwf { int _altdir; @@ -68,13 +49,11 @@ struct pwf struct passwd * (*_getpwent)(void); struct passwd * (*_getpwuid)(uid_t uid); struct passwd * (*_getpwnam)(const char * nam); - int (*_pwdb)(char *arg, ...); RET_SETGRENT (*_setgrent)(void); void (*_endgrent)(void); struct group * (*_getgrent)(void); struct group * (*_getgrgid)(gid_t gid); struct group * (*_getgrnam)(const char * nam); - int (*_grdb)(char *arg, ...); }; extern struct pwf PWF; @@ -85,14 +64,12 @@ extern struct pwf VPWF; #define GETPWENT() PWF._getpwent() #define GETPWUID(uid) PWF._getpwuid(uid) #define GETPWNAM(nam) PWF._getpwnam(nam) -#define PWDB(args) PWF._pwdb(args) #define SETGRENT() PWF._setgrent() #define ENDGRENT() PWF._endgrent() #define GETGRENT() PWF._getgrent() #define GETGRGID(gid) PWF._getgrgid(gid) #define GETGRNAM(nam) PWF._getgrnam(nam) -#define GRDB(args) PWF._grdb(args) #define PWALTDIR() PWF._altdir #ifndef _PATH_PWD @@ -101,51 +78,35 @@ extern struct pwf VPWF; #ifndef _GROUP #define _GROUP "group" #endif -#ifndef _PASSWD -#define _PASSWD "passwd" -#endif #ifndef _MASTERPASSWD #define _MASTERPASSWD "master.passwd" #endif -#ifndef _GROUP -#define _GROUP "group" -#endif __BEGIN_DECLS int addpwent(struct passwd * pwd); int delpwent(struct passwd * pwd); int chgpwent(char const * login, struct passwd * pwd); -int fmtpwent(char *buf, struct passwd * pwd); -int fmtpwentry(char *buf, struct passwd * pwd, int type); int setpwdir(const char * dir); char * getpwpath(char const * file); -int pwdb(char *arg, ...); int addgrent(struct group * grp); int delgrent(struct group * grp); int chggrent(char const * name, struct group * grp); -int fmtgrent(char **buf, int * buflen, struct group * grp); -int fmtgrentry(char **buf, int * buflen, struct group * grp, int type); int editgroups(char *name, char **groups); int setgrdir(const char * dir); char * getgrpath(const char *file); -int grdb(char *arg, ...); void vsetpwent(void); void vendpwent(void); struct passwd * vgetpwent(void); struct passwd * vgetpwuid(uid_t uid); struct passwd * vgetpwnam(const char * nam); -struct passwd * vgetpwent(void); -int vpwdb(char *arg, ...); struct group * vgetgrent(void); struct group * vgetgrgid(gid_t gid); struct group * vgetgrnam(const char * nam); -struct group * vgetgrent(void); -int vgrdb(char *arg, ...); RET_SETGRENT vsetgrent(void); void vendgrent(void); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 10:13:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF18ECC9; Tue, 30 Oct 2012 10:13:26 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 965F08FC0A; Tue, 30 Oct 2012 10:13:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UADQHJ068046; Tue, 30 Oct 2012 10:13:26 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UADQV5068044; Tue, 30 Oct 2012 10:13:26 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201210301013.q9UADQV5068044@svn.freebsd.org> From: Kevin Lo Date: Tue, 30 Oct 2012 10:13:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242350 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 10:13:26 -0000 Author: kevlo Date: Tue Oct 30 10:13:26 2012 New Revision: 242350 URL: http://svn.freebsd.org/changeset/base/242350 Log: The argument len of m_pullup(9) could be less than or equal to MHLEN. Reviewed by: glebius Modified: head/share/man/man9/mbuf.9 Modified: head/share/man/man9/mbuf.9 ============================================================================== --- head/share/man/man9/mbuf.9 Tue Oct 30 08:00:53 2012 (r242349) +++ head/share/man/man9/mbuf.9 Tue Oct 30 10:13:26 2012 (r242350) @@ -706,7 +706,7 @@ It does not allocate any .Vt mbuf clusters , so .Fa len -must be less than +must be less than or equal to .Dv MHLEN . .\" .It Fn m_pulldown mbuf offset len offsetp From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 10:18:36 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F39AF90; Tue, 30 Oct 2012 10:18:36 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id DAA2D8FC0C; Tue, 30 Oct 2012 10:18:35 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9UAIYbS036359; Tue, 30 Oct 2012 14:18:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9UAIYmf036358; Tue, 30 Oct 2012 14:18:34 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Tue, 30 Oct 2012 14:18:34 +0400 From: Gleb Smirnoff To: Michael Tuexen Subject: Re: svn commit: r242325 - head/sys/netinet Message-ID: <20121030101834.GB70741@FreeBSD.org> References: <201210292042.q9TKgmY5040403@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210292042.q9TKgmY5040403@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 10:18:36 -0000 On Mon, Oct 29, 2012 at 08:42:48PM +0000, Michael Tuexen wrote: M> Author: tuexen M> Date: Mon Oct 29 20:42:48 2012 M> New Revision: 242325 M> URL: http://svn.freebsd.org/changeset/base/242325 M> M> Log: M> Use ntohs() and htons() in correct order. However, this doesn't change M> functionality. Oh, sorry for that. Thanks for fixing! M> Modified: M> head/sys/netinet/sctputil.c M> M> Modified: head/sys/netinet/sctputil.c M> ============================================================================== M> --- head/sys/netinet/sctputil.c Mon Oct 29 18:06:09 2012 (r242324) M> +++ head/sys/netinet/sctputil.c Mon Oct 29 20:42:48 2012 (r242325) M> @@ -6821,7 +6821,7 @@ sctp_recv_udp_tunneled_packet(struct mbu M> switch (iph->ip_v) { M> #ifdef INET M> case IPVERSION: M> - iph->ip_len = ntohs(htons(iph->ip_len) - sizeof(struct udphdr)); M> + iph->ip_len = htons(ntohs(iph->ip_len) - sizeof(struct udphdr)); M> sctp_input_with_port(m, off, port); M> break; M> #endif M> _______________________________________________ M> svn-src-all@freebsd.org mailing list M> http://lists.freebsd.org/mailman/listinfo/svn-src-all M> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 10:59:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 104C6D01; Tue, 30 Oct 2012 10:59:43 +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 DC8D28FC1E; Tue, 30 Oct 2012 10:59:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UAxguR075324; Tue, 30 Oct 2012 10:59:42 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UAxgIr075317; Tue, 30 Oct 2012 10:59:42 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210301059.q9UAxgIr075317@svn.freebsd.org> From: Alexander Motin Date: Tue, 30 Oct 2012 10:59:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242352 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 10:59:43 -0000 Author: mav Date: Tue Oct 30 10:59:42 2012 New Revision: 242352 URL: http://svn.freebsd.org/changeset/base/242352 Log: Print card and subsystem IDs in verbose logs to help to identify system. Hide some less iseful messages under debug. Modified: head/sys/dev/sound/pci/hda/hdaa.c head/sys/dev/sound/pci/hda/hdaa.h head/sys/dev/sound/pci/hda/hdaa_patches.c head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac.h head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Oct 30 10:59:42 2012 (r242352) @@ -6243,6 +6243,10 @@ hdaa_attach(device_t dev) devinfo->endnode = devinfo->startnode + devinfo->nodecnt; HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); + HDA_BOOTHVERBOSE( device_printf(dev, "Audio Function Group at nid=%d: %d subnodes %d-%d\n", nid, devinfo->nodecnt, Modified: head/sys/dev/sound/pci/hda/hdaa.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.h Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdaa.h Tue Oct 30 10:59:42 2012 (r242352) @@ -260,7 +260,7 @@ struct hdaa_chan { (((uint32_t)hda_get_vendor_id(devinfo->dev) << 16) + \ hda_get_device_id(devinfo->dev)) -#define hdaa_subvendor_id(devinfo) \ +#define hdaa_card_id(devinfo) \ (((uint32_t)hda_get_subdevice_id(devinfo->dev) << 16) + \ hda_get_subvendor_id(devinfo->dev)) Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Tue Oct 30 10:59:42 2012 (r242352) @@ -139,7 +139,7 @@ hdac_pin_patch(struct hdaa_widget *w) config = orig = w->wclass.pin.config; id = hdaa_codec_id(w->devinfo); - subid = hdaa_subvendor_id(w->devinfo); + subid = hdaa_card_id(w->devinfo); /* XXX: Old patches require complete review. * Now they may create more problem then solve due to @@ -392,7 +392,7 @@ hdaa_patch(struct hdaa_devinfo *devinfo) int i; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); /* * Quirks @@ -594,7 +594,7 @@ hdaa_patch_direct(struct hdaa_devinfo *d uint32_t id, subid, val; id = hdaa_codec_id(devinfo); - subid = hdaa_subvendor_id(devinfo); + subid = hdaa_card_id(devinfo); switch (id) { case HDA_CODEC_VT1708S_0: Modified: head/sys/dev/sound/pci/hda/hdac.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.c Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdac.c Tue Oct 30 10:59:42 2012 (r242352) @@ -1074,6 +1074,8 @@ hdac_attach(device_t dev) sc = device_get_softc(dev); HDA_BOOTVERBOSE( + device_printf(dev, "PCI card vendor: 0x%04x, device: 0x%04x\n", + pci_get_subvendor(dev), pci_get_subdevice(dev)); device_printf(dev, "HDA Driver Revision: %s\n", HDA_DRV_TEST_REV); ); Modified: head/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- head/sys/dev/sound/pci/hda/hdac.h Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdac.h Tue Oct 30 10:59:42 2012 (r242352) @@ -666,6 +666,7 @@ HDA_ACCESSOR(revision_id, REVISION_ID, u HDA_ACCESSOR(stepping_id, STEPPING_ID, uint8_t); HDA_ACCESSOR(subvendor_id, SUBVENDOR_ID, uint16_t); HDA_ACCESSOR(subdevice_id, SUBDEVICE_ID, uint16_t); +HDA_ACCESSOR(subsystem_id, SUBSYSTEM_ID, uint32_t); HDA_ACCESSOR(node_type, NODE_TYPE, uint8_t); HDA_ACCESSOR(dma_nocache, DMA_NOCACHE, uint8_t); Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Tue Oct 30 10:52:35 2012 (r242351) +++ head/sys/dev/sound/pci/hda/hdacc.c Tue Oct 30 10:59:42 2012 (r242352) @@ -422,7 +422,7 @@ hdacc_attach(device_t dev) startnode = HDA_PARAM_SUB_NODE_COUNT_START(subnode); endnode = startnode + codec->fgcnt; - HDA_BOOTVERBOSE( + HDA_BOOTHVERBOSE( device_printf(dev, "Root Node at nid=0: %d subnodes %d-%d\n", HDA_PARAM_SUB_NODE_COUNT_TOTAL(subnode), @@ -506,6 +506,10 @@ hdacc_probe_nomatch(device_t dev, device fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_AUDIO ? "Audio" : (fg->type == HDA_PARAM_FCT_GRP_TYPE_NODE_TYPE_MODEM ? "Modem" : "Unknown"), fg->nid, device_get_nameunit(dev)); + HDA_BOOTVERBOSE( + device_printf(dev, "Subsystem ID: 0x%08x\n", + hda_get_subsystem_id(dev)); + ); HDA_BOOTHVERBOSE( device_printf(dev, "Power down FG nid=%d to the D3 state...\n", fg->nid); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 12:25:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0A99E481; Tue, 30 Oct 2012 12:25:53 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D974C8FC0A; Tue, 30 Oct 2012 12:25:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UCPq5n088691; Tue, 30 Oct 2012 12:25:52 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UCPqUq088689; Tue, 30 Oct 2012 12:25:52 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210301225.q9UCPqUq088689@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Oct 2012 12:25:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242356 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 12:25:53 -0000 Author: attilio Date: Tue Oct 30 12:25:52 2012 New Revision: 242356 URL: http://svn.freebsd.org/changeset/base/242356 Log: tdq_lock_pair() already does spinlock_enter() so migration is not possible in sched_balance_pair(). Remove redundant sched_pin(). Reviewed by: marius, jeff Modified: head/sys/kern/sched_ule.c Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Tue Oct 30 11:33:47 2012 (r242355) +++ head/sys/kern/sched_ule.c Tue Oct 30 12:25:52 2012 (r242356) @@ -910,10 +910,8 @@ sched_balance_pair(struct tdq *high, str * reschedule with the new workload. */ cpu = TDQ_ID(low); - sched_pin(); if (cpu != PCPU_GET(cpuid)) ipi_cpu(cpu, IPI_PREEMPT); - sched_unpin(); } tdq_unlock_pair(high, low); return (moved); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 12:44:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 987E6A55; Tue, 30 Oct 2012 12:44:31 +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 6012B8FC0A; Tue, 30 Oct 2012 12:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UCiVsw091837; Tue, 30 Oct 2012 12:44:31 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UCiVtl091835; Tue, 30 Oct 2012 12:44:31 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210301244.q9UCiVtl091835@svn.freebsd.org> From: Alexander Motin Date: Tue, 30 Oct 2012 12:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242357 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 12:44:31 -0000 Author: mav Date: Tue Oct 30 12:44:30 2012 New Revision: 242357 URL: http://svn.freebsd.org/changeset/base/242357 Log: Set all pins initial connection status to unknown (2) and then update it with the real value in regular way if sensing is supported. This fixes minor inconsistency when playback redirection appeared in undefined state on boot if headphones were not connected. Modified: head/sys/dev/sound/pci/hda/hdaa.c Modified: head/sys/dev/sound/pci/hda/hdaa.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa.c Tue Oct 30 12:25:52 2012 (r242356) +++ head/sys/dev/sound/pci/hda/hdaa.c Tue Oct 30 12:44:30 2012 (r242357) @@ -400,7 +400,7 @@ hdaa_presence_handler(struct hdaa_widget struct hdaa_devinfo *devinfo = w->devinfo; struct hdaa_audio_as *as; uint32_t res; - int connected; + int connected, old; if (w->enable == 0 || w->type != HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX) @@ -414,19 +414,22 @@ hdaa_presence_handler(struct hdaa_widget connected = (res & HDA_CMD_GET_PIN_SENSE_PRESENCE_DETECT) != 0; if (devinfo->quirks & HDAA_QUIRK_SENSEINV) connected = !connected; - if (connected == w->wclass.pin.connected) + old = w->wclass.pin.connected; + if (connected == old) return; w->wclass.pin.connected = connected; HDA_BOOTVERBOSE( - device_printf(devinfo->dev, - "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", - w->nid, res, !w->wclass.pin.connected ? "dis" : ""); + if (connected || old != 2) { + device_printf(devinfo->dev, + "Pin sense: nid=%d sence=0x%08x (%sconnected)\n", + w->nid, res, !connected ? "dis" : ""); + } ); as = &devinfo->as[w->bindas]; if (as->hpredir >= 0 && as->pins[15] == w->nid) hdaa_hpredir_handler(w); - if (as->dir == HDAA_CTL_IN) + if (as->dir == HDAA_CTL_IN && old != 2) hdaa_autorecsrc_handler(as, w); } @@ -1151,6 +1154,7 @@ hdaa_widget_parse(struct hdaa_widget *w) HDA_CMD_GET_PARAMETER(0, w->nid, HDA_PARAM_PIN_CAP)); w->wclass.pin.ctrl = hda_command(dev, HDA_CMD_GET_PIN_WIDGET_CTRL(0, nid)); + w->wclass.pin.connected = 2; if (HDA_PARAM_PIN_CAP_EAPD_CAP(w->wclass.pin.cap)) { w->param.eapdbtl = hda_command(dev, HDA_CMD_GET_EAPD_BTL_ENABLE(0, nid)); @@ -1238,10 +1242,6 @@ hdaa_widget_postprocess(struct hdaa_widg } strlcat(w->name, HDA_CONNS[conn], sizeof(w->name)); strlcat(w->name, ")", sizeof(w->name)); - - if (HDA_PARAM_PIN_CAP_PRESENCE_DETECT_CAP(w->wclass.pin.cap) == 0 || - (HDA_CONFIG_DEFAULTCONF_MISC(w->wclass.pin.config) & 1) != 0) - w->wclass.pin.connected = 2; } } From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 12:52:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 20394D40; Tue, 30 Oct 2012 12:52:43 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0456D8FC14; Tue, 30 Oct 2012 12:52:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UCqgRp093629; Tue, 30 Oct 2012 12:52:42 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UCqguL093624; Tue, 30 Oct 2012 12:52:42 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210301252.q9UCqguL093624@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 30 Oct 2012 12:52:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242358 - head/sys/cam/ctl X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 12:52:43 -0000 Author: trasz Date: Tue Oct 30 12:52:41 2012 New Revision: 242358 URL: http://svn.freebsd.org/changeset/base/242358 Log: Use M_ZERO instead of explicit memsets and bzeros. Modified: head/sys/cam/ctl/ctl.c head/sys/cam/ctl/ctl_backend_block.c Modified: head/sys/cam/ctl/ctl.c ============================================================================== --- head/sys/cam/ctl/ctl.c Tue Oct 30 12:44:30 2012 (r242357) +++ head/sys/cam/ctl/ctl.c Tue Oct 30 12:52:41 2012 (r242358) @@ -957,11 +957,10 @@ ctl_init(void) if (ctl_disable != 0) return; - control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK); + control_softc = malloc(sizeof(*control_softc), M_DEVBUF, + M_WAITOK | M_ZERO); softc = control_softc; - memset(softc, 0, sizeof(*softc)); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "cam/ctl"); @@ -3271,14 +3270,13 @@ ctl_pool_create(struct ctl_softc *ctl_so retval = 0; - pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT); + pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, + M_NOWAIT | M_ZERO); if (pool == NULL) { retval = -ENOMEM; goto bailout; } - memset(pool, 0, sizeof(*pool)); - pool->type = pool_type; pool->ctl_softc = ctl_softc; @@ -6561,7 +6559,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len, page_len, total_len); #endif - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6574,7 +6572,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - memset(ctsio->kern_data_ptr, 0, total_len); switch (ctsio->cdb[0]) { case MODE_SENSE_6: { @@ -6742,7 +6739,7 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6751,8 +6748,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - /* * If the maximum LBA is greater than 0xfffffffe, the user must * issue a SERVICE ACTION IN (16) command, with the read capacity @@ -6806,7 +6801,7 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6822,8 +6817,6 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); @@ -6913,8 +6906,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - memset(ctsio->kern_data_ptr, 0, total_len); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; @@ -7068,7 +7060,7 @@ retry: } mtx_unlock(&softc->ctl_lock); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7084,8 +7076,6 @@ retry: ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(ctsio->kern_data_ptr, 0, total_len); - mtx_lock(&softc->ctl_lock); switch (cdb->action) { case SPRI_RK: { // read keys @@ -8611,7 +8601,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); - ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO); lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8630,8 +8620,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - memset(lun_data, 0, lun_datalen); - /* * We set this to the actual data length, regardless of how much * space we actually have to return results. If the user looks at @@ -8907,7 +8895,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc * XXX KDM GFP_??? We probably don't want to wait here, * unless we end up having a process/thread context. */ - ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8930,8 +8918,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(pages, 0, sup_page_size); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -8971,7 +8957,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* XXX KDM which malloc flags here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8994,8 +8980,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(sn_ptr, 0, sizeof(*sn_ptr)); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -9065,7 +9049,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio sizeof(struct scsi_vpd_id_trgt_port_grp_id); /* XXX KDM which malloc flags here ?? */ - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9096,7 +9080,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio CTL_WWPN_LEN); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - memset(devid_ptr, 0, devid_len); /* * The control device is always connected. The disk device, on the @@ -9296,7 +9279,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * that much. */ /* XXX KDM what malloc flags should we use here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9318,8 +9301,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->kern_total_len = alloc_len; } - memset(inq_ptr, 0, sizeof(*inq_ptr)); - /* * If we have a LUN configured, report it as connected. Otherwise, * report that it is offline or no device is supported, depending Modified: head/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- head/sys/cam/ctl/ctl_backend_block.c Tue Oct 30 12:44:30 2012 (r242357) +++ head/sys/cam/ctl/ctl_backend_block.c Tue Oct 30 12:52:41 2012 (r242358) @@ -376,7 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 13:05:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 79500118; Tue, 30 Oct 2012 13:05:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 609E48FC16; Tue, 30 Oct 2012 13:05:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UD5pTk095950; Tue, 30 Oct 2012 13:05:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UD5pui095947; Tue, 30 Oct 2012 13:05:51 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210301305.q9UD5pui095947@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 30 Oct 2012 13:05:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242359 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 13:05:51 -0000 Author: trasz Date: Tue Oct 30 13:05:50 2012 New Revision: 242359 URL: http://svn.freebsd.org/changeset/base/242359 Log: Document disk_resize(9). Modified: head/share/man/man9/Makefile head/share/man/man9/disk.9 Modified: head/share/man/man9/Makefile ============================================================================== --- head/share/man/man9/Makefile Tue Oct 30 12:52:41 2012 (r242358) +++ head/share/man/man9/Makefile Tue Oct 30 13:05:50 2012 (r242359) @@ -614,7 +614,8 @@ MLINKS+=devstat.9 devicestat.9 \ MLINKS+=disk.9 disk_alloc.9 \ disk.9 disk_create.9 \ disk.9 disk_destroy.9 \ - disk.9 disk_gone.9 + disk.9 disk_gone.9 \ + disk.9 disk_resize.9 MLINKS+=domain.9 DOMAIN_SET.9 \ domain.9 domain_add.9 \ domain.9 pfctlinput.9 \ Modified: head/share/man/man9/disk.9 ============================================================================== --- head/share/man/man9/disk.9 Tue Oct 30 12:52:41 2012 (r242358) +++ head/share/man/man9/disk.9 Tue Oct 30 13:05:50 2012 (r242359) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 18, 2004 +.Dd October 30, 2012 .Dt DISK 9 .Os .Sh NAME @@ -43,6 +43,8 @@ .Fn disk_gone "struct disk *disk" .Ft void .Fn disk_destroy "struct disk *disk" +.Ft int +.Fn disk_resize "struct disk *disk" "int flags" .Sh DESCRIPTION The disk storage API permits kernel device drivers providing access to disk-like storage devices to advertise the device to other kernel @@ -67,6 +69,13 @@ function, fill in the fields and call .Fn disk_create when the device is ready to service requests. +.Fn disk_resize +can be called by the driver after modifying +.Va d_mediasize +to notify GEOM about the disk capacity change. +The +.Fa flags +field should be set to either M_WAITOK, or M_NOWAIT. .Fn disk_gone orphans all of the providers associated with the drive, setting an error condition of ENXIO in each one. From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 13:22:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5761063E; Tue, 30 Oct 2012 13:22:40 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26D068FC14; Tue, 30 Oct 2012 13:22:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UDMeaV099058; Tue, 30 Oct 2012 13:22:40 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UDMdOr099053; Tue, 30 Oct 2012 13:22:39 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201210301322.q9UDMdOr099053@svn.freebsd.org> From: Andrey Zonov Date: Tue, 30 Oct 2012 13:22:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242360 - in head/sys: conf dev/bce X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 13:22:40 -0000 Author: zont Date: Tue Oct 30 13:22:39 2012 New Revision: 242360 URL: http://svn.freebsd.org/changeset/base/242360 Log: - Remove BCE_JUMBO_HDRSPLIT kernel option which was forgotten in r218423. Approved by: davidch Approved by: kib (mentor) Modified: head/sys/conf/NOTES head/sys/conf/options head/sys/dev/bce/if_bcereg.h Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Tue Oct 30 13:05:50 2012 (r242359) +++ head/sys/conf/NOTES Tue Oct 30 13:22:39 2012 (r242360) @@ -2142,12 +2142,6 @@ device ral # Ralink Technology RT2500 # This option requires the TI_SF_BUF_JUMBO option above. #options TI_JUMBO_HDRSPLIT -# -# Use header splitting feature on bce(4) adapters. -# This may help to reduce the amount of jumbo-sized memory buffers used. -# -options BCE_JUMBO_HDRSPLIT - # These two options allow manipulating the mbuf cluster size and mbuf size, # respectively. Be very careful with NIC driver modules when changing # these from their default values, because that can potentially cause a Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Tue Oct 30 13:05:50 2012 (r242359) +++ head/sys/conf/options Tue Oct 30 13:22:39 2012 (r242360) @@ -523,7 +523,6 @@ SOCKET_SEND_COW opt_zero.h SOCKET_RECV_PFLIP opt_zero.h TI_SF_BUF_JUMBO opt_ti.h TI_JUMBO_HDRSPLIT opt_ti.h -BCE_JUMBO_HDRSPLIT opt_bce.h # XXX Conflict: # of devices vs network protocol (Native ATM). # This makes "atm.h" unusable. Modified: head/sys/dev/bce/if_bcereg.h ============================================================================== --- head/sys/dev/bce/if_bcereg.h Tue Oct 30 13:05:50 2012 (r242359) +++ head/sys/dev/bce/if_bcereg.h Tue Oct 30 13:22:39 2012 (r242360) @@ -289,7 +289,6 @@ * * #define BCE_DEBUG * #define BCE_NVRAM_WRITE_SUPPORT - * #define BCE_JUMBO_HDRSPLIT */ /****************************************************************************/ From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 15:10:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6ABEF3FF; Tue, 30 Oct 2012 15:10:51 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3710C8FC12; Tue, 30 Oct 2012 15:10:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UFApWt017090; Tue, 30 Oct 2012 15:10:51 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UFAoek017087; Tue, 30 Oct 2012 15:10:50 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210301510.q9UFAoek017087@svn.freebsd.org> From: Attilio Rao Date: Tue, 30 Oct 2012 15:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242361 - in head/sys: dev/hwpmc kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 15:10:51 -0000 Author: attilio Date: Tue Oct 30 15:10:50 2012 New Revision: 242361 URL: http://svn.freebsd.org/changeset/base/242361 Log: Fixup r240246: hwpmc needs to retain the pinning until ASTs are not executed. This means past the point where userret() is generally executed. Skip the td_pinned check if a callchain tracing is currently happening and add a more robust check to pmc_capture_user_callchain() in order to catch td_pinned leak past ast() in hwpmc case. Reported and tested by: fabient MFC after: 1 week X-MFC: r240246 Modified: head/sys/dev/hwpmc/hwpmc_mod.c head/sys/kern/subr_trap.c Modified: head/sys/dev/hwpmc/hwpmc_mod.c ============================================================================== --- head/sys/dev/hwpmc/hwpmc_mod.c Tue Oct 30 13:22:39 2012 (r242360) +++ head/sys/dev/hwpmc/hwpmc_mod.c Tue Oct 30 15:10:50 2012 (r242361) @@ -4248,7 +4248,7 @@ pmc_capture_user_callchain(int cpu, int ("[pmc,%d] cpu %d didn't find a sample to collect", __LINE__, cpu)); - KASSERT(td->td_pinned > 0, + KASSERT(td->td_pinned == 1, ("[pmc,%d] invalid td_pinned value", __LINE__)); sched_unpin(); /* Can migrate safely now. */ Modified: head/sys/kern/subr_trap.c ============================================================================== --- head/sys/kern/subr_trap.c Tue Oct 30 13:22:39 2012 (r242360) +++ head/sys/kern/subr_trap.c Tue Oct 30 15:10:50 2012 (r242361) @@ -145,6 +145,11 @@ userret(struct thread *td, struct trapfr /* * Check for misbehavior. + * + * In case there is a callchain tracing ongoing because of + * hwpmc(4), skip the scheduler pinning check. + * hwpmc(4) subsystem, infact, will collect callchain informations + * at ast() checkpoint, which is past userret(). */ WITNESS_WARN(WARN_PANIC, NULL, "userret: returning"); KASSERT(td->td_critnest == 0, @@ -155,7 +160,7 @@ userret(struct thread *td, struct trapfr ("userret: Returning with pagefaults disabled")); KASSERT((td->td_pflags & TDP_NOSLEEPING) == 0, ("userret: Returning with sleep disabled")); - KASSERT(td->td_pinned == 0, + KASSERT(td->td_pinned == 0 || (td->td_pflags & TDP_CALLCHAIN) != 0, ("userret: Returning with with pinned thread")); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 15:25:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 61C3D934; Tue, 30 Oct 2012 15:25:02 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47FC78FC14; Tue, 30 Oct 2012 15:25:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UFP2xc019622; Tue, 30 Oct 2012 15:25:02 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UFP20u019620; Tue, 30 Oct 2012 15:25:02 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201210301525.q9UFP20u019620@svn.freebsd.org> From: Olivier Houchard Date: Tue, 30 Oct 2012 15:25:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242362 - head/sys/arm/ti/omap4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 15:25:02 -0000 Author: cognet Date: Tue Oct 30 15:25:01 2012 New Revision: 242362 URL: http://svn.freebsd.org/changeset/base/242362 Log: Fix SMP build for omap4 Submitted by: Giovanni Trematerra Modified: head/sys/arm/ti/omap4/omap4_mp.c Modified: head/sys/arm/ti/omap4/omap4_mp.c ============================================================================== --- head/sys/arm/ti/omap4/omap4_mp.c Tue Oct 30 15:10:50 2012 (r242361) +++ head/sys/arm/ti/omap4/omap4_mp.c Tue Oct 30 15:25:01 2012 (r242362) @@ -75,7 +75,7 @@ platform_mp_start_ap(void) cpu_idcache_wbinv_all(); cpu_l2cache_wbinv_all(); ti_smc0(0x200, 0xfffffdff, MODIFY_AUX_CORE_0); - ti_smc0(pmap_kextract(mpentry), 0, WRITE_AUX_CORE_1); + ti_smc0(pmap_kextract((vm_offset_t)mpentry), 0, WRITE_AUX_CORE_1); armv7_sev(); bus_space_unmap(fdtbus_bs_tag, scu_addr, 0x1000); } From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 16:56:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 43579B00; Tue, 30 Oct 2012 16:56:17 +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 2B0408FC17; Tue, 30 Oct 2012 16:56:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UGuHD8033840; Tue, 30 Oct 2012 16:56:17 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UGuGKT033838; Tue, 30 Oct 2012 16:56:16 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201210301656.q9UGuGKT033838@svn.freebsd.org> From: Hans Petter Selasky Date: Tue, 30 Oct 2012 16:56:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242364 - head/sys/dev/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 16:56:17 -0000 Author: hselasky Date: Tue Oct 30 16:56:16 2012 New Revision: 242364 URL: http://svn.freebsd.org/changeset/base/242364 Log: If a USB mass storage device doesn't respond properly to the initial SCSI INQUIRY command, enable all quirks. This fixes detection of some Transcend TS2GUFM devices. MFC after: 1 week Reported by: Michael Dexter Modified: head/sys/dev/usb/usb_msctest.c Modified: head/sys/dev/usb/usb_msctest.c ============================================================================== --- head/sys/dev/usb/usb_msctest.c Tue Oct 30 15:25:23 2012 (r242363) +++ head/sys/dev/usb/usb_msctest.c Tue Oct 30 16:56:16 2012 (r242364) @@ -664,8 +664,11 @@ usb_msc_auto_quirk(struct usb_device *ud if (sid_type == 0x00) is_no_direct = 0; break; - } else if (err != ERR_CSW_FAILED) - break; /* non retryable error */ + } else if (err != ERR_CSW_FAILED) { + DPRINTF("Device is not responding " + "properly to SCSI INQUIRY command.\n"); + goto error; /* non retryable error */ + } usb_pause_mtx(NULL, hz); } From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 19:46:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E10AED3D; Tue, 30 Oct 2012 19:46:00 +0000 (UTC) (envelope-from mjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AFBDB8FC0A; Tue, 30 Oct 2012 19:46:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UJk0qi061968; Tue, 30 Oct 2012 19:46:00 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UJk02a061964; Tue, 30 Oct 2012 19:46:00 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201210301946.q9UJk02a061964@svn.freebsd.org> From: Mateusz Guzik Date: Tue, 30 Oct 2012 19:46:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242372 - head/libexec/atrun X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 19:46:01 -0000 Author: mjg Date: Tue Oct 30 19:46:00 2012 New Revision: 242372 URL: http://svn.freebsd.org/changeset/base/242372 Log: atrun(8): scale default load average limit with the number of CPUs Previously atrun refused to run jobs if load average was not below fixed limit of 1.5. PR: 173175 Reviewed by: peterj Approved by: trasz (mentor) MFC after: 2 weeks Modified: head/libexec/atrun/atrun.c head/libexec/atrun/atrun.man Modified: head/libexec/atrun/atrun.c ============================================================================== --- head/libexec/atrun/atrun.c Tue Oct 30 19:34:45 2012 (r242371) +++ head/libexec/atrun/atrun.c Tue Oct 30 19:46:00 2012 (r242372) @@ -33,6 +33,9 @@ static const char rcsid[] = #include #include #include +#ifdef __FreeBSD__ +#include +#endif #include #include #include @@ -454,7 +457,12 @@ main(int argc, char *argv[]) gid_t batch_gid; int c; int run_batch; +#ifdef __FreeBSD__ + size_t ncpu, ncpusz; + double load_avg = -1; +#else double load_avg = LOADAVG_MX; +#endif /* We don't need root privileges all the time; running under uid and gid daemon * is fine. @@ -472,8 +480,10 @@ main(int argc, char *argv[]) case 'l': if (sscanf(optarg, "%lf", &load_avg) != 1) perr("garbled option -l"); +#ifndef __FreeBSD__ if (load_avg <= 0.) load_avg = LOADAVG_MX; +#endif break; case 'd': @@ -489,6 +499,15 @@ main(int argc, char *argv[]) if (chdir(ATJOB_DIR) != 0) perr("cannot change to %s", ATJOB_DIR); +#ifdef __FreeBSD__ + if (load_avg <= 0.) { + ncpusz = sizeof(size_t); + if (sysctlbyname("hw.ncpu", &ncpu, &ncpusz, NULL, 0) < 0) + ncpu = 1; + load_avg = LOADAVG_MX * ncpu; + } +#endif + /* Main loop. Open spool directory for reading and look over all the * files in there. If the filename indicates that the job should be run * and the x bit is set, fork off a child which sets its user and group Modified: head/libexec/atrun/atrun.man ============================================================================== --- head/libexec/atrun/atrun.man Tue Oct 30 19:34:45 2012 (r242371) +++ head/libexec/atrun/atrun.man Tue Oct 30 19:46:00 2012 (r242372) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd June 17, 2007 +.Dd October 30, 2012 .Dt ATRUN 8 .Os .Sh NAME @@ -45,7 +45,7 @@ e.g., locked out or expired. .Bl -tag -width indent .It Fl l Ar load_avg Specify a limiting load factor, over which batch jobs should -not be run, instead of the compiled in default of 1.5. +not be run, instead of the default of 1.5 * number of active CPUs. .It Fl d Debug; print error messages to standard error instead of using .Xr syslog 3 . From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 21:10:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 723B32A0; Tue, 30 Oct 2012 21:10:07 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A0498FC0A; Tue, 30 Oct 2012 21:10:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ULA7Oh076563; Tue, 30 Oct 2012 21:10:07 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ULA7AS076560; Tue, 30 Oct 2012 21:10:07 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201210302110.q9ULA7AS076560@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 30 Oct 2012 21:10:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242378 - head/usr.bin/ktrdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 21:10:07 -0000 Author: np Date: Tue Oct 30 21:10:06 2012 New Revision: 242378 URL: http://svn.freebsd.org/changeset/base/242378 Log: Catch up with r238925. ktr_entries may not be a power of 2. Modified: head/usr.bin/ktrdump/ktrdump.c Modified: head/usr.bin/ktrdump/ktrdump.c ============================================================================== --- head/usr.bin/ktrdump/ktrdump.c Tue Oct 30 21:05:06 2012 (r242377) +++ head/usr.bin/ktrdump/ktrdump.c Tue Oct 30 21:10:06 2012 (r242378) @@ -218,7 +218,7 @@ main(int ac, char **av) * Now tear through the trace buffer. */ if (!iflag) - i = (index - 1) & (entries - 1); + i = (index - 1) % entries; tlast = -1; for (;;) { if (buf[i].ktr_desc == NULL) @@ -286,7 +286,7 @@ next: if ((c = *p++) == '\0') if (!iflag) { if (i == index) break; - i = (i - 1) & (entries - 1); + i = (i - 1) % entries; } else { if (++i == entries) break; From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 21:32:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EC30D8B7; Tue, 30 Oct 2012 21:32:11 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA1228FC14; Tue, 30 Oct 2012 21:32:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9ULWBkM080457; Tue, 30 Oct 2012 21:32:11 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9ULWBp9080449; Tue, 30 Oct 2012 21:32:11 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201210302132.q9ULWBp9080449@svn.freebsd.org> From: Edward Tomasz Napierala Date: Tue, 30 Oct 2012 21:32:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242379 - in head: sbin/dumpfs sbin/growfs sbin/newfs sys/geom/label sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 21:32:12 -0000 Author: trasz Date: Tue Oct 30 21:32:10 2012 New Revision: 242379 URL: http://svn.freebsd.org/changeset/base/242379 Log: Fix problem with geom_label(4) not recognizing UFS labels on filesystems extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation Modified: head/sbin/dumpfs/dumpfs.c head/sbin/growfs/growfs.c head/sbin/newfs/mkfs.c head/sbin/newfs/newfs.c head/sbin/newfs/newfs.h head/sys/geom/label/g_label_ufs.c head/sys/ufs/ffs/fs.h Modified: head/sbin/dumpfs/dumpfs.c ============================================================================== --- head/sbin/dumpfs/dumpfs.c Tue Oct 30 21:10:06 2012 (r242378) +++ head/sbin/dumpfs/dumpfs.c Tue Oct 30 21:32:10 2012 (r242379) @@ -277,8 +277,9 @@ dumpfs(const char *name) printf("unknown flags (%#x)", fsflags); putchar('\n'); printf("fsmnt\t%s\n", afs.fs_fsmnt); - printf("volname\t%s\tswuid\t%ju\n", - afs.fs_volname, (uintmax_t)afs.fs_swuid); + printf("volname\t%s\tswuid\t%ju\tprovidersize\t%ju\n", + afs.fs_volname, (uintmax_t)afs.fs_swuid, + (uintmax_t)afs.fs_providersize); printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t"); afs.fs_csp = calloc(1, afs.fs_cssize); if (bread(&disk, fsbtodb(&afs, afs.fs_csaddr), afs.fs_csp, afs.fs_cssize) == -1) Modified: head/sbin/growfs/growfs.c ============================================================================== --- head/sbin/growfs/growfs.c Tue Oct 30 21:10:06 2012 (r242378) +++ head/sbin/growfs/growfs.c Tue Oct 30 21:32:10 2012 (r242379) @@ -1498,6 +1498,7 @@ main(int argc, char **argv) } sblock.fs_size = dbtofsb(&osblock, size / DEV_BSIZE); + sblock.fs_providersize = dbtofsb(&osblock, mediasize / DEV_BSIZE); /* * Are we really growing? Modified: head/sbin/newfs/mkfs.c ============================================================================== --- head/sbin/newfs/mkfs.c Tue Oct 30 21:10:06 2012 (r242378) +++ head/sbin/newfs/mkfs.c Tue Oct 30 21:32:10 2012 (r242379) @@ -263,6 +263,7 @@ restart: } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_providersize = dbtofsb(&sblock, mediasize / sectorsize); /* * Before the filesystem is finally initialized, mark it Modified: head/sbin/newfs/newfs.c ============================================================================== --- head/sbin/newfs/newfs.c Tue Oct 30 21:10:06 2012 (r242378) +++ head/sbin/newfs/newfs.c Tue Oct 30 21:32:10 2012 (r242379) @@ -94,6 +94,7 @@ int lflag; /* enable multilabel for fi int nflag; /* do not create .snap directory */ int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ +off_t mediasize; /* device size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ int fsize = 0; /* fragment size */ @@ -135,7 +136,6 @@ main(int argc, char *argv[]) char *cp, *special; intmax_t reserved; int ch, i, rval; - off_t mediasize; char part_name; /* partition name, default to full disk */ part_name = 'c'; Modified: head/sbin/newfs/newfs.h ============================================================================== --- head/sbin/newfs/newfs.h Tue Oct 30 21:10:06 2012 (r242378) +++ head/sbin/newfs/newfs.h Tue Oct 30 21:32:10 2012 (r242379) @@ -88,6 +88,7 @@ extern int lflag; /* enable multilabel extern int nflag; /* do not create .snap directory */ extern int tflag; /* enable TRIM */ extern intmax_t fssize; /* file system size */ +extern off_t mediasize; /* device size */ extern int sectorsize; /* bytes/sector */ extern int realsectorsize; /* bytes/sector in hardware*/ extern int fsize; /* fragment size */ Modified: head/sys/geom/label/g_label_ufs.c ============================================================================== --- head/sys/geom/label/g_label_ufs.c Tue Oct 30 21:10:06 2012 (r242378) +++ head/sys/geom/label/g_label_ufs.c Tue Oct 30 21:32:10 2012 (r242379) @@ -90,7 +90,8 @@ g_label_ufs_taste_common(struct g_consum pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_size) { + ((pp->mediasize / fs->fs_fsize == fs->fs_size) || + (pp->mediasize / fs->fs_fsize == fs->fs_providersize))) { /* Valid UFS2. */ } else { g_free(fs); Modified: head/sys/ufs/ffs/fs.h ============================================================================== --- head/sys/ufs/ffs/fs.h Tue Oct 30 21:10:06 2012 (r242378) +++ head/sys/ufs/ffs/fs.h Tue Oct 30 21:32:10 2012 (r242379) @@ -329,7 +329,8 @@ struct fs { int32_t fs_old_cpc; /* cyl per cycle in postbl */ int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_unrefs; /* number of unreferenced inodes */ - int64_t fs_sparecon64[16]; /* old rotation block list head */ + int64_t fs_providersize; /* size of underlying GEOM provider */ + int64_t fs_sparecon64[15]; /* old rotation block list head */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ ufs_time_t fs_time; /* last time written */ From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 22:09:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3943476; Tue, 30 Oct 2012 22:09:53 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A16CC8FC16; Tue, 30 Oct 2012 22:09:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UM9rf8086811; Tue, 30 Oct 2012 22:09:53 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UM9ruq086809; Tue, 30 Oct 2012 22:09:53 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201210302209.q9UM9ruq086809@svn.freebsd.org> From: Dimitry Andric Date: Tue, 30 Oct 2012 22:09:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242380 - head/contrib/llvm/lib/Target/X86 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 22:09:53 -0000 Author: dim Date: Tue Oct 30 22:09:53 2012 New Revision: 242380 URL: http://svn.freebsd.org/changeset/base/242380 Log: Pull in r165377 from upstream llvm trunk: X86: fcmov doesn't handle all possible EFLAGS, fall back to a branch for the others. Otherwise it will try to use SSE patterns and fail horribly if sse is disabled. Fixes PR14035. This should fix the following assertion failure: Assertion failed: (Reg >= X86::FP0 && Reg <= X86::FP6 && "Expected FP register!"), function getFPReg, file contrib/llvm/lib/Target/X86/X86FloatingPoint.cpp, line 330. which can show up when compiling contrib/compiler-rt, using -march=i686 through -march=pentium3 (CPU's which do support fcmov, but don't support SSE2). MFC after: 1 week Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Modified: head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td ============================================================================== --- head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Oct 30 21:32:10 2012 (r242379) +++ head/contrib/llvm/lib/Target/X86/X86InstrCompiler.td Tue Oct 30 22:09:53 2012 (r242380) @@ -453,6 +453,11 @@ def CMOV_GR16 : I<0, Pseudo, "#CMOV_GR16* PSEUDO!", [(set GR16:$dst, (X86cmov GR16:$src1, GR16:$src2, imm:$cond, EFLAGS))]>; +} // Predicates = [NoCMov] + +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE1. +let Predicates = [FPStackf32] in def CMOV_RFP32 : I<0, Pseudo, (outs RFP32:$dst), (ins RFP32:$src1, RFP32:$src2, i8imm:$cond), @@ -460,6 +465,9 @@ def CMOV_RFP32 : I<0, Pseudo, [(set RFP32:$dst, (X86cmov RFP32:$src1, RFP32:$src2, imm:$cond, EFLAGS))]>; +// fcmov doesn't handle all possible EFLAGS, provide a fallback if there is no +// SSE2. +let Predicates = [FPStackf64] in def CMOV_RFP64 : I<0, Pseudo, (outs RFP64:$dst), (ins RFP64:$src1, RFP64:$src2, i8imm:$cond), @@ -474,7 +482,6 @@ def CMOV_RFP80 : I<0, Pseudo, [(set RFP80:$dst, (X86cmov RFP80:$src1, RFP80:$src2, imm:$cond, EFLAGS))]>; -} // Predicates = [NoCMov] } // UsesCustomInserter = 1, Uses = [EFLAGS] From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 22:18:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 54739A88; Tue, 30 Oct 2012 22:18:09 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3ABF48FC18; Tue, 30 Oct 2012 22:18:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UMI940088517; Tue, 30 Oct 2012 22:18:09 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UMI9jK088514; Tue, 30 Oct 2012 22:18:09 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210302218.q9UMI9jK088514@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 30 Oct 2012 22:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242381 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 22:18:09 -0000 Author: bapt Date: Tue Oct 30 22:18:08 2012 New Revision: 242381 URL: http://svn.freebsd.org/changeset/base/242381 Log: Document the pw_util(3) functions Reviewed by: des, gjb Added: head/lib/libutil/pw_util.3 (contents, props changed) Modified: head/lib/libutil/Makefile Modified: head/lib/libutil/Makefile ============================================================================== --- head/lib/libutil/Makefile Tue Oct 30 22:09:53 2012 (r242380) +++ head/lib/libutil/Makefile Tue Oct 30 22:18:08 2012 (r242381) @@ -30,7 +30,7 @@ MAN+= expand_number.3 flopen.3 fparseln. kinfo_getproc.3 kinfo_getvmmap.3 kld.3 login_auth.3 login_cap.3 \ login_class.3 login_ok.3 login_times.3 login_tty.3 pidfile.3 \ property.3 pty.3 quotafile.3 realhostname.3 realhostname_sa.3 \ - _secure_path.3 trimdomain.3 uucplock.3 + _secure_path.3 trimdomain.3 uucplock.3 pw_util.3 MAN+= login.conf.5 MLINKS+= kld.3 kld_isloaded.3 kld.3 kld_load.3 MLINKS+=login_auth.3 auth_cat.3 login_auth.3 auth_checknologin.3 @@ -67,5 +67,18 @@ MLINKS+=quotafile.3 quota_close.3 \ quotafile.3 quota_write_usage.3 MLINKS+=uucplock.3 uu_lock.3 uucplock.3 uu_lock_txfr.3 \ uucplock.3 uu_lockerr.3 uucplock.3 uu_unlock.3 +MLINKS+=pw_util.3 pw_copy.3 \ + pw_util.3 pw_dup.3 \ + pw_util.3 pw_edit.3 \ + pw_util.3 pw_equal.3 \ + pw_util.3 pw_fini.3 \ + pw_util.3 pw_init.3 \ + pw_util.3 pw_make.3 \ + pw_util.3 pw_make_v7.3 \ + pw_util.3 pw_mkdb.3 \ + pw_util.3 pw_lock.3 \ + pw_util.3 pw_scan.3 \ + pw_util.3 pw_tempname.3 \ + pw_util.3 pw_tmp.3 .include Added: head/lib/libutil/pw_util.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/libutil/pw_util.3 Tue Oct 30 22:18:08 2012 (r242381) @@ -0,0 +1,285 @@ +.\" Copyright (c) 2012 Baptiste Daroussin +.\" All rights reserved. +.\" +.\" This software was developed by Pawel Jakub Dawidek under sponsorship from +.\" the FreeBSD Foundation. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd October 30, 2012 +.Dt PW_UTIL 3 +.Os +.Sh NAME +.Nm pw_copy , +.Nm pw_dup , +.Nm pw_edit , +.Nm pw_equal , +.Nm pw_fini , +.Nm pw_init , +.Nm pw_make , +.Nm pw_make_v7 , +.Nm pw_mkdb , +.Nm pw_lock , +.Nm pw_scan , +.Nm pw_tempname , +.Nm pw_tmp +.Nd "functions for passwd file handling" +.Sh LIBRARY +.Lb libutil +.Sh SYNOPSIS +.In pwd.h +.In libutil.h +.Ft int +.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct paddwd *oldpw" +.Ft "struct passwd *" +.Fn pw_dup "const struct passwd *pw" +.Ft int +.Fn pw_edit "int nosetuid" +.Ft int +.Fn pw_equal "const struct passwd *pw1" "const struct passwd pw2" +.Ft void +.Fn pw_fini "void" +.Ft int +.Fn pw_init "const char *dir" const char *master" +.Ft "char *" +.Fn pw_make "const struct passwd *pw" +.Ft "char *" +.Fn pw_make_v7 "const struct passwd *pw" +.Ft int +.Fn pw_mkdb "const char *user" +.Ft int +.Fn pw_lock "void" +.Ft "struct passwd *" +.Fn pw_scan "const char *line" "int flags" +.Ft "const char *" +.Fn pw_tempname "void" +.Ft int +.Fn pw_tmp "int mfd" +.Sh DESCRIPTION +.Pp +The +.Fn pw_copy +function reads a password file from +.Vt ffd +and writes it back out to +.Vt tfd +possibly with modifications: +.Bl -dash +.It +If +.Fa pw +is +.Dv NULL +and +.Fa oldpw +is not +.Dv NULL , +then the record represented by +.Fa oldpw +will not be copied (corresponding to user deletion). +.It +If +.Fa pw +and +.Fa oldpw +are not +.Dv NULL +then the record corresponding to +.Fa pw +will be replace by the record corresponding to +.Fa oldpw . +.It +If +.Vt pw +is set and +.Vt oldpw +is +.Dv NULL +then the record corresponding to +.Vt pw +will be appended (corresponding to user addition). +.El +.Pp +The +.Fn pw_copy +function returns -1 in case of failure otherwise 0. +.Pp +The +.Fn pw_dup +function duplicates the +.Vt struct passwd +pointed to by +.Fa pw +and returns a pointer to the copy, or +.Dv NULL +in case of failure. +The new +.Vt struct passwd +is allocated with +.Xr malloc 3 , +and it is the caller's responsibility to free it with +.Xr free 3 . +.Pp +The +.Fn pw_edit +function invokes the command specified by the +.Ev EDITOR +environment variable (or +.Pa /usr/bin/vi +if +.Ev EDITOR +is not defined) +on a temporary copy of the master password file created by +.Fn pw_tmp . +If the file was modified, +.Fn pw_edit +installs it and regenerates the password database. +The +.Fn pw_edit +function returns -1 in case of failure, 0 if the file was not modified, +and a non-zero positive number if the file was modified and successfully +installed. +.Pp +The +.Fn pw_equal +function compares two +.Vt struct passwd +and returns 0 if they are equal. +.Pp +The +.Fn pw_fini +function destroy the temporary file created by +.Fn pw_tmp +if any, +kills any running instance of +.Ev EDITOR +excuted by +.Fn pw_edit +if any, +and closes the lock created by +.Fn pw_lock +if any. +.Pp +The +.Fn pw_init +initialize the static variable representing the path a password file. +.Fa dir +is the directory where the password file is located. +If set to +.Dv NULL , +it will default to +.Pa /etc . +.Fa master +is the name of the password file. +If set to +.Dv NULL? +it will default to +.Pa master.passwd +.Pp +The +.Fn pw_make +function creates a properly formatted +.Bx +.Xr passwd 5 +line from a +.Vt struct passwd , +and returns a pointer to the resulting string. +The string is allocated with +.Xr malloc 3 , +and it is the caller's responsibility to free it with +.Xr free 3 . +.Pp +The +.Fn pw_make_v7 +function creates a properly formatted +.Ux V7 +.Xr passwd 5 +line from a +.Vt struct passwd , +and returns a pointer to the resulting string. +The string is allocated with +.Xr malloc 3 , +and it is the caller's responsibility to free it with +.Xr free 3 . +.Pp +The +.Fn pw_mkdb +function regenerates the password database by running +.Xr pw_mkdb 8 . +If +.Fa user +only the record corresponding to that user will be updated. +The +.Fn pw_mkdb +function returns 0 in case of success and -1 in case of failure. +.Pp +The +.Fn pw_lock +function locks the master password file. +It returns 0 in case of success and -1 in case of failure. +.Pp +The +.Fn pw_scan +function is a wrapper around the internal libc function +.Fn __pw_scan . +It scans the master password file for a line corresponding to the +.Fa line +provided and return a +.Vt struct passwd +if it matched an existing record. +In case of failure, it returns +.Dv NULL . +Otherwise, it returns a pointer to a +.Vt struct passwd +containing the matching record. +The +.Vt struct passwd +is allocated with +.Xr malloc 3 , +and it is the caller's responsibility to free it with +.Xr free 3 . +.Pp +The +.Fn pw_tempname +function returns the temporary name of the masterfile created via +.Fn pw_tmp . +.Pp +The +.Fn pw_tmp +creates and opens a presumably safe temporary password file. +If +.Fa mfd +is a file descriptor to an open password file, it will be read and +written back to the temporary password file. +Otherwise if should be set -1. +The +.Fn pw_tmp +returns an open file descriptor to the temporary password file or -1 in case of +failure. +.Sh AUTHORS +.Nm pw_util +was written by +.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +This manual page was written by +.An Baptiste Daroussin Aq bapt@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 22:26:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4D7B7C64; Tue, 30 Oct 2012 22:26:20 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 30FFF8FC0A; Tue, 30 Oct 2012 22:26:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UMQKdw089932; Tue, 30 Oct 2012 22:26:20 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UMQJAG089929; Tue, 30 Oct 2012 22:26:19 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201210302226.q9UMQJAG089929@svn.freebsd.org> From: Baptiste Daroussin Date: Tue, 30 Oct 2012 22:26:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242382 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 22:26:20 -0000 Author: bapt Date: Tue Oct 30 22:26:19 2012 New Revision: 242382 URL: http://svn.freebsd.org/changeset/base/242382 Log: Removed unnecessary bits in the header that shows where I stole the template Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Tue Oct 30 22:18:08 2012 (r242381) +++ head/lib/libutil/pw_util.3 Tue Oct 30 22:26:19 2012 (r242382) @@ -1,9 +1,6 @@ .\" Copyright (c) 2012 Baptiste Daroussin .\" All rights reserved. .\" -.\" This software was developed by Pawel Jakub Dawidek 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: From owner-svn-src-head@FreeBSD.ORG Tue Oct 30 22:30:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B4F614E; Tue, 30 Oct 2012 22:30:31 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F3A708FC15; Tue, 30 Oct 2012 22:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9UMUUV4090682; Tue, 30 Oct 2012 22:30:30 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9UMUUhE090680; Tue, 30 Oct 2012 22:30:30 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201210302230.q9UMUUhE090680@svn.freebsd.org> From: Joel Dahl Date: Tue, 30 Oct 2012 22:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242383 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 22:30:31 -0000 Author: joel (doc committer) Date: Tue Oct 30 22:30:30 2012 New Revision: 242383 URL: http://svn.freebsd.org/changeset/base/242383 Log: Minor mdoc and language fixes. Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Tue Oct 30 22:26:19 2012 (r242382) +++ head/lib/libutil/pw_util.3 Tue Oct 30 22:30:30 2012 (r242383) @@ -74,7 +74,6 @@ .Ft int .Fn pw_tmp "int mfd" .Sh DESCRIPTION -.Pp The .Fn pw_copy function reads a password file from @@ -104,7 +103,7 @@ are not .Dv NULL then the record corresponding to .Fa pw -will be replace by the record corresponding to +will be replaced by the record corresponding to .Fa oldpw . .It If @@ -171,7 +170,7 @@ function destroy the temporary file crea if any, kills any running instance of .Ev EDITOR -excuted by +executed by .Fn pw_edit if any, and closes the lock created by From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 02:54:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B9E7AA03; Wed, 31 Oct 2012 02:54:44 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9CDA78FC14; Wed, 31 Oct 2012 02:54:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V2siI1032643; Wed, 31 Oct 2012 02:54:44 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V2sibf032638; Wed, 31 Oct 2012 02:54:44 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201210310254.q9V2sibf032638@svn.freebsd.org> From: Davide Italiano Date: Wed, 31 Oct 2012 02:54:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242384 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 02:54:44 -0000 Author: davide Date: Wed Oct 31 02:54:44 2012 New Revision: 242384 URL: http://svn.freebsd.org/changeset/base/242384 Log: Change the code to use %jd as printf() placeholder for uio_offset and cast to intmax_t. Suggested by: pjd Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Tue Oct 30 22:30:30 2012 (r242383) +++ head/sys/fs/smbfs/smbfs_io.c Wed Oct 31 02:54:44 2012 (r242384) @@ -241,7 +241,8 @@ smbfs_writevnode(struct vnode *vp, struc SMBERROR("vn types other than VREG unsupported !\n"); return EIO; } - SMBVDEBUG("ofs=%d,resid=%zd\n",(int)uiop->uio_offset, uiop->uio_resid); + SMBVDEBUG("ofs=%jd,resid=%zd\n", (intmax_t)uiop->uio_offset, + uiop->uio_resid); if (uiop->uio_offset < 0) return EINVAL; /* if (uiop->uio_offset + uiop->uio_resid > smp->nm_maxfilesize) @@ -274,7 +275,8 @@ smbfs_writevnode(struct vnode *vp, struc smb_makescred(&scred, td, cred); error = smb_write(smp->sm_share, np->n_fid, uiop, &scred); - SMBVDEBUG("after: ofs=%d,resid=%zd\n",(int)uiop->uio_offset, uiop->uio_resid); + SMBVDEBUG("after: ofs=%jd,resid=%zd\n", (intmax_t)uiop->uio_offset, + uiop->uio_resid); if (!error) { if (uiop->uio_offset > np->n_size) { np->n_size = uiop->uio_offset; @@ -601,7 +603,8 @@ smbfs_putpages(ap) uio.uio_segflg = UIO_SYSSPACE; uio.uio_rw = UIO_WRITE; uio.uio_td = td; - SMBVDEBUG("ofs=%d,resid=%zd\n",(int)uio.uio_offset, uio.uio_resid); + SMBVDEBUG("ofs=%jd,resid=%zd\n", (intmax_t)uio.uio_offset, + uio.uio_resid); smb_makescred(&scred, td, cred); error = smb_write(smp->sm_share, np->n_fid, &uio, &scred); Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Tue Oct 30 22:30:30 2012 (r242383) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Oct 31 02:54:44 2012 (r242384) @@ -452,7 +452,7 @@ smbfs_write(ap) struct vnode *vp = ap->a_vp; struct uio *uio = ap->a_uio; - SMBVDEBUG("%d,ofs=%d,sz=%zd\n",vp->v_type, (int)uio->uio_offset, + SMBVDEBUG("%d,ofs=%jd,sz=%zd\n",vp->v_type, (intmax_t)uio->uio_offset, uio->uio_resid); if (vp->v_type != VREG) return (EPERM); From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 03:34:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DA0DB413; Wed, 31 Oct 2012 03:34:07 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6138FC15; Wed, 31 Oct 2012 03:34:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V3Y7Oe039093; Wed, 31 Oct 2012 03:34:07 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V3Y7If039084; Wed, 31 Oct 2012 03:34:07 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201210310334.q9V3Y7If039084@svn.freebsd.org> From: Davide Italiano Date: Wed, 31 Oct 2012 03:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242386 - in head/sys: fs/smbfs netsmb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 03:34:08 -0000 Author: davide Date: Wed Oct 31 03:34:07 2012 New Revision: 242386 URL: http://svn.freebsd.org/changeset/base/242386 Log: Fix panic due to page faults while in kernel mode, under conditions of VM pressure. The reason is that in some codepaths pointers to stack variables were passed from one thread to another. In collaboration with: pho Reported by: pho's stress2 suite Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs_io.c head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_smb.c head/sys/fs/smbfs/smbfs_subr.c head/sys/fs/smbfs/smbfs_subr.h head/sys/fs/smbfs/smbfs_vfsops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/netsmb/smb_conn.c head/sys/netsmb/smb_dev.c head/sys/netsmb/smb_trantcp.c head/sys/netsmb/smb_usr.c Modified: head/sys/fs/smbfs/smbfs_io.c ============================================================================== --- head/sys/fs/smbfs/smbfs_io.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_io.c Wed Oct 31 03:34:07 2012 (r242386) @@ -75,7 +75,7 @@ smbfs_readvdir(struct vnode *vp, struct { struct dirent de; struct componentname cn; - struct smb_cred scred; + struct smb_cred *scred; struct smbfs_fctx *ctx; struct vnode *newvp; struct smbnode *np = VTOSMB(vp); @@ -84,11 +84,14 @@ smbfs_readvdir(struct vnode *vp, struct np = VTOSMB(vp); SMBVDEBUG("dirname='%s'\n", np->n_name); - smb_makescred(&scred, uio->uio_td, cred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, uio->uio_td, cred); offset = uio->uio_offset / DE_SIZE; /* offset in the directory */ limit = uio->uio_resid / DE_SIZE; - if (uio->uio_resid < DE_SIZE || uio->uio_offset < 0) - return EINVAL; + if (uio->uio_resid < DE_SIZE || uio->uio_offset < 0) { + error = EINVAL; + goto out; + } while (limit && offset < 2) { limit--; bzero((caddr_t)&de, DE_SIZE); @@ -104,40 +107,43 @@ smbfs_readvdir(struct vnode *vp, struct de.d_type = DT_DIR; error = uiomove(&de, DE_SIZE, uio); if (error) - return error; + goto out; offset++; uio->uio_offset += DE_SIZE; } - if (limit == 0) - return 0; + if (limit == 0) { + error = 0; + goto out; + } if (offset != np->n_dirofs || np->n_dirseq == NULL) { SMBVDEBUG("Reopening search %ld:%ld\n", offset, np->n_dirofs); if (np->n_dirseq) { - smbfs_findclose(np->n_dirseq, &scred); + smbfs_findclose(np->n_dirseq, scred); np->n_dirseq = NULL; } np->n_dirofs = 2; error = smbfs_findopen(np, "*", 1, SMB_FA_SYSTEM | SMB_FA_HIDDEN | SMB_FA_DIR, - &scred, &ctx); + scred, &ctx); if (error) { SMBVDEBUG("can not open search, error = %d", error); - return error; + goto out; } np->n_dirseq = ctx; } else ctx = np->n_dirseq; while (np->n_dirofs < offset) { - error = smbfs_findnext(ctx, offset - np->n_dirofs++, &scred); + error = smbfs_findnext(ctx, offset - np->n_dirofs++, scred); if (error) { - smbfs_findclose(np->n_dirseq, &scred); + smbfs_findclose(np->n_dirseq, scred); np->n_dirseq = NULL; - return error == ENOENT ? 0 : error; + error = ENOENT ? 0 : error; + goto out; } } error = 0; for (; limit; limit--, offset++) { - error = smbfs_findnext(ctx, limit, &scred); + error = smbfs_findnext(ctx, limit, scred); if (error) break; np->n_dirofs++; @@ -165,6 +171,8 @@ smbfs_readvdir(struct vnode *vp, struct if (error == ENOENT) error = 0; uio->uio_offset = offset * DE_SIZE; +out: + smbfs_free_scred(scred); return error; } @@ -175,7 +183,7 @@ smbfs_readvnode(struct vnode *vp, struct struct smbnode *np = VTOSMB(vp); struct thread *td; struct vattr vattr; - struct smb_cred scred; + struct smb_cred *scred; int error, lks; /* @@ -223,8 +231,11 @@ smbfs_readvnode(struct vnode *vp, struct np->n_mtime.tv_sec = vattr.va_mtime.tv_sec; } } - smb_makescred(&scred, td, cred); - return smb_read(smp->sm_share, np->n_fid, uiop, &scred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); + error = smb_read(smp->sm_share, np->n_fid, uiop, scred); + smbfs_free_scred(scred); + return (error); } int @@ -233,7 +244,7 @@ smbfs_writevnode(struct vnode *vp, struc { struct smbmount *smp = VTOSMBFS(vp); struct smbnode *np = VTOSMB(vp); - struct smb_cred scred; + struct smb_cred *scred; struct thread *td; int error = 0; @@ -272,9 +283,11 @@ smbfs_writevnode(struct vnode *vp, struc if (vn_rlimit_fsize(vp, uiop, td)) return (EFBIG); - - smb_makescred(&scred, td, cred); - error = smb_write(smp->sm_share, np->n_fid, uiop, &scred); + + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); + error = smb_write(smp->sm_share, np->n_fid, uiop, scred); + smbfs_free_scred(scred); SMBVDEBUG("after: ofs=%jd,resid=%zd\n", (intmax_t)uiop->uio_offset, uiop->uio_resid); if (!error) { @@ -294,17 +307,19 @@ smbfs_doio(struct vnode *vp, struct buf { struct smbmount *smp = VFSTOSMBFS(vp->v_mount); struct smbnode *np = VTOSMB(vp); - struct uio uio, *uiop = &uio; + struct uio *uiop; struct iovec io; - struct smb_cred scred; + struct smb_cred *scred; int error = 0; + uiop = malloc(sizeof(struct uio), M_SMBFSDATA, M_WAITOK); uiop->uio_iov = &io; uiop->uio_iovcnt = 1; uiop->uio_segflg = UIO_SYSSPACE; uiop->uio_td = td; - smb_makescred(&scred, td, cr); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cr); if (bp->b_iocmd == BIO_READ) { io.iov_len = uiop->uio_resid = bp->b_bcount; @@ -313,7 +328,7 @@ smbfs_doio(struct vnode *vp, struct buf switch (vp->v_type) { case VREG: uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE; - error = smb_read(smp->sm_share, np->n_fid, uiop, &scred); + error = smb_read(smp->sm_share, np->n_fid, uiop, scred); if (error) break; if (uiop->uio_resid) { @@ -340,7 +355,7 @@ smbfs_doio(struct vnode *vp, struct buf uiop->uio_offset = ((off_t)bp->b_blkno) * DEV_BSIZE + bp->b_dirtyoff; io.iov_base = (char *)bp->b_data + bp->b_dirtyoff; uiop->uio_rw = UIO_WRITE; - error = smb_write(smp->sm_share, np->n_fid, uiop, &scred); + error = smb_write(smp->sm_share, np->n_fid, uiop, scred); /* * For an interrupted write, the buffer is still valid @@ -380,11 +395,15 @@ smbfs_doio(struct vnode *vp, struct buf } else { bp->b_resid = 0; bufdone(bp); + free(uiop, M_SMBFSDATA); + smbfs_free_scred(scred); return 0; } } bp->b_resid = uiop->uio_resid; bufdone(bp); + free(uiop, M_SMBFSDATA); + smbfs_free_scred(scred); return error; } @@ -415,7 +434,7 @@ smbfs_getpages(ap) struct ucred *cred; struct smbmount *smp; struct smbnode *np; - struct smb_cred scred; + struct smb_cred *scred; vm_object_t object; vm_page_t *pages, m; @@ -455,7 +474,8 @@ smbfs_getpages(ap) } VM_OBJECT_UNLOCK(object); - smb_makescred(&scred, td, cred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); bp = getpbuf(&smbfs_pbuf_freecnt); @@ -474,7 +494,8 @@ smbfs_getpages(ap) uio.uio_rw = UIO_READ; uio.uio_td = td; - error = smb_read(smp->sm_share, np->n_fid, &uio, &scred); + error = smb_read(smp->sm_share, np->n_fid, &uio, scred); + smbfs_free_scred(scred); pmap_qremove(kva, npages); relpbuf(bp, &smbfs_pbuf_freecnt); @@ -570,7 +591,7 @@ smbfs_putpages(ap) int *rtvals; struct smbmount *smp; struct smbnode *np; - struct smb_cred scred; + struct smb_cred *scred; vm_page_t *pages; td = curthread; /* XXX */ @@ -606,8 +627,10 @@ smbfs_putpages(ap) SMBVDEBUG("ofs=%jd,resid=%zd\n", (intmax_t)uio.uio_offset, uio.uio_resid); - smb_makescred(&scred, td, cred); - error = smb_write(smp->sm_share, np->n_fid, &uio, &scred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); + error = smb_write(smp->sm_share, np->n_fid, &uio, scred); + smbfs_free_scred(scred); /* VOP_CLOSE(vp, FWRITE, cred, td);*/ SMBVDEBUG("paged write done: %d\n", error); Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:34:07 2012 (r242386) @@ -349,25 +349,27 @@ smbfs_inactive(ap) struct ucred *cred = td->td_ucred; struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); - struct smb_cred scred; + struct smb_cred *scred; struct vattr va; SMBVDEBUG("%s: %d\n", VTOSMB(vp)->n_name, vrefcnt(vp)); if ((np->n_flag & NOPEN) != 0) { - smb_makescred(&scred, td, cred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); smbfs_vinvalbuf(vp, td); if (vp->v_type == VREG) { VOP_GETATTR(vp, &va, cred); smbfs_smb_close(np->n_mount->sm_share, np->n_fid, - &np->n_mtime, &scred); + &np->n_mtime, scred); } else if (vp->v_type == VDIR) { if (np->n_dirseq != NULL) { - smbfs_findclose(np->n_dirseq, &scred); + smbfs_findclose(np->n_dirseq, scred); np->n_dirseq = NULL; } } np->n_flag &= ~NOPEN; smbfs_attr_cacheremove(vp); + smbfs_free_scred(scred); } if (np->n_flag & NGONE) vrecycle(vp); Modified: head/sys/fs/smbfs/smbfs_smb.c ============================================================================== --- head/sys/fs/smbfs/smbfs_smb.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_smb.c Wed Oct 31 03:34:07 2012 (r242386) @@ -87,16 +87,19 @@ smbfs_smb_lockandx(struct smbnode *np, i struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mbchain *mbp; u_char ltype = 0; int error; if (op == SMB_LOCK_SHARED) ltype |= SMB_LOCKING_ANDX_SHARED_LOCK; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_LOCKING_ANDX, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint8(mbp, 0xff); /* secondary command */ @@ -116,6 +119,7 @@ smbfs_smb_lockandx(struct smbnode *np, i smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -179,20 +183,24 @@ int smbfs_smb_statfs(struct smb_share *ssp, struct statfs *sbp, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mdchain *mdp; u_int16_t units, bpu, bsize, funits; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_QUERY_INFORMATION_DISK, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_wstart(rqp); smb_rq_wend(rqp); smb_rq_bstart(rqp); smb_rq_bend(rqp); error = smb_rq_simple(rqp); if (error) { + free(rqp, M_SMBFSDATA); smb_rq_done(rqp); return error; } @@ -208,6 +216,7 @@ smbfs_smb_statfs(struct smb_share *ssp, sbp->f_files = 0xffff; /* total file nodes in filesystem */ sbp->f_ffree = 0xffff; /* free file nodes in fs */ smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return 0; } @@ -244,16 +253,19 @@ static int smb_smb_flush(struct smbnode *np, struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mbchain *mbp; int error; if ((np->n_flag & NOPEN) == 0 || !SMBTOV(np) || SMBTOV(np)->v_type != VREG) return 0; /* not a regular open file */ + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_FLUSH, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return (error); + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); @@ -262,6 +274,7 @@ smb_smb_flush(struct smbnode *np, struct smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); if (!error) np->n_flag &= ~NFLUSHWIRE; return (error); @@ -279,7 +292,7 @@ int smbfs_smb_setfsize(struct smbnode *np, int newsize, struct smb_cred *scred) { struct smb_share *ssp = np->n_mount->sm_share; - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mbchain *mbp; int error; @@ -288,9 +301,12 @@ smbfs_smb_setfsize(struct smbnode *np, i return (0); } + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_WRITE, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&np->n_fid, 2, MB_MSYSTEM); @@ -304,6 +320,7 @@ smbfs_smb_setfsize(struct smbnode *np, i smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -311,7 +328,7 @@ int smbfs_smb_query_info(struct smbnode *np, const char *name, int len, struct smbfattr *fap, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; struct mdchain *mdp; @@ -320,9 +337,12 @@ smbfs_smb_query_info(struct smbnode *np, u_int16_t wattr; u_int32_t lint; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_QUERY_INFORMATION, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -357,6 +377,7 @@ smbfs_smb_query_info(struct smbnode *np, fap->fa_size = lint; } while(0); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -367,15 +388,18 @@ int smbfs_smb_setpattr(struct smbnode *np, u_int16_t attr, struct timespec *mtime, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; u_long time; int error, svtz; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_SET_INFORMATION, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } svtz = SSTOVC(ssp)->vc_sopt.sv_tz; smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); @@ -407,6 +431,7 @@ smbfs_smb_setpattr(struct smbnode *np, u } } while(0); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -523,15 +548,18 @@ int smbfs_smb_setftime(struct smbnode *np, struct timespec *mtime, struct timespec *atime, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; u_int16_t date, time; int error, tzoff; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_SET_INFORMATION2, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } tzoff = SSTOVC(ssp)->vc_sopt.sv_tz; smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); @@ -556,6 +584,7 @@ smbfs_smb_setftime(struct smbnode *np, s error = smb_rq_simple(rqp); SMBSDEBUG("%d\n", error); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -611,7 +640,7 @@ smbfs_smb_setfattrNT(struct smbnode *np, int smbfs_smb_open(struct smbnode *np, int accmode, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; struct mdchain *mdp; @@ -619,9 +648,12 @@ smbfs_smb_open(struct smbnode *np, int a u_int16_t fid, wattr, grantedmode; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_OPEN, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, accmode); @@ -652,6 +684,7 @@ smbfs_smb_open(struct smbnode *np, int a */ } while(0); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); if (error) return error; np->n_fid = fid; @@ -664,14 +697,17 @@ int smbfs_smb_close(struct smb_share *ssp, u_int16_t fid, struct timespec *mtime, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mbchain *mbp; u_long time; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CLOSE, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&fid, sizeof(fid), MB_MSYSTEM); @@ -685,6 +721,7 @@ smbfs_smb_close(struct smb_share *ssp, u smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -692,7 +729,7 @@ int smbfs_smb_create(struct smbnode *dnp, const char *name, int nmlen, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = dnp->n_mount->sm_share; struct mbchain *mbp; struct mdchain *mdp; @@ -702,9 +739,12 @@ smbfs_smb_create(struct smbnode *dnp, co u_long tm; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CREATE, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_ARCHIVE); /* attributes */ @@ -731,20 +771,24 @@ smbfs_smb_create(struct smbnode *dnp, co if (error) return error; smbfs_smb_close(ssp, fid, &ctime, scred); + free(rqp, M_SMBFSDATA); return error; } int smbfs_smb_delete(struct smbnode *np, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_DELETE, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_SYSTEM | SMB_FA_HIDDEN); @@ -757,6 +801,7 @@ smbfs_smb_delete(struct smbnode *np, str error = smb_rq_simple(rqp); } smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -764,14 +809,17 @@ int smbfs_smb_rename(struct smbnode *src, struct smbnode *tdnp, const char *tname, int tnmlen, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = src->n_mount->sm_share; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_RENAME, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_FA_SYSTEM | SMB_FA_HIDDEN); @@ -790,6 +838,7 @@ smbfs_smb_rename(struct smbnode *src, st error = smb_rq_simple(rqp); } while(0); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -797,14 +846,17 @@ int smbfs_smb_move(struct smbnode *src, struct smbnode *tdnp, const char *tname, int tnmlen, u_int16_t flags, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = src->n_mount->sm_share; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_MOVE, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_uint16le(mbp, SMB_TID_UNKNOWN); @@ -825,6 +877,7 @@ smbfs_smb_move(struct smbnode *src, stru error = smb_rq_simple(rqp); } while(0); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -832,14 +885,17 @@ int smbfs_smb_mkdir(struct smbnode *dnp, const char *name, int len, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = dnp->n_mount->sm_share; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_CREATE_DIRECTORY, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -851,20 +907,24 @@ smbfs_smb_mkdir(struct smbnode *dnp, con error = smb_rq_simple(rqp); } smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } int smbfs_smb_rmdir(struct smbnode *np, struct smb_cred *scred) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct smb_share *ssp = np->n_mount->sm_share; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ssp), SMB_COM_DELETE_DIRECTORY, scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); smb_rq_wend(rqp); @@ -876,6 +936,7 @@ smbfs_smb_rmdir(struct smbnode *np, stru error = smb_rq_simple(rqp); } smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } @@ -1139,13 +1200,16 @@ smbfs_smb_trans2find2(struct smbfs_fctx static int smbfs_smb_findclose2(struct smbfs_fctx *ctx) { - struct smb_rq rq, *rqp = &rq; + struct smb_rq *rqp; struct mbchain *mbp; int error; + rqp = malloc(sizeof(struct smb_rq), M_SMBFSDATA, M_WAITOK); error = smb_rq_init(rqp, SSTOCP(ctx->f_ssp), SMB_COM_FIND_CLOSE2, ctx->f_scred); - if (error) + if (error) { + free(rqp, M_SMBFSDATA); return error; + } smb_rq_getrequest(rqp, &mbp); smb_rq_wstart(rqp); mb_put_mem(mbp, (caddr_t)&ctx->f_Sid, 2, MB_MSYSTEM); @@ -1154,6 +1218,7 @@ smbfs_smb_findclose2(struct smbfs_fctx * smb_rq_bend(rqp); error = smb_rq_simple(rqp); smb_rq_done(rqp); + free(rqp, M_SMBFSDATA); return error; } Modified: head/sys/fs/smbfs/smbfs_subr.c ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_subr.c Wed Oct 31 03:34:07 2012 (r242386) @@ -46,6 +46,7 @@ #include MALLOC_DEFINE(M_SMBFSDATA, "smbfs_data", "SMBFS private data"); +MALLOC_DEFINE(M_SMBFSCRED, "smbfs_cred", "SMBFS cred data"); void smb_time_local2server(struct timespec *tsp, int tzoff, u_long *seconds) @@ -222,3 +223,15 @@ smbfs_fname_tolocal(struct smb_vc *vcp, } return error; } + +void * +smbfs_malloc_scred(void) +{ + return (malloc(sizeof(struct smb_cred), M_SMBFSCRED, M_WAITOK)); +} + +void +smbfs_free_scred(void *scred) +{ + free(scred, M_SMBFSCRED); +} Modified: head/sys/fs/smbfs/smbfs_subr.h ============================================================================== --- head/sys/fs/smbfs/smbfs_subr.h Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_subr.h Wed Oct 31 03:34:07 2012 (r242386) @@ -30,6 +30,7 @@ #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_SMBFSDATA); +MALLOC_DECLARE(M_SMBFSCRED); #endif #define SMBFSERR(format, args...) printf("%s: "format, __func__ ,## args) @@ -178,4 +179,6 @@ void smb_time_unix2dos(struct timespec u_int16_t *dtp, u_int8_t *dhp); void smb_dos2unixtime (u_int dd, u_int dt, u_int dh, int tzoff, struct timespec *tsp); +void *smbfs_malloc_scred(void); +void smbfs_free_scred(void *); #endif /* !_FS_SMBFS_SMBFS_SUBR_H_ */ Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:34:07 2012 (r242386) @@ -137,7 +137,7 @@ smbfs_mount(struct mount *mp) struct smb_share *ssp = NULL; struct vnode *vp; struct thread *td; - struct smb_cred scred; + struct smb_cred *scred; int error, v; char *pc, *pe; @@ -150,15 +150,18 @@ smbfs_mount(struct mount *mp) return (EINVAL); } - smb_makescred(&scred, td, td->td_ucred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, td->td_ucred); if (1 != vfs_scanopt(mp->mnt_optnew, "dev", "%d", &v)) { vfs_mount_error(mp, "No dev option"); + smbfs_free_scred(scred); return (EINVAL); } - error = smb_dev2share(v, SMBM_EXEC, &scred, &ssp); + error = smb_dev2share(v, SMBM_EXEC, scred, &ssp); if (error) { printf("invalid device handle %d (%d)\n", v, error); vfs_mount_error(mp, "invalid device handle %d (%d)\n", v, error); + smbfs_free_scred(scred); return error; } vcp = SSTOVC(ssp); @@ -237,6 +240,7 @@ smbfs_mount(struct mount *mp) #ifdef DIAGNOSTIC SMBERROR("mp=%p\n", mp); #endif + smbfs_free_scred(scred); return error; bad: if (smp) { @@ -246,7 +250,8 @@ bad: free(smp, M_SMBFSDATA); } if (ssp) - smb_share_put(ssp, &scred); + smb_share_put(ssp, scred); + smbfs_free_scred(scred); return error; } @@ -256,7 +261,7 @@ smbfs_unmount(struct mount *mp, int mntf { struct thread *td; struct smbmount *smp = VFSTOSMBFS(mp); - struct smb_cred scred; + struct smb_cred *scred; int error, flags; SMBVDEBUG("smbfs_unmount: flags=%04x\n", mntflags); @@ -279,11 +284,12 @@ smbfs_unmount(struct mount *mp, int mntf } while (error == EBUSY && smp->sm_didrele != 0); if (error) return error; - smb_makescred(&scred, td, td->td_ucred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, td->td_ucred); error = smb_share_lock(smp->sm_share, LK_EXCLUSIVE); if (error) - return error; - smb_share_put(smp->sm_share, &scred); + goto out; + smb_share_put(smp->sm_share, scred); mp->mnt_data = NULL; if (smp->sm_hash) @@ -293,6 +299,8 @@ smbfs_unmount(struct mount *mp, int mntf MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; MNT_IUNLOCK(mp); +out: + smbfs_free_scred(scred); return error; } @@ -308,7 +316,7 @@ smbfs_root(struct mount *mp, int flags, struct smbfattr fattr; struct thread *td; struct ucred *cred; - struct smb_cred scred; + struct smb_cred *scred; int error; td = curthread; @@ -323,19 +331,22 @@ smbfs_root(struct mount *mp, int flags, *vpp = SMBTOV(smp->sm_root); return vget(*vpp, LK_EXCLUSIVE | LK_RETRY, td); } - smb_makescred(&scred, td, cred); - error = smbfs_smb_lookup(NULL, NULL, 0, &fattr, &scred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, cred); + error = smbfs_smb_lookup(NULL, NULL, 0, &fattr, scred); if (error) - return error; + goto out; error = smbfs_nget(mp, NULL, "TheRooT", 7, &fattr, &vp); if (error) - return error; + goto out; ASSERT_VOP_LOCKED(vp, "smbfs_root"); vp->v_vflag |= VV_ROOT; np = VTOSMB(vp); smp->sm_root = np; *vpp = vp; - return 0; +out: + smbfs_free_scred(scred); + return error; } /* @@ -381,7 +392,7 @@ smbfs_statfs(struct mount *mp, struct st struct smbmount *smp = VFSTOSMBFS(mp); struct smbnode *np = smp->sm_root; struct smb_share *ssp = smp->sm_share; - struct smb_cred scred; + struct smb_cred *scred; int error = 0; if (np == NULL) { @@ -390,14 +401,18 @@ smbfs_statfs(struct mount *mp, struct st } sbp->f_iosize = SSTOVC(ssp)->vc_txmax; /* optimal transfer block size */ - smb_makescred(&scred, td, td->td_ucred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, td->td_ucred); if (SMB_DIALECT(SSTOVC(ssp)) >= SMB_DIALECT_LANMAN2_0) - error = smbfs_smb_statfs2(ssp, sbp, &scred); + error = smbfs_smb_statfs2(ssp, sbp, scred); else - error = smbfs_smb_statfs(ssp, sbp, &scred); - if (error) + error = smbfs_smb_statfs(ssp, sbp, scred); + if (error) { + smbfs_free_scred(scred); return error; + } sbp->f_flags = 0; /* copy of mount exported flags */ + smbfs_free_scred(scred); return 0; } Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Wed Oct 31 03:29:52 2012 (r242385) +++ head/sys/fs/smbfs/smbfs_vnops.c Wed Oct 31 03:34:07 2012 (r242386) @@ -153,7 +153,7 @@ smbfs_open(ap) { struct vnode *vp = ap->a_vp; struct smbnode *np = VTOSMB(vp); - struct smb_cred scred; + struct smb_cred *scred; struct vattr vattr; int mode = ap->a_mode; int error, accmode; @@ -197,14 +197,15 @@ smbfs_open(ap) accmode = SMB_SM_DENYNONE|SMB_AM_OPENREAD; if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) accmode = SMB_SM_DENYNONE|SMB_AM_OPENRW; - smb_makescred(&scred, ap->a_td, ap->a_cred); - error = smbfs_smb_open(np, accmode, &scred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, ap->a_td, ap->a_cred); + error = smbfs_smb_open(np, accmode, scred); if (error) { if (mode & FWRITE) return EACCES; else if ((vp->v_mount->mnt_flag & MNT_RDONLY) == 0) { accmode = SMB_SM_DENYNONE|SMB_AM_OPENREAD; - error = smbfs_smb_open(np, accmode, &scred); + error = smbfs_smb_open(np, accmode, scred); } } if (error == 0) { @@ -212,6 +213,7 @@ smbfs_open(ap) vnode_create_vobject(ap->a_vp, vattr.va_size, ap->a_td); } smbfs_attr_cacheremove(vp); + smbfs_free_scred(scred); return error; } @@ -228,12 +230,14 @@ smbfs_close(ap) struct vnode *vp = ap->a_vp; struct thread *td = ap->a_td; struct smbnode *np = VTOSMB(vp); - struct smb_cred scred; + struct smb_cred *scred; if (vp->v_type == VDIR && (np->n_flag & NOPEN) != 0 && np->n_dirseq != NULL) { - smb_makescred(&scred, td, ap->a_cred); - smbfs_findclose(np->n_dirseq, &scred); + scred = smbfs_malloc_scred(); + smb_makescred(scred, td, ap->a_cred); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 03:55:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8CD488BD; Wed, 31 Oct 2012 03:55:34 +0000 (UTC) (envelope-from davide@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 743398FC12; Wed, 31 Oct 2012 03:55:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V3tYKu042362; Wed, 31 Oct 2012 03:55:34 GMT (envelope-from davide@svn.freebsd.org) Received: (from davide@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V3tYu7042357; Wed, 31 Oct 2012 03:55:34 GMT (envelope-from davide@svn.freebsd.org) Message-Id: <201210310355.q9V3tYu7042357@svn.freebsd.org> From: Davide Italiano Date: Wed, 31 Oct 2012 03:55:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242387 - head/sys/fs/smbfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 03:55:34 -0000 Author: davide Date: Wed Oct 31 03:55:33 2012 New Revision: 242387 URL: http://svn.freebsd.org/changeset/base/242387 Log: - Do not put in the mntqueue half-constructed vnodes. - Change the code so that it relies on vfs_hash rather than on a home-made hashtable. - There's no need to inline fnv_32_buf(). Reviewed by: delphij Tested by: pho Sponsored by: iXsystems inc. Modified: head/sys/fs/smbfs/smbfs.h head/sys/fs/smbfs/smbfs_node.c head/sys/fs/smbfs/smbfs_node.h head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs.h ============================================================================== --- head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:34:07 2012 (r242386) +++ head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:55:33 2012 (r242387) @@ -82,9 +82,6 @@ struct smbmount { /* struct simplelock sm_npslock;*/ struct smbnode * sm_npstack[SMBFS_MAXPATHCOMP]; int sm_caseopt; - struct sx sm_hashlock; - LIST_HEAD(smbnode_hashhead, smbnode) *sm_hash; - u_long sm_hashlen; int sm_didrele; }; Modified: head/sys/fs/smbfs/smbfs_node.c ============================================================================== --- head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:34:07 2012 (r242386) +++ head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:55:33 2012 (r242387) @@ -27,6 +27,7 @@ */ #include #include +#include #include #include #include @@ -52,54 +53,15 @@ #include #include -#define SMBFS_NOHASH(smp, hval) (&(smp)->sm_hash[(hval) & (smp)->sm_hashlen]) -#define smbfs_hash_lock(smp) sx_xlock(&smp->sm_hashlock) -#define smbfs_hash_unlock(smp) sx_xunlock(&smp->sm_hashlock) - extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */ static MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); static MALLOC_DEFINE(M_SMBNODENAME, "smbufs_nname", "SMBFS node name"); -int smbfs_hashprint(struct mount *mp); - -#if 0 -#ifdef SYSCTL_DECL -SYSCTL_DECL(_vfs_smbfs); -#endif -SYSCTL_PROC(_vfs_smbfs, OID_AUTO, vnprint, CTLFLAG_WR|CTLTYPE_OPAQUE, - NULL, 0, smbfs_hashprint, "S,vnlist", "vnode hash"); -#endif - -#define FNV_32_PRIME ((u_int32_t) 0x01000193UL) -#define FNV1_32_INIT ((u_int32_t) 33554467UL) - -u_int32_t +u_int32_t __inline smbfs_hash(const u_char *name, int nmlen) { - u_int32_t v; - - for (v = FNV1_32_INIT; nmlen; name++, nmlen--) { - v *= FNV_32_PRIME; - v ^= (u_int32_t)*name; - } - return v; -} - -int -smbfs_hashprint(struct mount *mp) -{ - struct smbmount *smp = VFSTOSMBFS(mp); - struct smbnode_hashhead *nhpp; - struct smbnode *np; - int i; - - for(i = 0; i <= smp->sm_hashlen; i++) { - nhpp = &smp->sm_hash[i]; - LIST_FOREACH(np, nhpp, n_hash) - vprint("", SMBTOV(np)); - } - return 0; + return (fnv_32_buf(name, nmlen, FNV1_32_INIT)); } static char * @@ -149,6 +111,20 @@ smbfs_name_free(u_char *name) #endif } +static int __inline +smbfs_vnode_cmp(struct vnode *vp, void *_sc) +{ + struct smbnode *np; + struct smbcmp *sc; + + np = (struct smbnode *) vp; + sc = (struct smbcmp *) _sc; + if (np->n_parent != sc->n_parent || np->n_nmlen != sc->n_nmlen || + bcmp(sc->n_name, np->n_name, sc->n_nmlen) != 0) + return 1; + return 0; +} + static int smbfs_node_alloc(struct mount *mp, struct vnode *dvp, const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) @@ -156,12 +132,14 @@ smbfs_node_alloc(struct mount *mp, struc struct vattr vattr; struct thread *td = curthread; /* XXX */ struct smbmount *smp = VFSTOSMBFS(mp); - struct smbnode_hashhead *nhpp; - struct smbnode *np, *np2, *dnp; - struct vnode *vp; - u_long hashval; + struct smbnode *np, *dnp; + struct vnode *vp, *vp2; + struct smbcmp sc; int error; + sc.n_parent = dvp; + sc.n_nmlen = nmlen; + sc.n_name = name; *vpp = NULL; if (smp->sm_root != NULL && dvp == NULL) { SMBERROR("do not allocate root vnode twice!\n"); @@ -184,38 +162,33 @@ smbfs_node_alloc(struct mount *mp, struc vprint("smbfs_node_alloc: dead parent vnode", dvp); return EINVAL; } - hashval = smbfs_hash(name, nmlen); -retry: - smbfs_hash_lock(smp); -loop: - nhpp = SMBFS_NOHASH(smp, hashval); - LIST_FOREACH(np, nhpp, n_hash) { - vp = SMBTOV(np); - if (np->n_parent != dvp || - np->n_nmlen != nmlen || bcmp(name, np->n_name, nmlen) != 0) - continue; - VI_LOCK(vp); - smbfs_hash_unlock(smp); - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) - goto retry; + *vpp = NULL; + error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, + vpp, smbfs_vnode_cmp, &sc); + if (error) + return (error); + if (*vpp) { + np = VTOSMB(*vpp); /* Force cached attributes to be refreshed if stale. */ - (void)VOP_GETATTR(vp, &vattr, td->td_ucred); + (void)VOP_GETATTR(*vpp, &vattr, td->td_ucred); /* * If the file type on the server is inconsistent with * what it was when we created the vnode, kill the * bogus vnode now and fall through to the code below * to create a new one with the right type. */ - if ((vp->v_type == VDIR && (np->n_dosattr & SMB_FA_DIR) == 0) || - (vp->v_type == VREG && (np->n_dosattr & SMB_FA_DIR) != 0)) { - vgone(vp); - vput(vp); - break; + if (((*vpp)->v_type == VDIR && + (np->n_dosattr & SMB_FA_DIR) == 0) || + ((*vpp)->v_type == VREG && + (np->n_dosattr & SMB_FA_DIR) != 0)) { + vgone(*vpp); + vput(*vpp); + } + else { + SMBVDEBUG("vnode taken from the hashtable\n"); + return (0); } - *vpp = vp; - return 0; } - smbfs_hash_unlock(smp); /* * If we don't have node attributes, then it is an explicit lookup * for an existing vnode. @@ -223,15 +196,13 @@ loop: if (fap == NULL) return ENOENT; - error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); - if (error != 0) - return (error); - error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */ - if (error != 0) + error = getnewvnode("smbfs", mp, &smbfs_vnodeops, vpp); + if (error) return (error); - + vp = *vpp; np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); - + lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); + /* Vnode initialization */ vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; vp->v_data = np; np->n_vnode = vp; @@ -239,7 +210,6 @@ loop: np->n_nmlen = nmlen; np->n_name = smbfs_name_alloc(name, nmlen); np->n_ino = fap->fa_ino; - if (dvp) { ASSERT_VOP_LOCKED(dvp, "smbfs_node_alloc"); np->n_parent = dvp; @@ -249,24 +219,18 @@ loop: } } else if (vp->v_type == VREG) SMBERROR("new vnode '%s' born without parent ?\n", np->n_name); - - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); - VN_LOCK_AREC(vp); - - smbfs_hash_lock(smp); - LIST_FOREACH(np2, nhpp, n_hash) { - if (np2->n_parent != dvp || - np2->n_nmlen != nmlen || bcmp(name, np2->n_name, nmlen) != 0) - continue; - vput(vp); -/* smb_name_free(np->n_name); - free(np, M_SMBNODE);*/ - goto loop; + error = insmntque(vp, mp); + if (error) { + free(np, M_SMBNODE); + return (error); } - LIST_INSERT_HEAD(nhpp, np, n_hash); - smbfs_hash_unlock(smp); - *vpp = vp; - return 0; + error = vfs_hash_insert(vp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, + td, &vp2, smbfs_vnode_cmp, &sc); + if (error) + return (error); + if (vp2 != NULL) + *vpp = vp2; + return (0); } int @@ -307,26 +271,21 @@ smbfs_reclaim(ap) KASSERT((np->n_flag & NOPEN) == 0, ("file not closed before reclaim")); - smbfs_hash_lock(smp); /* * Destroy the vm object and flush associated pages. */ vnode_destroy_vobject(vp); - dvp = (np->n_parent && (np->n_flag & NREFPARENT)) ? np->n_parent : NULL; - - if (np->n_hash.le_prev) - LIST_REMOVE(np, n_hash); - if (smp->sm_root == np) { - SMBVDEBUG("root vnode\n"); - smp->sm_root = NULL; - } - vp->v_data = NULL; - smbfs_hash_unlock(smp); + + /* + * Remove the vnode from its hash chain. + */ + vfs_hash_remove(vp); if (np->n_name) smbfs_name_free(np->n_name); free(np, M_SMBNODE); + vp->v_data = NULL; if (dvp != NULL) { vrele(dvp); /* Modified: head/sys/fs/smbfs/smbfs_node.h ============================================================================== --- head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:34:07 2012 (r242386) +++ head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:55:33 2012 (r242387) @@ -63,6 +63,12 @@ struct smbnode { LIST_ENTRY(smbnode) n_hash; }; +struct smbcmp { + struct vnode * n_parent; + int n_nmlen; + const char * n_name; +}; + #define VTOSMB(vp) ((struct smbnode *)(vp)->v_data) #define SMBTOV(np) ((struct vnode *)(np)->n_vnode) Modified: head/sys/fs/smbfs/smbfs_vfsops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:34:07 2012 (r242386) +++ head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:55:33 2012 (r242387) @@ -58,8 +58,6 @@ SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFL SYSCTL_INT(_vfs_smbfs, OID_AUTO, version, CTLFLAG_RD, &smbfs_version, 0, ""); SYSCTL_INT(_vfs_smbfs, OID_AUTO, debuglevel, CTLFLAG_RW, &smbfs_debuglevel, 0, ""); -static MALLOC_DEFINE(M_SMBFSHASH, "smbfs_hash", "SMBFS hash table"); - static vfs_init_t smbfs_init; static vfs_uninit_t smbfs_uninit; static vfs_cmount_t smbfs_cmount; @@ -170,10 +168,6 @@ smbfs_mount(struct mount *mp) smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); mp->mnt_data = smp; - smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen); - if (smp->sm_hash == NULL) - goto bad; - sx_init(&smp->sm_hashlock, "smbfsh"); smp->sm_share = ssp; smp->sm_root = NULL; if (1 != vfs_scanopt(mp->mnt_optnew, @@ -243,12 +237,6 @@ smbfs_mount(struct mount *mp) smbfs_free_scred(scred); return error; bad: - if (smp) { - if (smp->sm_hash) - free(smp->sm_hash, M_SMBFSHASH); - sx_destroy(&smp->sm_hashlock); - free(smp, M_SMBFSDATA); - } if (ssp) smb_share_put(ssp, scred); smbfs_free_scred(scred); @@ -291,10 +279,6 @@ smbfs_unmount(struct mount *mp, int mntf goto out; smb_share_put(smp->sm_share, scred); mp->mnt_data = NULL; - - if (smp->sm_hash) - free(smp->sm_hash, M_SMBFSHASH); - sx_destroy(&smp->sm_hashlock); free(smp, M_SMBFSDATA); MNT_ILOCK(mp); mp->mnt_flag &= ~MNT_LOCAL; From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 03:57:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9105CA51; Wed, 31 Oct 2012 03:57:15 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 163038FC0A; Wed, 31 Oct 2012 03:57:14 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1388766vba.13 for ; Tue, 30 Oct 2012 20:57:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=9ddZxJnXPCJS6+vzaRmF1HXvYmeRdZgD8r4asDmnAVA=; b=a/2KOIpj0pdvhpa3dqb+ACfhuOfJnQP0iPbBhRTCMaGe6OYlT4IV/kTv0IisIg4P4Y cIDCyjrPmG+DeLky89B7YylqfrY7YMN/vKOajURTQTCtLO5k6iFgWnVUmnYrpoyp73KT NG1AkS20sjg7OJE0jXlnHU1KA60vPf9urp7+wFuTBifAnlAvY4f21gYzGg1WQ1pJn1wY Cm/cJ1krEfyWDjcuqA1bvl0Ox/4PyFj6eM78fpAWbAMxIforeUIqxMaMkAyStuNwcMqE MF4/Rkw4ty/1/3+fZUfLhvxMMEbZ6IdFFDtYjc/HTaHbafwjrmRpCa1kLgNqj59lyiDj GESw== MIME-Version: 1.0 Received: by 10.52.180.225 with SMTP id dr1mr19149391vdc.2.1351655834156; Tue, 30 Oct 2012 20:57:14 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.58.247.132 with HTTP; Tue, 30 Oct 2012 20:57:14 -0700 (PDT) In-Reply-To: <201210310355.q9V3tYu7042357@svn.freebsd.org> References: <201210310355.q9V3tYu7042357@svn.freebsd.org> Date: Wed, 31 Oct 2012 04:57:14 +0100 X-Google-Sender-Auth: 2fNQvEECpV4NdAZ2evKz213eRKI Message-ID: Subject: Re: svn commit: r242387 - head/sys/fs/smbfs From: Davide Italiano To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 03:57:15 -0000 On Wed, Oct 31, 2012 at 4:55 AM, Davide Italiano wrote: > Author: davide > Date: Wed Oct 31 03:55:33 2012 > New Revision: 242387 > URL: http://svn.freebsd.org/changeset/base/242387 > > Log: > - Do not put in the mntqueue half-constructed vnodes. > - Change the code so that it relies on vfs_hash rather than on a > home-made hashtable. > - There's no need to inline fnv_32_buf(). > > Reviewed by: delphij > Tested by: pho > Sponsored by: iXsystems inc. > > Modified: > head/sys/fs/smbfs/smbfs.h > head/sys/fs/smbfs/smbfs_node.c > head/sys/fs/smbfs/smbfs_node.h > head/sys/fs/smbfs/smbfs_vfsops.c > > Modified: head/sys/fs/smbfs/smbfs.h > ============================================================================== > --- head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:34:07 2012 (r242386) > +++ head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:55:33 2012 (r242387) > @@ -82,9 +82,6 @@ struct smbmount { > /* struct simplelock sm_npslock;*/ > struct smbnode * sm_npstack[SMBFS_MAXPATHCOMP]; > int sm_caseopt; > - struct sx sm_hashlock; > - LIST_HEAD(smbnode_hashhead, smbnode) *sm_hash; > - u_long sm_hashlen; > int sm_didrele; > }; > > > Modified: head/sys/fs/smbfs/smbfs_node.c > ============================================================================== > --- head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:34:07 2012 (r242386) > +++ head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:55:33 2012 (r242387) > @@ -27,6 +27,7 @@ > */ > #include > #include > +#include > #include > #include > #include > @@ -52,54 +53,15 @@ > #include > #include > > -#define SMBFS_NOHASH(smp, hval) (&(smp)->sm_hash[(hval) & (smp)->sm_hashlen]) > -#define smbfs_hash_lock(smp) sx_xlock(&smp->sm_hashlock) > -#define smbfs_hash_unlock(smp) sx_xunlock(&smp->sm_hashlock) > - > extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */ > > static MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); > static MALLOC_DEFINE(M_SMBNODENAME, "smbufs_nname", "SMBFS node name"); > > -int smbfs_hashprint(struct mount *mp); > - > -#if 0 > -#ifdef SYSCTL_DECL > -SYSCTL_DECL(_vfs_smbfs); > -#endif > -SYSCTL_PROC(_vfs_smbfs, OID_AUTO, vnprint, CTLFLAG_WR|CTLTYPE_OPAQUE, > - NULL, 0, smbfs_hashprint, "S,vnlist", "vnode hash"); > -#endif > - > -#define FNV_32_PRIME ((u_int32_t) 0x01000193UL) > -#define FNV1_32_INIT ((u_int32_t) 33554467UL) > - > -u_int32_t > +u_int32_t __inline > smbfs_hash(const u_char *name, int nmlen) > { > - u_int32_t v; > - > - for (v = FNV1_32_INIT; nmlen; name++, nmlen--) { > - v *= FNV_32_PRIME; > - v ^= (u_int32_t)*name; > - } > - return v; > -} > - > -int > -smbfs_hashprint(struct mount *mp) > -{ > - struct smbmount *smp = VFSTOSMBFS(mp); > - struct smbnode_hashhead *nhpp; > - struct smbnode *np; > - int i; > - > - for(i = 0; i <= smp->sm_hashlen; i++) { > - nhpp = &smp->sm_hash[i]; > - LIST_FOREACH(np, nhpp, n_hash) > - vprint("", SMBTOV(np)); > - } > - return 0; > + return (fnv_32_buf(name, nmlen, FNV1_32_INIT)); > } > > static char * > @@ -149,6 +111,20 @@ smbfs_name_free(u_char *name) > #endif > } > > +static int __inline > +smbfs_vnode_cmp(struct vnode *vp, void *_sc) > +{ > + struct smbnode *np; > + struct smbcmp *sc; > + > + np = (struct smbnode *) vp; > + sc = (struct smbcmp *) _sc; > + if (np->n_parent != sc->n_parent || np->n_nmlen != sc->n_nmlen || > + bcmp(sc->n_name, np->n_name, sc->n_nmlen) != 0) > + return 1; > + return 0; > +} > + > static int > smbfs_node_alloc(struct mount *mp, struct vnode *dvp, > const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) > @@ -156,12 +132,14 @@ smbfs_node_alloc(struct mount *mp, struc > struct vattr vattr; > struct thread *td = curthread; /* XXX */ > struct smbmount *smp = VFSTOSMBFS(mp); > - struct smbnode_hashhead *nhpp; > - struct smbnode *np, *np2, *dnp; > - struct vnode *vp; > - u_long hashval; > + struct smbnode *np, *dnp; > + struct vnode *vp, *vp2; > + struct smbcmp sc; > int error; > > + sc.n_parent = dvp; > + sc.n_nmlen = nmlen; > + sc.n_name = name; > *vpp = NULL; > if (smp->sm_root != NULL && dvp == NULL) { > SMBERROR("do not allocate root vnode twice!\n"); > @@ -184,38 +162,33 @@ smbfs_node_alloc(struct mount *mp, struc > vprint("smbfs_node_alloc: dead parent vnode", dvp); > return EINVAL; > } > - hashval = smbfs_hash(name, nmlen); > -retry: > - smbfs_hash_lock(smp); > -loop: > - nhpp = SMBFS_NOHASH(smp, hashval); > - LIST_FOREACH(np, nhpp, n_hash) { > - vp = SMBTOV(np); > - if (np->n_parent != dvp || > - np->n_nmlen != nmlen || bcmp(name, np->n_name, nmlen) != 0) > - continue; > - VI_LOCK(vp); > - smbfs_hash_unlock(smp); > - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) > - goto retry; > + *vpp = NULL; > + error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, > + vpp, smbfs_vnode_cmp, &sc); > + if (error) > + return (error); > + if (*vpp) { > + np = VTOSMB(*vpp); > /* Force cached attributes to be refreshed if stale. */ > - (void)VOP_GETATTR(vp, &vattr, td->td_ucred); > + (void)VOP_GETATTR(*vpp, &vattr, td->td_ucred); > /* > * If the file type on the server is inconsistent with > * what it was when we created the vnode, kill the > * bogus vnode now and fall through to the code below > * to create a new one with the right type. > */ > - if ((vp->v_type == VDIR && (np->n_dosattr & SMB_FA_DIR) == 0) || > - (vp->v_type == VREG && (np->n_dosattr & SMB_FA_DIR) != 0)) { > - vgone(vp); > - vput(vp); > - break; > + if (((*vpp)->v_type == VDIR && > + (np->n_dosattr & SMB_FA_DIR) == 0) || > + ((*vpp)->v_type == VREG && > + (np->n_dosattr & SMB_FA_DIR) != 0)) { > + vgone(*vpp); > + vput(*vpp); > + } > + else { > + SMBVDEBUG("vnode taken from the hashtable\n"); > + return (0); > } > - *vpp = vp; > - return 0; > } > - smbfs_hash_unlock(smp); > /* > * If we don't have node attributes, then it is an explicit lookup > * for an existing vnode. > @@ -223,15 +196,13 @@ loop: > if (fap == NULL) > return ENOENT; > > - error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); > - if (error != 0) > - return (error); > - error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */ > - if (error != 0) > + error = getnewvnode("smbfs", mp, &smbfs_vnodeops, vpp); > + if (error) > return (error); > - > + vp = *vpp; > np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); > - > + lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); > + /* Vnode initialization */ > vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; > vp->v_data = np; > np->n_vnode = vp; > @@ -239,7 +210,6 @@ loop: > np->n_nmlen = nmlen; > np->n_name = smbfs_name_alloc(name, nmlen); > np->n_ino = fap->fa_ino; > - > if (dvp) { > ASSERT_VOP_LOCKED(dvp, "smbfs_node_alloc"); > np->n_parent = dvp; > @@ -249,24 +219,18 @@ loop: > } > } else if (vp->v_type == VREG) > SMBERROR("new vnode '%s' born without parent ?\n", np->n_name); > - > - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); > - VN_LOCK_AREC(vp); > - > - smbfs_hash_lock(smp); > - LIST_FOREACH(np2, nhpp, n_hash) { > - if (np2->n_parent != dvp || > - np2->n_nmlen != nmlen || bcmp(name, np2->n_name, nmlen) != 0) > - continue; > - vput(vp); > -/* smb_name_free(np->n_name); > - free(np, M_SMBNODE);*/ > - goto loop; > + error = insmntque(vp, mp); > + if (error) { > + free(np, M_SMBNODE); > + return (error); > } > - LIST_INSERT_HEAD(nhpp, np, n_hash); > - smbfs_hash_unlock(smp); > - *vpp = vp; > - return 0; > + error = vfs_hash_insert(vp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, > + td, &vp2, smbfs_vnode_cmp, &sc); > + if (error) > + return (error); > + if (vp2 != NULL) > + *vpp = vp2; > + return (0); > } > > int > @@ -307,26 +271,21 @@ smbfs_reclaim(ap) > > KASSERT((np->n_flag & NOPEN) == 0, ("file not closed before reclaim")); > > - smbfs_hash_lock(smp); > /* > * Destroy the vm object and flush associated pages. > */ > vnode_destroy_vobject(vp); > - > dvp = (np->n_parent && (np->n_flag & NREFPARENT)) ? > np->n_parent : NULL; > - > - if (np->n_hash.le_prev) > - LIST_REMOVE(np, n_hash); > - if (smp->sm_root == np) { > - SMBVDEBUG("root vnode\n"); > - smp->sm_root = NULL; > - } > - vp->v_data = NULL; > - smbfs_hash_unlock(smp); > + > + /* > + * Remove the vnode from its hash chain. > + */ > + vfs_hash_remove(vp); > if (np->n_name) > smbfs_name_free(np->n_name); > free(np, M_SMBNODE); > + vp->v_data = NULL; > if (dvp != NULL) { > vrele(dvp); > /* > > Modified: head/sys/fs/smbfs/smbfs_node.h > ============================================================================== > --- head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:34:07 2012 (r242386) > +++ head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:55:33 2012 (r242387) > @@ -63,6 +63,12 @@ struct smbnode { > LIST_ENTRY(smbnode) n_hash; > }; > > +struct smbcmp { > + struct vnode * n_parent; > + int n_nmlen; > + const char * n_name; > +}; > + > #define VTOSMB(vp) ((struct smbnode *)(vp)->v_data) > #define SMBTOV(np) ((struct vnode *)(np)->n_vnode) > > > Modified: head/sys/fs/smbfs/smbfs_vfsops.c > ============================================================================== > --- head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:34:07 2012 (r242386) > +++ head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:55:33 2012 (r242387) > @@ -58,8 +58,6 @@ SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFL > SYSCTL_INT(_vfs_smbfs, OID_AUTO, version, CTLFLAG_RD, &smbfs_version, 0, ""); > SYSCTL_INT(_vfs_smbfs, OID_AUTO, debuglevel, CTLFLAG_RW, &smbfs_debuglevel, 0, ""); > > -static MALLOC_DEFINE(M_SMBFSHASH, "smbfs_hash", "SMBFS hash table"); > - > static vfs_init_t smbfs_init; > static vfs_uninit_t smbfs_uninit; > static vfs_cmount_t smbfs_cmount; > @@ -170,10 +168,6 @@ smbfs_mount(struct mount *mp) > > smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); > mp->mnt_data = smp; > - smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen); > - if (smp->sm_hash == NULL) > - goto bad; > - sx_init(&smp->sm_hashlock, "smbfsh"); > smp->sm_share = ssp; > smp->sm_root = NULL; > if (1 != vfs_scanopt(mp->mnt_optnew, > @@ -243,12 +237,6 @@ smbfs_mount(struct mount *mp) > smbfs_free_scred(scred); > return error; > bad: > - if (smp) { > - if (smp->sm_hash) > - free(smp->sm_hash, M_SMBFSHASH); > - sx_destroy(&smp->sm_hashlock); > - free(smp, M_SMBFSDATA); > - } > if (ssp) > smb_share_put(ssp, scred); > smbfs_free_scred(scred); > @@ -291,10 +279,6 @@ smbfs_unmount(struct mount *mp, int mntf > goto out; > smb_share_put(smp->sm_share, scred); > mp->mnt_data = NULL; > - > - if (smp->sm_hash) > - free(smp->sm_hash, M_SMBFSHASH); > - sx_destroy(&smp->sm_hashlock); > free(smp, M_SMBFSDATA); > MNT_ILOCK(mp); > mp->mnt_flag &= ~MNT_LOCAL; Alan, I committed this because I'm going to commit in a while some changes which depended on this commit. If you want still to take a look at the patch to notify if there's something wrong, I'll be more than happy. Thanks Davide From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 03:57:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0E21FBC2; Wed, 31 Oct 2012 03:57:56 +0000 (UTC) (envelope-from davide.italiano@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 7DA378FC12; Wed, 31 Oct 2012 03:57:55 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so1389175vba.13 for ; Tue, 30 Oct 2012 20:57:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=+tuAxaA5yQcgFwesMPg4koKesrwEkRxTYTALNsjCpkM=; b=n61k4CBSg4MaOFcKBgPfISYaoGB/qNhuqGEsfeOGI34zSW+rIXVpR+53VdTyt2x5lt kexVHbjUL0Q/umiztx0v0smv6Ib0N9hv7WMyJKWfJiCEMUT/Wur+HkASFEFGXbnmPPav fM0U0mahuE/VAS4NG1S6Ory+vV9cuz5kH61/97Id4uafedP247kxciE0PbjsW2e8pMkm b+vDHsYAF4pxdKrGIaADqGDXc8tVue77xW2f0pmkLNj3j+BMNBw7vrSiTTQOwL305pjL mL0c0oAhZNGGs6xmGprST19jsdxz9OHWf9Bs01wqGUaXICNefp2UKKgq0nI60ODw+sRD X/Sw== MIME-Version: 1.0 Received: by 10.52.29.148 with SMTP id k20mr45462713vdh.37.1351655874994; Tue, 30 Oct 2012 20:57:54 -0700 (PDT) Sender: davide.italiano@gmail.com Received: by 10.58.247.132 with HTTP; Tue, 30 Oct 2012 20:57:54 -0700 (PDT) In-Reply-To: References: <201210310355.q9V3tYu7042357@svn.freebsd.org> Date: Wed, 31 Oct 2012 04:57:54 +0100 X-Google-Sender-Auth: B6uj6F2AwwEfgrG0euLyXSEC0ZA Message-ID: Subject: Re: svn commit: r242387 - head/sys/fs/smbfs From: Davide Italiano To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 03:57:56 -0000 On Wed, Oct 31, 2012 at 4:57 AM, Davide Italiano wrote: > On Wed, Oct 31, 2012 at 4:55 AM, Davide Italiano wrote: >> Author: davide >> Date: Wed Oct 31 03:55:33 2012 >> New Revision: 242387 >> URL: http://svn.freebsd.org/changeset/base/242387 >> >> Log: >> - Do not put in the mntqueue half-constructed vnodes. >> - Change the code so that it relies on vfs_hash rather than on a >> home-made hashtable. >> - There's no need to inline fnv_32_buf(). >> >> Reviewed by: delphij >> Tested by: pho >> Sponsored by: iXsystems inc. >> >> Modified: >> head/sys/fs/smbfs/smbfs.h >> head/sys/fs/smbfs/smbfs_node.c >> head/sys/fs/smbfs/smbfs_node.h >> head/sys/fs/smbfs/smbfs_vfsops.c >> >> Modified: head/sys/fs/smbfs/smbfs.h >> ============================================================================== >> --- head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:34:07 2012 (r242386) >> +++ head/sys/fs/smbfs/smbfs.h Wed Oct 31 03:55:33 2012 (r242387) >> @@ -82,9 +82,6 @@ struct smbmount { >> /* struct simplelock sm_npslock;*/ >> struct smbnode * sm_npstack[SMBFS_MAXPATHCOMP]; >> int sm_caseopt; >> - struct sx sm_hashlock; >> - LIST_HEAD(smbnode_hashhead, smbnode) *sm_hash; >> - u_long sm_hashlen; >> int sm_didrele; >> }; >> >> >> Modified: head/sys/fs/smbfs/smbfs_node.c >> ============================================================================== >> --- head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:34:07 2012 (r242386) >> +++ head/sys/fs/smbfs/smbfs_node.c Wed Oct 31 03:55:33 2012 (r242387) >> @@ -27,6 +27,7 @@ >> */ >> #include >> #include >> +#include >> #include >> #include >> #include >> @@ -52,54 +53,15 @@ >> #include >> #include >> >> -#define SMBFS_NOHASH(smp, hval) (&(smp)->sm_hash[(hval) & (smp)->sm_hashlen]) >> -#define smbfs_hash_lock(smp) sx_xlock(&smp->sm_hashlock) >> -#define smbfs_hash_unlock(smp) sx_xunlock(&smp->sm_hashlock) >> - >> extern struct vop_vector smbfs_vnodeops; /* XXX -> .h file */ >> >> static MALLOC_DEFINE(M_SMBNODE, "smbufs_node", "SMBFS vnode private part"); >> static MALLOC_DEFINE(M_SMBNODENAME, "smbufs_nname", "SMBFS node name"); >> >> -int smbfs_hashprint(struct mount *mp); >> - >> -#if 0 >> -#ifdef SYSCTL_DECL >> -SYSCTL_DECL(_vfs_smbfs); >> -#endif >> -SYSCTL_PROC(_vfs_smbfs, OID_AUTO, vnprint, CTLFLAG_WR|CTLTYPE_OPAQUE, >> - NULL, 0, smbfs_hashprint, "S,vnlist", "vnode hash"); >> -#endif >> - >> -#define FNV_32_PRIME ((u_int32_t) 0x01000193UL) >> -#define FNV1_32_INIT ((u_int32_t) 33554467UL) >> - >> -u_int32_t >> +u_int32_t __inline >> smbfs_hash(const u_char *name, int nmlen) >> { >> - u_int32_t v; >> - >> - for (v = FNV1_32_INIT; nmlen; name++, nmlen--) { >> - v *= FNV_32_PRIME; >> - v ^= (u_int32_t)*name; >> - } >> - return v; >> -} >> - >> -int >> -smbfs_hashprint(struct mount *mp) >> -{ >> - struct smbmount *smp = VFSTOSMBFS(mp); >> - struct smbnode_hashhead *nhpp; >> - struct smbnode *np; >> - int i; >> - >> - for(i = 0; i <= smp->sm_hashlen; i++) { >> - nhpp = &smp->sm_hash[i]; >> - LIST_FOREACH(np, nhpp, n_hash) >> - vprint("", SMBTOV(np)); >> - } >> - return 0; >> + return (fnv_32_buf(name, nmlen, FNV1_32_INIT)); >> } >> >> static char * >> @@ -149,6 +111,20 @@ smbfs_name_free(u_char *name) >> #endif >> } >> >> +static int __inline >> +smbfs_vnode_cmp(struct vnode *vp, void *_sc) >> +{ >> + struct smbnode *np; >> + struct smbcmp *sc; >> + >> + np = (struct smbnode *) vp; >> + sc = (struct smbcmp *) _sc; >> + if (np->n_parent != sc->n_parent || np->n_nmlen != sc->n_nmlen || >> + bcmp(sc->n_name, np->n_name, sc->n_nmlen) != 0) >> + return 1; >> + return 0; >> +} >> + >> static int >> smbfs_node_alloc(struct mount *mp, struct vnode *dvp, >> const char *name, int nmlen, struct smbfattr *fap, struct vnode **vpp) >> @@ -156,12 +132,14 @@ smbfs_node_alloc(struct mount *mp, struc >> struct vattr vattr; >> struct thread *td = curthread; /* XXX */ >> struct smbmount *smp = VFSTOSMBFS(mp); >> - struct smbnode_hashhead *nhpp; >> - struct smbnode *np, *np2, *dnp; >> - struct vnode *vp; >> - u_long hashval; >> + struct smbnode *np, *dnp; >> + struct vnode *vp, *vp2; >> + struct smbcmp sc; >> int error; >> >> + sc.n_parent = dvp; >> + sc.n_nmlen = nmlen; >> + sc.n_name = name; >> *vpp = NULL; >> if (smp->sm_root != NULL && dvp == NULL) { >> SMBERROR("do not allocate root vnode twice!\n"); >> @@ -184,38 +162,33 @@ smbfs_node_alloc(struct mount *mp, struc >> vprint("smbfs_node_alloc: dead parent vnode", dvp); >> return EINVAL; >> } >> - hashval = smbfs_hash(name, nmlen); >> -retry: >> - smbfs_hash_lock(smp); >> -loop: >> - nhpp = SMBFS_NOHASH(smp, hashval); >> - LIST_FOREACH(np, nhpp, n_hash) { >> - vp = SMBTOV(np); >> - if (np->n_parent != dvp || >> - np->n_nmlen != nmlen || bcmp(name, np->n_name, nmlen) != 0) >> - continue; >> - VI_LOCK(vp); >> - smbfs_hash_unlock(smp); >> - if (vget(vp, LK_EXCLUSIVE | LK_INTERLOCK, td) != 0) >> - goto retry; >> + *vpp = NULL; >> + error = vfs_hash_get(mp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, td, >> + vpp, smbfs_vnode_cmp, &sc); >> + if (error) >> + return (error); >> + if (*vpp) { >> + np = VTOSMB(*vpp); >> /* Force cached attributes to be refreshed if stale. */ >> - (void)VOP_GETATTR(vp, &vattr, td->td_ucred); >> + (void)VOP_GETATTR(*vpp, &vattr, td->td_ucred); >> /* >> * If the file type on the server is inconsistent with >> * what it was when we created the vnode, kill the >> * bogus vnode now and fall through to the code below >> * to create a new one with the right type. >> */ >> - if ((vp->v_type == VDIR && (np->n_dosattr & SMB_FA_DIR) == 0) || >> - (vp->v_type == VREG && (np->n_dosattr & SMB_FA_DIR) != 0)) { >> - vgone(vp); >> - vput(vp); >> - break; >> + if (((*vpp)->v_type == VDIR && >> + (np->n_dosattr & SMB_FA_DIR) == 0) || >> + ((*vpp)->v_type == VREG && >> + (np->n_dosattr & SMB_FA_DIR) != 0)) { >> + vgone(*vpp); >> + vput(*vpp); >> + } >> + else { >> + SMBVDEBUG("vnode taken from the hashtable\n"); >> + return (0); >> } >> - *vpp = vp; >> - return 0; >> } >> - smbfs_hash_unlock(smp); >> /* >> * If we don't have node attributes, then it is an explicit lookup >> * for an existing vnode. >> @@ -223,15 +196,13 @@ loop: >> if (fap == NULL) >> return ENOENT; >> >> - error = getnewvnode("smbfs", mp, &smbfs_vnodeops, &vp); >> - if (error != 0) >> - return (error); >> - error = insmntque(vp, mp); /* XXX: Too early for mpsafe fs */ >> - if (error != 0) >> + error = getnewvnode("smbfs", mp, &smbfs_vnodeops, vpp); >> + if (error) >> return (error); >> - >> + vp = *vpp; >> np = malloc(sizeof *np, M_SMBNODE, M_WAITOK | M_ZERO); >> - >> + lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL); >> + /* Vnode initialization */ >> vp->v_type = fap->fa_attr & SMB_FA_DIR ? VDIR : VREG; >> vp->v_data = np; >> np->n_vnode = vp; >> @@ -239,7 +210,6 @@ loop: >> np->n_nmlen = nmlen; >> np->n_name = smbfs_name_alloc(name, nmlen); >> np->n_ino = fap->fa_ino; >> - >> if (dvp) { >> ASSERT_VOP_LOCKED(dvp, "smbfs_node_alloc"); >> np->n_parent = dvp; >> @@ -249,24 +219,18 @@ loop: >> } >> } else if (vp->v_type == VREG) >> SMBERROR("new vnode '%s' born without parent ?\n", np->n_name); >> - >> - vn_lock(vp, LK_EXCLUSIVE | LK_RETRY); >> - VN_LOCK_AREC(vp); >> - >> - smbfs_hash_lock(smp); >> - LIST_FOREACH(np2, nhpp, n_hash) { >> - if (np2->n_parent != dvp || >> - np2->n_nmlen != nmlen || bcmp(name, np2->n_name, nmlen) != 0) >> - continue; >> - vput(vp); >> -/* smb_name_free(np->n_name); >> - free(np, M_SMBNODE);*/ >> - goto loop; >> + error = insmntque(vp, mp); >> + if (error) { >> + free(np, M_SMBNODE); >> + return (error); >> } >> - LIST_INSERT_HEAD(nhpp, np, n_hash); >> - smbfs_hash_unlock(smp); >> - *vpp = vp; >> - return 0; >> + error = vfs_hash_insert(vp, smbfs_hash(name, nmlen), LK_EXCLUSIVE, >> + td, &vp2, smbfs_vnode_cmp, &sc); >> + if (error) >> + return (error); >> + if (vp2 != NULL) >> + *vpp = vp2; >> + return (0); >> } >> >> int >> @@ -307,26 +271,21 @@ smbfs_reclaim(ap) >> >> KASSERT((np->n_flag & NOPEN) == 0, ("file not closed before reclaim")); >> >> - smbfs_hash_lock(smp); >> /* >> * Destroy the vm object and flush associated pages. >> */ >> vnode_destroy_vobject(vp); >> - >> dvp = (np->n_parent && (np->n_flag & NREFPARENT)) ? >> np->n_parent : NULL; >> - >> - if (np->n_hash.le_prev) >> - LIST_REMOVE(np, n_hash); >> - if (smp->sm_root == np) { >> - SMBVDEBUG("root vnode\n"); >> - smp->sm_root = NULL; >> - } >> - vp->v_data = NULL; >> - smbfs_hash_unlock(smp); >> + >> + /* >> + * Remove the vnode from its hash chain. >> + */ >> + vfs_hash_remove(vp); >> if (np->n_name) >> smbfs_name_free(np->n_name); >> free(np, M_SMBNODE); >> + vp->v_data = NULL; >> if (dvp != NULL) { >> vrele(dvp); >> /* >> >> Modified: head/sys/fs/smbfs/smbfs_node.h >> ============================================================================== >> --- head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:34:07 2012 (r242386) >> +++ head/sys/fs/smbfs/smbfs_node.h Wed Oct 31 03:55:33 2012 (r242387) >> @@ -63,6 +63,12 @@ struct smbnode { >> LIST_ENTRY(smbnode) n_hash; >> }; >> >> +struct smbcmp { >> + struct vnode * n_parent; >> + int n_nmlen; >> + const char * n_name; >> +}; >> + >> #define VTOSMB(vp) ((struct smbnode *)(vp)->v_data) >> #define SMBTOV(np) ((struct vnode *)(np)->n_vnode) >> >> >> Modified: head/sys/fs/smbfs/smbfs_vfsops.c >> ============================================================================== >> --- head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:34:07 2012 (r242386) >> +++ head/sys/fs/smbfs/smbfs_vfsops.c Wed Oct 31 03:55:33 2012 (r242387) >> @@ -58,8 +58,6 @@ SYSCTL_NODE(_vfs, OID_AUTO, smbfs, CTLFL >> SYSCTL_INT(_vfs_smbfs, OID_AUTO, version, CTLFLAG_RD, &smbfs_version, 0, ""); >> SYSCTL_INT(_vfs_smbfs, OID_AUTO, debuglevel, CTLFLAG_RW, &smbfs_debuglevel, 0, ""); >> >> -static MALLOC_DEFINE(M_SMBFSHASH, "smbfs_hash", "SMBFS hash table"); >> - >> static vfs_init_t smbfs_init; >> static vfs_uninit_t smbfs_uninit; >> static vfs_cmount_t smbfs_cmount; >> @@ -170,10 +168,6 @@ smbfs_mount(struct mount *mp) >> >> smp = malloc(sizeof(*smp), M_SMBFSDATA, M_WAITOK | M_ZERO); >> mp->mnt_data = smp; >> - smp->sm_hash = hashinit(desiredvnodes, M_SMBFSHASH, &smp->sm_hashlen); >> - if (smp->sm_hash == NULL) >> - goto bad; >> - sx_init(&smp->sm_hashlock, "smbfsh"); >> smp->sm_share = ssp; >> smp->sm_root = NULL; >> if (1 != vfs_scanopt(mp->mnt_optnew, >> @@ -243,12 +237,6 @@ smbfs_mount(struct mount *mp) >> smbfs_free_scred(scred); >> return error; >> bad: >> - if (smp) { >> - if (smp->sm_hash) >> - free(smp->sm_hash, M_SMBFSHASH); >> - sx_destroy(&smp->sm_hashlock); >> - free(smp, M_SMBFSDATA); >> - } >> if (ssp) >> smb_share_put(ssp, scred); >> smbfs_free_scred(scred); >> @@ -291,10 +279,6 @@ smbfs_unmount(struct mount *mp, int mntf >> goto out; >> smb_share_put(smp->sm_share, scred); >> mp->mnt_data = NULL; >> - >> - if (smp->sm_hash) >> - free(smp->sm_hash, M_SMBFSHASH); >> - sx_destroy(&smp->sm_hashlock); >> free(smp, M_SMBFSDATA); >> MNT_ILOCK(mp); >> mp->mnt_flag &= ~MNT_LOCAL; > > Alan, > I committed this because I'm going to commit in a while some changes > which depended on this commit. > If you want still tot t take a look at the patch to notify if there's > something wrong, I'll be more than happy. > > Thanks > > Davide I apologize, this was meant to be only for alc@. From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 04:23:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9ADE3FFE; Wed, 31 Oct 2012 04:23:37 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 801E48FC1B; Wed, 31 Oct 2012 04:23:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V4NbB2046747; Wed, 31 Oct 2012 04:23:37 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V4NbKZ046745; Wed, 31 Oct 2012 04:23:37 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210310423.q9V4NbKZ046745@svn.freebsd.org> From: Juli Mallett Date: Wed, 31 Oct 2012 04:23:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242389 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 04:23:37 -0000 Author: jmallett Date: Wed Oct 31 04:23:36 2012 New Revision: 242389 URL: http://svn.freebsd.org/changeset/base/242389 Log: If the CF physical base is 0, attach no CF devices. This fixes a warning about a 0 passed to cvmx_phys_to_ptr on systems without a CF interface, such as the RSYS4GBE. Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c Modified: head/sys/mips/cavium/octeon_ebt3000_cf.c ============================================================================== --- head/sys/mips/cavium/octeon_ebt3000_cf.c Wed Oct 31 04:07:52 2012 (r242388) +++ head/sys/mips/cavium/octeon_ebt3000_cf.c Wed Oct 31 04:23:36 2012 (r242389) @@ -622,6 +622,8 @@ static void cf_identify (driver_t *drv, return; phys_base = cvmx_sysinfo_get()->compact_flash_common_base_addr; + if (phys_base == 0) + return; base_addr = cvmx_phys_to_ptr(phys_base); for (bus_region = 0; bus_region < 8; bus_region++) From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 04:44:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A99232FF; Wed, 31 Oct 2012 04:44:32 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 909CC8FC08; Wed, 31 Oct 2012 04:44:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V4iWtp049821; Wed, 31 Oct 2012 04:44:32 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V4iWS6049819; Wed, 31 Oct 2012 04:44:32 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201210310444.q9V4iWS6049819@svn.freebsd.org> From: Juli Mallett Date: Wed, 31 Oct 2012 04:44:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242390 - head/sys/mips/cavium/octe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 04:44:32 -0000 Author: jmallett Date: Wed Oct 31 04:44:32 2012 New Revision: 242390 URL: http://svn.freebsd.org/changeset/base/242390 Log: Fix longstanding misprint. Modified: head/sys/mips/cavium/octe/ethernet-rx.c Modified: head/sys/mips/cavium/octe/ethernet-rx.c ============================================================================== --- head/sys/mips/cavium/octe/ethernet-rx.c Wed Oct 31 04:23:36 2012 (r242389) +++ head/sys/mips/cavium/octe/ethernet-rx.c Wed Oct 31 04:44:32 2012 (r242390) @@ -317,7 +317,7 @@ void cvm_oct_tasklet_rx(void *context, i } else { /* Drop any packet received for a device that doesn't exist */ - DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n", work->word1.cn38xx.ipprt); + DEBUGPRINT("Port %d not controlled by FreeBSD, packet dropped\n", work->word1.cn38xx.ipprt); m_freem(m); } From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 06:27:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 945291BD; Wed, 31 Oct 2012 06:27:59 +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 7BE538FC15; Wed, 31 Oct 2012 06:27:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V6RxMq067225; Wed, 31 Oct 2012 06:27:59 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V6Rx3p067218; Wed, 31 Oct 2012 06:27:59 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210310627.q9V6Rx3p067218@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 06:27:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242391 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 06:27:59 -0000 Author: adrian Date: Wed Oct 31 06:27:58 2012 New Revision: 242391 URL: http://svn.freebsd.org/changeset/base/242391 Log: I give up - introduce a TX lock to serialise TX operations. I've tried serialising TX using queues and such but unfortunately due to how this interacts with the locking going on elsewhere in the networking stack, the TX task gets delayed, resulting in quite a noticable throughput loss: * baseline TCP for 2x2 11n HT40 is ~ 170mbit/sec; * TCP for TX task in the ath taskq, with the RX also going on - 80mbit/sec; * TCP for TX task in a separate, second taskq - 100mbit/sec. So for now I'm going with the Linux wireless stack approach - lock tx early. The linux code does in the wireless stack, before the 802.11 state stuff happens and before it's punted to the driver. But TX locking needs to also occur at the driver layer as the TX completion code _also_ begins to drain the ifnet TX queue. Whilst I'm here, add some KTR traces for the TX path. Note: * This really should be done at the net80211 layer (as well, at least.) But that'll have to wait for a little more thought to happen. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_ahb.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_pci.c head/sys/dev/ath/if_ath_tx.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_ath.c Wed Oct 31 06:27:58 2012 (r242391) @@ -424,7 +424,6 @@ ath_attach(u_int16_t devid, struct ath_s TASK_INIT(&sc->sc_resettask,0, ath_reset_proc, sc); TASK_INIT(&sc->sc_txqtask,0, ath_txq_sched_tasklet, sc); TASK_INIT(&sc->sc_fataltask,0, ath_fatal_proc, sc); - TASK_INIT(&sc->sc_txsndtask, 0, ath_start_task, sc); /* * Allocate hardware transmit queues: one queue for @@ -2447,7 +2446,9 @@ ath_start_queue(struct ifnet *ifp) { struct ath_softc *sc = ifp->if_softc; + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: start"); ath_tx_kick(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_queue: finished"); } void @@ -2456,6 +2457,8 @@ ath_start_task(void *arg, int npending) struct ath_softc *sc = (struct ath_softc *) arg; struct ifnet *ifp = sc->sc_ifp; + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: start"); + /* XXX is it ok to hold the ATH_LOCK here? */ ATH_PCU_LOCK(sc); if (sc->sc_inreset_cnt > 0) { @@ -2466,6 +2469,7 @@ ath_start_task(void *arg, int npending) sc->sc_stats.ast_tx_qstop++; ifp->if_drv_flags |= IFF_DRV_OACTIVE; IF_UNLOCK(&ifp->if_snd); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: OACTIVE, finish"); return; } sc->sc_txstart_cnt++; @@ -2476,6 +2480,7 @@ ath_start_task(void *arg, int npending) ATH_PCU_LOCK(sc); sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start_task: finished"); } void @@ -2486,10 +2491,13 @@ ath_start(struct ifnet *ifp) struct ath_buf *bf; struct mbuf *m, *next; ath_bufhead frags; + int npkts = 0; if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || sc->sc_invalid) return; + ATH_KTR(sc, ATH_KTR_TX, 0, "ath_start: called"); + for (;;) { ATH_TXBUF_LOCK(sc); if (sc->sc_txbuf_cnt <= sc->sc_txq_data_minfree) { @@ -2517,6 +2525,7 @@ ath_start(struct ifnet *ifp) break; } ni = (struct ieee80211_node *) m->m_pkthdr.rcvif; + npkts ++; /* * Check for fragmentation. If this frame * has been broken up verify we have enough @@ -2590,6 +2599,7 @@ ath_start(struct ifnet *ifp) sc->sc_wd_timer = 5; } + ATH_KTR(sc, ATH_KTR_TX, 1, "ath_start: finished; npkts=%d", npkts); } static int Modified: head/sys/dev/ath/if_ath_ahb.c ============================================================================== --- head/sys/dev/ath/if_ath_ahb.c Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_ath_ahb.c Wed Oct 31 06:27:58 2012 (r242391) @@ -194,6 +194,7 @@ ath_ahb_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TX_LOCK_INIT(sc); ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(AR9130_DEVID, sc); @@ -202,6 +203,7 @@ ath_ahb_attach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); @@ -244,6 +246,7 @@ ath_ahb_detach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_ath_misc.h Wed Oct 31 06:27:58 2012 (r242391) @@ -124,7 +124,9 @@ static inline void ath_tx_kick(struct ath_softc *sc) { - taskqueue_enqueue(sc->sc_tq, &sc->sc_txsndtask); + ATH_TX_LOCK(sc); + ath_start(sc->sc_ifp); + ATH_TX_UNLOCK(sc); } #endif Modified: head/sys/dev/ath/if_ath_pci.c ============================================================================== --- head/sys/dev/ath/if_ath_pci.c Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_ath_pci.c Wed Oct 31 06:27:58 2012 (r242391) @@ -250,6 +250,7 @@ ath_pci_attach(device_t dev) ATH_LOCK_INIT(sc); ATH_PCU_LOCK_INIT(sc); ATH_RX_LOCK_INIT(sc); + ATH_TX_LOCK_INIT(sc); ATH_TXSTATUS_LOCK_INIT(sc); error = ath_attach(pci_get_device(dev), sc); @@ -259,6 +260,7 @@ ath_pci_attach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); bus_dma_tag_destroy(sc->sc_dmat); bad3: @@ -300,6 +302,7 @@ ath_pci_detach(device_t dev) ATH_TXSTATUS_LOCK_DESTROY(sc); ATH_PCU_LOCK_DESTROY(sc); ATH_RX_LOCK_DESTROY(sc); + ATH_TX_LOCK_DESTROY(sc); ATH_LOCK_DESTROY(sc); return (0); Modified: head/sys/dev/ath/if_ath_tx.c ============================================================================== --- head/sys/dev/ath/if_ath_tx.c Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_ath_tx.c Wed Oct 31 06:27:58 2012 (r242391) @@ -2153,6 +2153,8 @@ ath_raw_xmit(struct ieee80211_node *ni, sc->sc_txstart_cnt++; ATH_PCU_UNLOCK(sc); + ATH_TX_LOCK(sc); + 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 ? @@ -2230,6 +2232,8 @@ ath_raw_xmit(struct ieee80211_node *ni, sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); + ATH_TX_UNLOCK(sc); + return 0; bad2: ATH_KTR(sc, ATH_KTR_TX, 3, "ath_raw_xmit: bad2: m=%p, params=%p, " @@ -2241,6 +2245,9 @@ bad2: ath_returnbuf_head(sc, bf); ATH_TXBUF_UNLOCK(sc); bad: + + ATH_TX_UNLOCK(sc); + ATH_PCU_LOCK(sc); sc->sc_txstart_cnt--; ATH_PCU_UNLOCK(sc); Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Wed Oct 31 04:44:32 2012 (r242390) +++ head/sys/dev/ath/if_athvar.h Wed Oct 31 06:27:58 2012 (r242391) @@ -531,6 +531,8 @@ struct ath_softc { char sc_pcu_mtx_name[32]; struct mtx sc_rx_mtx; /* RX access mutex */ char sc_rx_mtx_name[32]; + struct mtx sc_tx_mtx; /* TX access mutex */ + char sc_tx_mtx_name[32]; struct taskqueue *sc_tq; /* private task queue */ struct ath_hal *sc_ah; /* Atheros HAL */ struct ath_ratectrl *sc_rc; /* tx rate control support */ @@ -663,7 +665,6 @@ struct ath_softc { struct ath_txq *sc_ac2q[5]; /* WME AC -> h/w q map */ struct task sc_txtask; /* tx int processing */ struct task sc_txqtask; /* tx proc processing */ - struct task sc_txsndtask; /* tx send processing */ struct ath_descdma sc_txcompdma; /* TX EDMA completion */ struct mtx sc_txcomplock; /* TX EDMA completion lock */ @@ -779,6 +780,28 @@ struct ath_softc { #define ATH_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_mtx, MA_NOTOWNED) /* + * The TX lock is non-reentrant and serialises the TX send operations. + * (ath_start(), ath_raw_xmit().) It doesn't yet serialise the TX + * completion operations; thus it can't be used (yet!) to protect + * hardware / software TXQ operations. + */ +#define ATH_TX_LOCK_INIT(_sc) do {\ + snprintf((_sc)->sc_tx_mtx_name, \ + sizeof((_sc)->sc_tx_mtx_name), \ + "%s TX lock", \ + device_get_nameunit((_sc)->sc_dev)); \ + mtx_init(&(_sc)->sc_tx_mtx, (_sc)->sc_tx_mtx_name, \ + NULL, MTX_DEF); \ + } while (0) +#define ATH_TX_LOCK_DESTROY(_sc) mtx_destroy(&(_sc)->sc_tx_mtx) +#define ATH_TX_LOCK(_sc) mtx_lock(&(_sc)->sc_tx_mtx) +#define ATH_TX_UNLOCK(_sc) mtx_unlock(&(_sc)->sc_tx_mtx) +#define ATH_TX_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_tx_mtx, \ + MA_OWNED) +#define ATH_TX_UNLOCK_ASSERT(_sc) mtx_assert(&(_sc)->sc_tx_mtx, \ + MA_NOTOWNED) + +/* * The PCU lock is non-recursive and should be treated as a spinlock. * Although currently the interrupt code is run in netisr context and * doesn't require this, this may change in the future. From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 06:35:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A69B54A7; Wed, 31 Oct 2012 06:35: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 8A0C18FC08; Wed, 31 Oct 2012 06:35:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V6ZoqD068834; Wed, 31 Oct 2012 06:35:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V6Zo2Y068832; Wed, 31 Oct 2012 06:35:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210310635.q9V6Zo2Y068832@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 06:35:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242392 - head/sys/dev/ath/ath_rate/sample X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 06:35:50 -0000 Author: adrian Date: Wed Oct 31 06:35:50 2012 New Revision: 242392 URL: http://svn.freebsd.org/changeset/base/242392 Log: I've had some feedback that CCK rates are more reliable than MCS 0 in some very degenerate conditions. However, until ath_rate_form_aggr() is taught to not form aggregates if ANY selected rate is non-MCS, this can't yet be enabled. So, just add a comment. 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 Wed Oct 31 06:27:58 2012 (r242391) +++ head/sys/dev/ath/ath_rate/sample/sample.c Wed Oct 31 06:35:50 2012 (r242392) @@ -272,12 +272,29 @@ pick_sample_rate(struct sample_softc *ss continue; } + /* + * The following code stops trying to sample + * non-MCS rates when speaking to an MCS node. + * However, at least for CCK rates in 2.4GHz mode, + * the non-MCS rates MAY actually provide better + * PER at the very far edge of reception. + * + * However! Until ath_rate_form_aggr() grows + * some logic to not form aggregates if the + * selected rate is non-MCS, this won't work. + * + * So don't disable this code until you've taught + * ath_rate_form_aggr() to drop out if any of + * the selected rates are non-MCS. + */ +#if 1 /* if the node is HT and the rate isn't HT, don't bother sample */ if ((an->an_node.ni_flags & IEEE80211_NODE_HT) && (rt->info[rix].phy != IEEE80211_T_HT)) { mask &= ~((uint64_t) 1<stats[size_bin][rix].perfect_tx_time > current_tt) { From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 07:59:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 441EC6EA for ; Wed, 31 Oct 2012 07:59:13 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7FBD28FC18 for ; Wed, 31 Oct 2012 07:59:12 +0000 (UTC) Received: (qmail 64112 invoked from network); 31 Oct 2012 09:35:46 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2012 09:35:46 -0000 Message-ID: <5090DA4A.5090502@freebsd.org> Date: Wed, 31 Oct 2012 08:59:06 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: pyunyh@gmail.com Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> <20121029052100.GO70741@FreeBSD.org> <20121029214038.GD1431@michelle.cdnetworks.com> <508E3C6B.2090102@freebsd.org> <20121030022507.GB4298@michelle.cdnetworks.com> In-Reply-To: <20121030022507.GB4298@michelle.cdnetworks.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 07:59:13 -0000 On 30.10.2012 03:25, YongHyeon PYUN wrote: > On Mon, Oct 29, 2012 at 09:20:59AM +0100, Andre Oppermann wrote: >> On 29.10.2012 22:40, YongHyeon PYUN wrote: >>> On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote: >>>> On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: >>>> Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: >>>> Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: >>>> Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: >>>> Y> > A> > Author: glebius >>>> Y> > A> > Date: Fri Oct 26 21:06:33 2012 >>>> Y> > A> > New Revision: 242161 >>>> Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 >>>> Y> > A> > >>>> Y> > A> > Log: >>>> Y> > A> > o Remove last argument to ip_fragment(), and obtain all >>>> needed information >>>> Y> > A> > on checksums directly from mbuf flags. This simplifies >>>> code. >>>> Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did >>>> checksums in >>>> Y> >>>> Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented >>>> Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) >>>> Y> requires CSUM_IP should be set for IP fragmented packets. Not sure >>>> Y> whether it's a bug or not. I have a ti(4) controller but I don't >>>> Y> remember where I can find it and don't have a link >>>> Y> parter(1000baseSX) to test it. :-( >>>> >>>> ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do >>> >>> Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4) >>> is the only controller that supports TCP/UDP checksum offloading >>> for an IP fragmented packet. >> >> This is a bit weird if it doesn't do the fragmentation itself. >> Computing the IP header checksum doesn't differ for normal and >> fragmented packets. The protocol checksum (TCP or UDP) stays >> the same for in the case of IP level fragmentation. It is only >> visible in the first fragment which includes the protocol header. > > My interpretation for CSUM_IP_FRAGS works like the following. > - Only peuso header checksum for TCP/UDP is computed by upper > stack. > - Controller has no ability to fragment the packet so it should > done in upper stack(i.e. ip_output()). > - When ip_output() has to fragment the packet, it just fragments > the packet without completing TCP/UDP and IP checksum. If > controller does not support CSUM_IP_FRAGS feature, ip_output() > can't delay TCP/UDP checksum in this stage. > - The fragmented packets are sent to driver. Driver sets > appropriate bits of DMA descriptor based on fragmentation field > of mbuf(M_FRAG, M_LASTFRAG) and issue the frame to controller. > - The firmware of controller queues the fragmented frames up in > its internal memory and hold off sending out the frames since it > has to compute TCP/UDP checksum. When it sees a frame which > indicates the end of fragmented frame it finally computes > TCP/UDP checksum and send each frame out to wire by computing > IP checksum on the fly. > The difference is which one(upper stack vs. controller) computes > TCP/UDP/IP checksum. Such a behavior doesn't make much sense and probably wasn't used at all in practice. It's very complex as well. Plus you can't guarantee that there won't be other packet slipping into the interface queue in an SMP world. IP fragmentation really isn't done for TCP within the kernel. We try to prevent it as it would have a huge performance impact. Hence the internal MTU discovery and the Don't Fragment bit set on TCP packets. IP fragmentation does happen for large UDP packet locally generated. There however because of the past absence of UDP fragmentation offload coupled with UDP checksum offloading caused all fragmentation to be done at the UDP level before it hits ip_output. The remaining use of IP fragmentation is when the machine is acting as a router and it has to send packets out on an interface with a smaller MTU than the one it came in on. So the only two useful features regarding UDP+IP fragmentation are: 1. IP fragmentation including UDP checksum calculation for locally generated large UDP packets. This is the TSO for UDP. 2. Pure IP fragmentation for in-transit packets. Here only the IP header checksum needs to be recalculated for each fragment. The layer 4 checksums (UDP, TCP and others) stay the same. -- Andre >> >>>> software checksums, and thus won't clear these flags. >>>> >>>> Potentially a driver that announces one flag in if_hwassist but relies on >>>> couple of flags to be set on mbuf is not correct. If a driver can't do >>>> single >>>> checksum processing independently from others, then it should set or >>>> clear >>>> appropriate flags in if_hwassist as a group. >>> >>> Hmm, then what would be best way to achieve CSUM_IP_FRAGS in >>> driver? I don't have clear idea how to utilize the hardware >>> feature. The stack should tell that the mbuf needs TCP/UDP checksum >>> offloading for IP fragmented packet(i.e. CSUM_IP_FRAGS is not set by >>> upper stack). >> >> As I said there can't be fragment checksumming without hardware > > It's up to controller's firmware. It does not send the fragmented > frame until it computes TCP/UDP checksum. > >> based fragmentation. We have three cases here: >> >> 1. TSO where the hardware does the segmentation, TCP and IP header >> checksums for each generated packet. >> 2. IP packet fragmentation where a packet is split, the IP header >> checksum is recomputed for each fragment, but the protocol csum >> stays the same and is not modified. >> 3. UDP fragmentation where a large packet is sent to the hardware >> and it generates first the UDP checksum and then splits it into >> IP fragments each with its own IP header checksum. >> >> So we end up with these possible large send hardware offload capabilities: >> TSO: including IPv4hdr and TCP checksumming >> UDP fragmentation: including IPv4hdr and UDP checksumming >> IP fragmentation: including IPv4hdr checksumming >> >> Besides that we have the packet <= MTU sized offload capabilities: >> TCP checksumming >> UDP checksumming >> SCTP checksumming >> IPv4hdr checksumming >> >>>> Y> > A> > hardware. Some driver may not announce CSUM_IP in theur >>>> if_hwassist, >>>> ^^^^^^^^ >>>> >>>> Oh, that was a typo! Software was meant. >> >> That explains quite a bit of confusion. >> >> -- >> Andre >> > > From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 08:25:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C974DD33; Wed, 31 Oct 2012 08:25:45 +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 B10C98FC08; Wed, 31 Oct 2012 08:25:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9V8Pj88090555; Wed, 31 Oct 2012 08:25:45 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9V8PjQD090550; Wed, 31 Oct 2012 08:25:45 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201210310825.q9V8PjQD090550@svn.freebsd.org> From: Andrew Turner Date: Wed, 31 Oct 2012 08:25:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242394 - in head/sys/arm: broadcom/bcm2835 lpc mv tegra X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 08:25:46 -0000 Author: andrew Date: Wed Oct 31 08:25:45 2012 New Revision: 242394 URL: http://svn.freebsd.org/changeset/base/242394 Log: Merge r242125 into the other ARMv6 copies of initarm. Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/tegra/tegra2_machdep.c Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Oct 31 07:57:49 2012 (r242393) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Wed Oct 31 08:25:45 2012 (r242394) @@ -306,6 +306,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -491,6 +492,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Modified: head/sys/arm/lpc/lpc_machdep.c ============================================================================== --- head/sys/arm/lpc/lpc_machdep.c Wed Oct 31 07:57:49 2012 (r242393) +++ head/sys/arm/lpc/lpc_machdep.c Wed Oct 31 08:25:45 2012 (r242394) @@ -307,6 +307,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -492,6 +493,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Modified: head/sys/arm/mv/mv_machdep.c ============================================================================== --- head/sys/arm/mv/mv_machdep.c Wed Oct 31 07:57:49 2012 (r242393) +++ head/sys/arm/mv/mv_machdep.c Wed Oct 31 08:25:45 2012 (r242394) @@ -297,6 +297,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -482,6 +483,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); Modified: head/sys/arm/tegra/tegra2_machdep.c ============================================================================== --- head/sys/arm/tegra/tegra2_machdep.c Wed Oct 31 07:57:49 2012 (r242393) +++ head/sys/arm/tegra/tegra2_machdep.c Wed Oct 31 08:25:45 2012 (r242394) @@ -346,6 +346,7 @@ initarm(struct arm_boot_params *abp) struct pv_addr dpcpu; vm_offset_t dtbp, freemempos, l2_start, lastaddr; uint32_t memsize, l2size; + char *env; void *kmdp; u_int l1pagetable; int i = 0, j = 0, err_devmap = 0; @@ -531,6 +532,10 @@ initarm(struct arm_boot_params *abp) print_kernel_section_addr(); print_kenv(); + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + if (err_devmap != 0) printf("WARNING: could not fully configure devmap, error=%d\n", err_devmap); From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 13:38:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 05B6174D; Wed, 31 Oct 2012 13:38:57 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DF3DB8FC08; Wed, 31 Oct 2012 13:38:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VDcuKH052880; Wed, 31 Oct 2012 13:38:56 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VDcuCE052876; Wed, 31 Oct 2012 13:38:56 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210311338.q9VDcuCE052876@svn.freebsd.org> From: Attilio Rao Date: Wed, 31 Oct 2012 13:38:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242395 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 13:38:57 -0000 Author: attilio Date: Wed Oct 31 13:38:56 2012 New Revision: 242395 URL: http://svn.freebsd.org/changeset/base/242395 Log: Give mtx(9) the ability to crunch different type of structures, with the only constraint that they have a lock cookie named mtx_lock. This name, then, becames reserved from the struct that wants to use the mtx(9) KPI and other locking primitives cannot reuse it for their members. Namely such structs are the current struct mtx and the new struct mtx_padalign. The new structure will define an object which is the same as the same layout of a struct mtx but will be allocated in areas aligned to the cache line size and will be as big as a cache line. This is supposed to give higher performance for highly contented mutexes both spin or sleep (because of the adaptive spinning), where the cache line contention results in too much traffic on the system bus. The struct mtx_padalign can be used in a completely transparent way with the mtx(9) KPI. At the moment, a possibility to MFC the patch should be carefully evaluated because this patch breaks the low level KPI (not its representation though). Discussed with: jhb Reviewed by: jeff, andre Reviewed by: mdf (earlier version) Tested by: jimharris Modified: head/sys/kern/kern_mutex.c head/sys/sys/_mutex.h head/sys/sys/mutex.h Modified: head/sys/kern/kern_mutex.c ============================================================================== --- head/sys/kern/kern_mutex.c Wed Oct 31 08:25:45 2012 (r242394) +++ head/sys/kern/kern_mutex.c Wed Oct 31 13:38:56 2012 (r242395) @@ -83,6 +83,12 @@ PMC_SOFT_DEFINE( , , lock, failed); #endif /* + * Return the mutex address when the lock cookie address is provided. + * This functionality assumes that struct mtx* have a member named mtx_lock. + */ +#define mtxlock2mtx(c) (__containerof(c, struct mtx, mtx_lock)) + +/* * Internal utility macros. */ #define mtx_unowned(m) ((m)->mtx_lock == MTX_UNOWNED) @@ -195,11 +201,15 @@ owner_mtx(const struct lock_object *lock * modules and can also be called from assembly language if needed. */ void -_mtx_lock_flags(struct mtx *m, int opts, const char *file, int line) +__mtx_lock_flags(volatile uintptr_t *c, int opts, const char *file, int line) { + struct mtx *m; if (SCHEDULER_STOPPED()) return; + + m = mtxlock2mtx(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("mtx_lock() by idle thread %p on sleep mutex %s @ %s:%d", curthread, m->lock_object.lo_name, file, line)); @@ -219,11 +229,15 @@ _mtx_lock_flags(struct mtx *m, int opts, } void -_mtx_unlock_flags(struct mtx *m, int opts, const char *file, int line) +__mtx_unlock_flags(volatile uintptr_t *c, int opts, const char *file, int line) { + struct mtx *m; if (SCHEDULER_STOPPED()) return; + + m = mtxlock2mtx(c); + KASSERT(m->mtx_lock != MTX_DESTROYED, ("mtx_unlock() of destroyed mutex @ %s:%d", file, line)); KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_sleep, @@ -241,11 +255,16 @@ _mtx_unlock_flags(struct mtx *m, int opt } void -_mtx_lock_spin_flags(struct mtx *m, int opts, const char *file, int line) +__mtx_lock_spin_flags(volatile uintptr_t *c, int opts, const char *file, + int line) { + struct mtx *m; if (SCHEDULER_STOPPED()) return; + + m = mtxlock2mtx(c); + KASSERT(m->mtx_lock != MTX_DESTROYED, ("mtx_lock_spin() of destroyed mutex @ %s:%d", file, line)); KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, @@ -264,11 +283,16 @@ _mtx_lock_spin_flags(struct mtx *m, int } void -_mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file, int line) +__mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, const char *file, + int line) { + struct mtx *m; if (SCHEDULER_STOPPED()) return; + + m = mtxlock2mtx(c); + KASSERT(m->mtx_lock != MTX_DESTROYED, ("mtx_unlock_spin() of destroyed mutex @ %s:%d", file, line)); KASSERT(LOCK_CLASS(&m->lock_object) == &lock_class_mtx_spin, @@ -288,8 +312,9 @@ _mtx_unlock_spin_flags(struct mtx *m, in * is already owned, it will recursively acquire the lock. */ int -mtx_trylock_flags_(struct mtx *m, int opts, const char *file, int line) +_mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line) { + struct mtx *m; #ifdef LOCK_PROFILING uint64_t waittime = 0; int contested = 0; @@ -299,6 +324,8 @@ mtx_trylock_flags_(struct mtx *m, int op if (SCHEDULER_STOPPED()) return (1); + m = mtxlock2mtx(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("mtx_trylock() by idle thread %p on sleep mutex %s @ %s:%d", curthread, m->lock_object.lo_name, file, line)); @@ -330,15 +357,16 @@ mtx_trylock_flags_(struct mtx *m, int op } /* - * _mtx_lock_sleep: the tougher part of acquiring an MTX_DEF lock. + * __mtx_lock_sleep: the tougher part of acquiring an MTX_DEF lock. * * We call this if the lock is either contested (i.e. we need to go to * sleep waiting for it), or if we need to recurse on it. */ void -_mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, const char *file, - int line) +__mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts, + const char *file, int line) { + struct mtx *m; struct turnstile *ts; uintptr_t v; #ifdef ADAPTIVE_MUTEXES @@ -360,6 +388,8 @@ _mtx_lock_sleep(struct mtx *m, uintptr_t if (SCHEDULER_STOPPED()) return; + m = mtxlock2mtx(c); + if (mtx_owned(m)) { KASSERT((m->lock_object.lo_flags & LO_RECURSABLE) != 0, ("_mtx_lock_sleep: recursed on non-recursive mutex %s @ %s:%d\n", @@ -518,15 +548,16 @@ _mtx_lock_spin_failed(struct mtx *m) #ifdef SMP /* - * _mtx_lock_spin: the tougher part of acquiring an MTX_SPIN lock. + * _mtx_lock_spin_cookie: the tougher part of acquiring an MTX_SPIN lock. * * This is only called if we need to actually spin for the lock. Recursion * is handled inline. */ void -_mtx_lock_spin(struct mtx *m, uintptr_t tid, int opts, const char *file, - int line) +_mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts, + const char *file, int line) { + struct mtx *m; int i = 0; #ifdef LOCK_PROFILING int contested = 0; @@ -536,6 +567,8 @@ _mtx_lock_spin(struct mtx *m, uintptr_t if (SCHEDULER_STOPPED()) return; + m = mtxlock2mtx(c); + if (LOCK_LOG_TEST(&m->lock_object, opts)) CTR1(KTR_LOCK, "_mtx_lock_spin: %p spinning", m); @@ -684,19 +717,22 @@ thread_lock_set(struct thread *td, struc } /* - * _mtx_unlock_sleep: the tougher part of releasing an MTX_DEF lock. + * __mtx_unlock_sleep: the tougher part of releasing an MTX_DEF lock. * * We are only called here if the lock is recursed or contested (i.e. we * need to wake up a blocked thread). */ void -_mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line) +__mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, int line) { + struct mtx *m; struct turnstile *ts; if (SCHEDULER_STOPPED()) return; + m = mtxlock2mtx(c); + if (mtx_recursed(m)) { if (--(m->mtx_recurse) == 0) atomic_clear_ptr(&m->mtx_lock, MTX_RECURSED); @@ -735,11 +771,15 @@ _mtx_unlock_sleep(struct mtx *m, int opt */ #ifdef INVARIANT_SUPPORT void -_mtx_assert(const struct mtx *m, int what, const char *file, int line) +__mtx_assert(const volatile uintptr_t *c, int what, const char *file, int line) { + const struct mtx *m; if (panicstr != NULL || dumping) return; + + m = mtxlock2mtx(c); + switch (what) { case MA_OWNED: case MA_OWNED | MA_RECURSED: @@ -806,7 +846,8 @@ mtx_sysinit(void *arg) { struct mtx_args *margs = arg; - mtx_init(margs->ma_mtx, margs->ma_desc, NULL, margs->ma_opts); + mtx_init((struct mtx *)margs->ma_mtx, margs->ma_desc, NULL, + margs->ma_opts); } /* @@ -816,11 +857,14 @@ mtx_sysinit(void *arg) * witness. */ void -mtx_init(struct mtx *m, const char *name, const char *type, int opts) +_mtx_init(volatile uintptr_t *c, const char *name, const char *type, int opts) { + struct mtx *m; struct lock_class *class; int flags; + m = mtxlock2mtx(c); + MPASS((opts & ~(MTX_SPIN | MTX_QUIET | MTX_RECURSE | MTX_NOWITNESS | MTX_DUPOK | MTX_NOPROFILE)) == 0); ASSERT_ATOMIC_LOAD_PTR(m->mtx_lock, @@ -863,8 +907,11 @@ mtx_init(struct mtx *m, const char *name * flags. */ void -mtx_destroy(struct mtx *m) +_mtx_destroy(volatile uintptr_t *c) { + struct mtx *m; + + m = mtxlock2mtx(c); if (!mtx_owned(m)) MPASS(mtx_unowned(m)); Modified: head/sys/sys/_mutex.h ============================================================================== --- head/sys/sys/_mutex.h Wed Oct 31 08:25:45 2012 (r242394) +++ head/sys/sys/_mutex.h Wed Oct 31 13:38:56 2012 (r242395) @@ -31,12 +31,34 @@ #ifndef _SYS__MUTEX_H_ #define _SYS__MUTEX_H_ +#include + /* * Sleep/spin mutex. + * + * The layout of the first 2 members of struct mtx* is considered fixed. + * More specifically, it is assumed that there is a member called mtx_lock + * for every struct mtx* and that other locking primitive structures are + * not allowed to use such name for their members. + * If this needs to change, the bits in the mutex implementation might be + * modified appropriately. */ struct mtx { struct lock_object lock_object; /* Common lock properties. */ volatile uintptr_t mtx_lock; /* Owner and flags. */ }; +/* + * Members of struct mtx_padalign must mirror members of struct mtx. + * mtx_padalign mutexes can use mtx(9) KPI transparently, without modifies. + * When using pad-aligned mutexes within structures, they should generally + * stay as the first member of the struct. This is because otherwise the + * compiler can generate ever more padding for the struct to keep a correct + * alignment for the mutex. + */ +struct mtx_padalign { + struct lock_object lock_object; /* Common lock properties. */ + volatile uintptr_t mtx_lock; /* Owner and flags. */ +} __aligned(CACHE_LINE_SIZE); + #endif /* !_SYS__MUTEX_H_ */ Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Wed Oct 31 08:25:45 2012 (r242394) +++ head/sys/sys/mutex.h Wed Oct 31 13:38:56 2012 (r242395) @@ -79,7 +79,8 @@ * * NOTE: Functions prepended with `_' (underscore) are exported to other parts * of the kernel via macros, thus allowing us to use the cpp LOCK_FILE - * and LOCK_LINE. These functions should not be called directly by any + * and LOCK_LINE or for hiding the lock cookie crunching to the + * consumers. These functions should not be called directly by any * code using the API. Their macros cover their functionality. * Functions with a `_' suffix are the entrypoint for the common * KPI covering both compat shims and fast path case. These can be @@ -89,28 +90,32 @@ * [See below for descriptions] * */ -void mtx_init(struct mtx *m, const char *name, const char *type, int opts); -void mtx_destroy(struct mtx *m); +void _mtx_init(volatile uintptr_t *c, const char *name, const char *type, + int opts); +void _mtx_destroy(volatile uintptr_t *c); void mtx_sysinit(void *arg); -int mtx_trylock_flags_(struct mtx *m, int opts, const char *file, +int _mtx_trylock_flags_(volatile uintptr_t *c, int opts, const char *file, int line); void mutex_init(void); -void _mtx_lock_sleep(struct mtx *m, uintptr_t tid, int opts, +void __mtx_lock_sleep(volatile uintptr_t *c, uintptr_t tid, int opts, const char *file, int line); -void _mtx_unlock_sleep(struct mtx *m, int opts, const char *file, int line); +void __mtx_unlock_sleep(volatile uintptr_t *c, int opts, const char *file, + int line); #ifdef SMP -void _mtx_lock_spin(struct mtx *m, uintptr_t tid, int opts, +void _mtx_lock_spin_cookie(volatile uintptr_t *c, uintptr_t tid, int opts, const char *file, int line); #endif -void _mtx_unlock_spin(struct mtx *m, int opts, const char *file, int line); -void _mtx_lock_flags(struct mtx *m, int opts, const char *file, int line); -void _mtx_unlock_flags(struct mtx *m, int opts, const char *file, int line); -void _mtx_lock_spin_flags(struct mtx *m, int opts, const char *file, - int line); -void _mtx_unlock_spin_flags(struct mtx *m, int opts, const char *file, +void __mtx_lock_flags(volatile uintptr_t *c, int opts, const char *file, + int line); +void __mtx_unlock_flags(volatile uintptr_t *c, int opts, const char *file, + int line); +void __mtx_lock_spin_flags(volatile uintptr_t *c, int opts, const char *file, int line); +void __mtx_unlock_spin_flags(volatile uintptr_t *c, int opts, + const char *file, int line); #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _mtx_assert(const struct mtx *m, int what, const char *file, int line); +void __mtx_assert(const volatile uintptr_t *c, int what, const char *file, + int line); #endif void thread_lock_flags_(struct thread *, int, const char *, int); @@ -121,6 +126,38 @@ void thread_lock_flags_(struct thread *, #define thread_unlock(tdp) \ mtx_unlock_spin((tdp)->td_lock) +/* + * Top-level macros to provide lock cookie once the actual mtx is passed. + * They will also prevent passing a malformed object to the mtx KPI by + * failing compilation. + */ +#define mtx_init(m, n, t, o) \ + _mtx_init(&(m)->mtx_lock, n, t, o) +#define mtx_destroy(m) \ + _mtx_destroy(&(m)->mtx_lock) +#define mtx_trylock_flags_(m, o, f, l) \ + _mtx_trylock_flags_(&(m)->mtx_lock, o, f, l) +#define _mtx_lock_sleep(m, t, o, f, l) \ + __mtx_lock_sleep(&(m)->mtx_lock, t, o, f, l) +#define _mtx_unlock_sleep(m, o, f, l) \ + __mtx_unlock_sleep(&(m)->mtx_lock, o, f, l) +#ifdef SMP +#define _mtx_lock_spin(m, t, o, f, l) \ + _mtx_lock_spin_cookie(&(m)->mtx_lock, t, o, f, l) +#endif +#define _mtx_lock_flags(m, o, f, l) \ + __mtx_lock_flags(&(m)->mtx_lock, o, f, l) +#define _mtx_unlock_flags(m, o, f, l) \ + __mtx_unlock_flags(&(m)->mtx_lock, o, f, l) +#define _mtx_lock_spin_flags(m, o, f, l) \ + __mtx_lock_spin_flags(&(m)->mtx_lock, o, f, l) +#define _mtx_unlock_spin_flags(m, o, f, l) \ + __mtx_unlock_spin_flags(&(m)->mtx_lock, o, f, l) +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +#define _mtx_assert(m, w, f, l) \ + __mtx_assert(&(m)->mtx_lock, w, f, l) +#endif + #define mtx_recurse lock_object.lo_data /* Very simple operations on mtx_lock. */ @@ -395,7 +432,7 @@ do { \ } while (0) struct mtx_args { - struct mtx *ma_mtx; + void *ma_mtx; const char *ma_desc; int ma_opts; }; @@ -409,7 +446,7 @@ struct mtx_args { SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ mtx_sysinit, &name##_args); \ SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - mtx_destroy, (mtx)) + _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) /* * The INVARIANTS-enabled mtx_assert() functionality. From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 13:52:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77915B2C; Wed, 31 Oct 2012 13:52: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 6077E8FC0A; Wed, 31 Oct 2012 13:52:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VDq4xn055024; Wed, 31 Oct 2012 13:52:04 GMT (envelope-from gavin@svn.freebsd.org) Received: (from gavin@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VDq4fZ055022; Wed, 31 Oct 2012 13:52:04 GMT (envelope-from gavin@svn.freebsd.org) Message-Id: <201210311352.q9VDq4fZ055022@svn.freebsd.org> From: Gavin Atkinson Date: Wed, 31 Oct 2012 13:52:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242396 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 13:52:04 -0000 Author: gavin Date: Wed Oct 31 13:52:03 2012 New Revision: 242396 URL: http://svn.freebsd.org/changeset/base/242396 Log: Genericise the (out of date) instructions from moving from stable to current. MFC after: 3 days Modified: head/UPDATING Modified: head/UPDATING ============================================================================== --- head/UPDATING Wed Oct 31 13:38:56 2012 (r242395) +++ head/UPDATING Wed Oct 31 13:52:03 2012 (r242396) @@ -1595,7 +1595,7 @@ COMMON ITEMS: - To upgrade in-place from 8.x-stable to current + To upgrade in-place from stable to current ---------------------------------------------- make buildworld [9] From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 15:04:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1C75AF1F; Wed, 31 Oct 2012 15:04:28 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0314C8FC14; Wed, 31 Oct 2012 15:04:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VF4RVK067734; Wed, 31 Oct 2012 15:04:27 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VF4RfF067732; Wed, 31 Oct 2012 15:04:27 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201210311504.q9VF4RfF067732@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 31 Oct 2012 15:04:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242398 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 15:04:28 -0000 Author: des Date: Wed Oct 31 15:04:27 2012 New Revision: 242398 URL: http://svn.freebsd.org/changeset/base/242398 Log: Correct attribution. Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Wed Oct 31 14:02:51 2012 (r242397) +++ head/lib/libutil/pw_util.3 Wed Oct 31 15:04:27 2012 (r242398) @@ -274,8 +274,13 @@ The returns an open file descriptor to the temporary password file or -1 in case of failure. .Sh AUTHORS -.Nm pw_util -was written by -.An Dag-Erling Sm\(/orgrav Aq des@FreeBSD.org . +Portions of this software were developed for the +.Fx +Project by ThinkSec AS and Network Associates Laboratories, the +Security Research Division of Network Associates, Inc.\& under +DARPA/SPAWAR contract N66001-01-C-8035 +.Pq Dq CBOSS , +as part of the DARPA CHATS research program. +.Pp This manual page was written by .An Baptiste Daroussin Aq bapt@FreeBSD.org . From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 17:12:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 940194B4; Wed, 31 Oct 2012 17:12:13 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7B89D8FC14; Wed, 31 Oct 2012 17:12:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VHCD0g090320; Wed, 31 Oct 2012 17:12:13 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VHCDZI090317; Wed, 31 Oct 2012 17:12:13 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210311712.q9VHCDZI090317@svn.freebsd.org> From: Jim Harris Date: Wed, 31 Oct 2012 17:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242401 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 17:12:13 -0000 Author: jimharris Date: Wed Oct 31 17:12:12 2012 New Revision: 242401 URL: http://svn.freebsd.org/changeset/base/242401 Log: Pad and align the callout_cpu mtx to its own cacheline to reduce false sharing especially on the default CPU 0 callout_cpu structure. This will be followed up by attilio@ with a conversion to the new struct mtx_padalign but doing this manual conversion first gives an easy MFC candidate since mtx_padalign is a more extensive system change. Sponsored by: Intel Reviewed by: jeff, attilio MFC after: 1 week Modified: head/sys/kern/kern_timeout.c Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Wed Oct 31 17:01:56 2012 (r242400) +++ head/sys/kern/kern_timeout.c Wed Oct 31 17:12:12 2012 (r242401) @@ -119,8 +119,8 @@ struct cc_mig_ent { * when the callout should be served. */ struct callout_cpu { - struct cc_mig_ent cc_migrating_entity; struct mtx cc_lock; + struct cc_mig_ent cc_migrating_entity __aligned(CACHE_LINE_SIZE); struct callout *cc_callout; struct callout_tailq *cc_callwheel; struct callout_list cc_callfree; From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:07:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A3E566A; Wed, 31 Oct 2012 18:07:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 17B0B8FC0A; Wed, 31 Oct 2012 18:07:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VI7Isg000998; Wed, 31 Oct 2012 18:07:18 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VI7IcX000993; Wed, 31 Oct 2012 18:07:18 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201210311807.q9VI7IcX000993@svn.freebsd.org> From: Attilio Rao Date: Wed, 31 Oct 2012 18:07:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242402 - in head/sys: kern vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:07:19 -0000 Author: attilio Date: Wed Oct 31 18:07:18 2012 New Revision: 242402 URL: http://svn.freebsd.org/changeset/base/242402 Log: Rework the known mutexes to benefit about staying on their own cache line in order to avoid manual frobbing but using struct mtx_padalign. The sole exception being nvme and sxfge drivers, where the author redefined CACHE_LINE_SIZE manually, so they need to be analyzed and dealt with separately. Reviwed by: jimharris, alc Modified: head/sys/kern/kern_timeout.c head/sys/kern/sched_ule.c head/sys/vm/vm_page.c head/sys/vm/vm_page.h Modified: head/sys/kern/kern_timeout.c ============================================================================== --- head/sys/kern/kern_timeout.c Wed Oct 31 17:12:12 2012 (r242401) +++ head/sys/kern/kern_timeout.c Wed Oct 31 18:07:18 2012 (r242402) @@ -119,8 +119,8 @@ struct cc_mig_ent { * when the callout should be served. */ struct callout_cpu { - struct mtx cc_lock; - struct cc_mig_ent cc_migrating_entity __aligned(CACHE_LINE_SIZE); + struct mtx_padalign cc_lock; + struct cc_mig_ent cc_migrating_entity; struct callout *cc_callout; struct callout_tailq *cc_callwheel; struct callout_list cc_callfree; Modified: head/sys/kern/sched_ule.c ============================================================================== --- head/sys/kern/sched_ule.c Wed Oct 31 17:12:12 2012 (r242401) +++ head/sys/kern/sched_ule.c Wed Oct 31 18:07:18 2012 (r242402) @@ -228,8 +228,7 @@ struct tdq { * tdq_lock is padded to avoid false sharing with tdq_load and * tdq_cpu_idle. */ - struct mtx tdq_lock; /* run queue lock. */ - char pad[64 - sizeof(struct mtx)]; + struct mtx_padalign tdq_lock; /* run queue lock. */ struct cpu_group *tdq_cg; /* Pointer to cpu topology. */ volatile int tdq_load; /* Aggregate load. */ volatile int tdq_cpu_idle; /* cpu_idle() is active. */ @@ -292,7 +291,7 @@ static struct tdq tdq_cpu; #define TDQ_LOCK(t) mtx_lock_spin(TDQ_LOCKPTR((t))) #define TDQ_LOCK_FLAGS(t, f) mtx_lock_spin_flags(TDQ_LOCKPTR((t)), (f)) #define TDQ_UNLOCK(t) mtx_unlock_spin(TDQ_LOCKPTR((t))) -#define TDQ_LOCKPTR(t) (&(t)->tdq_lock) +#define TDQ_LOCKPTR(t) ((struct mtx *)(&(t)->tdq_lock)) static void sched_priority(struct thread *); static void sched_thread_priority(struct thread *, u_char); Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Wed Oct 31 17:12:12 2012 (r242401) +++ head/sys/vm/vm_page.c Wed Oct 31 18:07:18 2012 (r242402) @@ -116,10 +116,10 @@ __FBSDID("$FreeBSD$"); */ struct vpgqueues vm_page_queues[PQ_COUNT]; -struct vpglocks vm_page_queue_lock; -struct vpglocks vm_page_queue_free_lock; +struct mtx_padalign vm_page_queue_mtx; +struct mtx_padalign vm_page_queue_free_mtx; -struct vpglocks pa_lock[PA_LOCK_COUNT]; +struct mtx_padalign pa_lock[PA_LOCK_COUNT]; vm_page_t vm_page_array; long vm_page_array_size; @@ -298,7 +298,7 @@ vm_page_startup(vm_offset_t vaddr) MTX_RECURSE); mtx_init(&vm_page_queue_free_mtx, "vm page free queue", NULL, MTX_DEF); for (i = 0; i < PA_LOCK_COUNT; i++) - mtx_init(&pa_lock[i].data, "vm page", NULL, MTX_DEF); + mtx_init(&pa_lock[i], "vm page", NULL, MTX_DEF); /* * Initialize the queue headers for the hold queue, the active queue, Modified: head/sys/vm/vm_page.h ============================================================================== --- head/sys/vm/vm_page.h Wed Oct 31 17:12:12 2012 (r242401) +++ head/sys/vm/vm_page.h Wed Oct 31 18:07:18 2012 (r242402) @@ -187,13 +187,8 @@ struct vpgqueues { extern struct vpgqueues vm_page_queues[PQ_COUNT]; -struct vpglocks { - struct mtx data; - char pad[CACHE_LINE_SIZE - sizeof(struct mtx)]; -} __aligned(CACHE_LINE_SIZE); - -extern struct vpglocks vm_page_queue_free_lock; -extern struct vpglocks pa_lock[]; +extern struct mtx_padalign vm_page_queue_free_mtx; +extern struct mtx_padalign pa_lock[]; #if defined(__arm__) #define PDRSHIFT PDR_SHIFT @@ -202,7 +197,7 @@ extern struct vpglocks pa_lock[]; #endif #define pa_index(pa) ((pa) >> PDRSHIFT) -#define PA_LOCKPTR(pa) &pa_lock[pa_index((pa)) % PA_LOCK_COUNT].data +#define PA_LOCKPTR(pa) ((struct mtx *)(&pa_lock[pa_index(pa) % PA_LOCK_COUNT])) #define PA_LOCKOBJPTR(pa) ((struct lock_object *)PA_LOCKPTR((pa))) #define PA_LOCK(pa) mtx_lock(PA_LOCKPTR(pa)) #define PA_TRYLOCK(pa) mtx_trylock(PA_LOCKPTR(pa)) @@ -235,8 +230,6 @@ extern struct vpglocks pa_lock[]; #define vm_page_lock_assert(m, a) mtx_assert(vm_page_lockptr((m)), (a)) #endif -#define vm_page_queue_free_mtx vm_page_queue_free_lock.data - /* * The vm_page's aflags are updated using atomic operations. To set or clear * these flags, the functions vm_page_aflag_set() and vm_page_aflag_clear() @@ -327,9 +320,8 @@ vm_page_t vm_phys_paddr_to_vm_page(vm_pa vm_page_t PHYS_TO_VM_PAGE(vm_paddr_t pa); -extern struct vpglocks vm_page_queue_lock; +extern struct mtx_padalign vm_page_queue_mtx; -#define vm_page_queue_mtx vm_page_queue_lock.data #define vm_page_lock_queues() mtx_lock(&vm_page_queue_mtx) #define vm_page_unlock_queues() mtx_unlock(&vm_page_queue_mtx) From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:10:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AB85686F; Wed, 31 Oct 2012 18:10:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id B17E48FC14; Wed, 31 Oct 2012 18:10:30 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1624701lbd.13 for ; Wed, 31 Oct 2012 11:10:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=W5pf6468jYqNHF74RFajrQYR01m8ZP1DuzRHZrXNRMA=; b=nPOsGcYmIr1H/zyl4D+8zHzJEMvZB4B+1HW6iTvS2QyPs66DE2MmHgG8xQxaISL3vJ hdhDXvbtCxxVHejuJyeRo41+uw7wi93RoMilBXWCFb8Qcfiza/zKK+y4Yyzhze0B+pyi vKRf1vf9tY4totlv22HGBHJAuK3aBugkuNDj0EV/Ey1z6PtFROw39SXG043I4j9ou4nA yB1T0zUaIAm98uI9LDZ6wZXn9BsUfSjNIDoBwY93165IAIvVqouM0C2eRm8kTaspXfFi dscN0AxfuTp42jUCwVs3O7GaT2KAC+fC+vHW+CNujDpQZ9vYDwTZW+cXN5KnS5tedH45 S1Rg== MIME-Version: 1.0 Received: by 10.112.82.103 with SMTP id h7mr14862810lby.50.1351707029495; Wed, 31 Oct 2012 11:10:29 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 31 Oct 2012 11:10:29 -0700 (PDT) In-Reply-To: <201210311807.q9VI7IcX000993@svn.freebsd.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> Date: Wed, 31 Oct 2012 18:10:29 +0000 X-Google-Sender-Auth: f993n6a-Go9bR2Npa1udm6EKArE Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:10:31 -0000 On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: > Author: attilio > Date: Wed Oct 31 18:07:18 2012 > New Revision: 242402 > URL: http://svn.freebsd.org/changeset/base/242402 > > Log: > Rework the known mutexes to benefit about staying on their own > cache line in order to avoid manual frobbing but using > struct mtx_padalign. Interested developers can now dig and look for other mutexes to convert and just do it. Please, however, try to enclose a description about the benchmark which lead you believe the necessity to pad the mutex and possibly some numbers, in particular when the lock belongs to structures or the ABI itself. Next steps involve porting the same mtx(9) changes to rwlock(9) and port pvh global pmap lock to rwlock_padalign. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:16:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D6616EB8; Wed, 31 Oct 2012 18:16:42 +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 BF2AD8FC0A; Wed, 31 Oct 2012 18:16:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VIGgmH003170; Wed, 31 Oct 2012 18:16:42 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VIGgxA003166; Wed, 31 Oct 2012 18:16:42 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201210311816.q9VIGgxA003166@svn.freebsd.org> From: Jack F Vogel Date: Wed, 31 Oct 2012 18:16:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242403 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:16:42 -0000 Author: jfv Date: Wed Oct 31 18:16:42 2012 New Revision: 242403 URL: http://svn.freebsd.org/changeset/base/242403 Log: Correct code that was lost somewhere in the past, this was designed to keep duplicate null vlan tags from being added. When doing vlans purely via the switch this problem will occur. Reported by external customer. Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 31 18:07:18 2012 (r242402) +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 31 18:16:42 2012 (r242403) @@ -4688,7 +4688,7 @@ ixgbe_rxeof(struct ix_queue *que, int co /* first desc of a non-ps chain */ sendmp->m_flags |= M_PKTHDR; sendmp->m_pkthdr.len = mp->m_len; - if (staterr & IXGBE_RXD_STAT_VP) { + if (vtag) { sendmp->m_pkthdr.ether_vtag = vtag; sendmp->m_flags |= M_VLANTAG; } From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:26:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D3629512; Wed, 31 Oct 2012 18:26:07 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 9E4158FC1B; Wed, 31 Oct 2012 18:26:07 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9VIQ6Sk011310; Wed, 31 Oct 2012 12:26:06 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9VIQ4XY006760; Wed, 31 Oct 2012 12:26:04 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Ian Lepore To: attilio@freebsd.org In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 31 Oct 2012 12:26:04 -0600 Message-ID: <1351707964.1120.97.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:26:07 -0000 On Wed, 2012-10-31 at 18:10 +0000, Attilio Rao wrote: > On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: > > Author: attilio > > Date: Wed Oct 31 18:07:18 2012 > > New Revision: 242402 > > URL: http://svn.freebsd.org/changeset/base/242402 > > > > Log: > > Rework the known mutexes to benefit about staying on their own > > cache line in order to avoid manual frobbing but using > > struct mtx_padalign. > > Interested developers can now dig and look for other mutexes to > convert and just do it. > Please, however, try to enclose a description about the benchmark > which lead you believe the necessity to pad the mutex and possibly > some numbers, in particular when the lock belongs to structures or the > ABI itself. > > Next steps involve porting the same mtx(9) changes to rwlock(9) and > port pvh global pmap lock to rwlock_padalign. > > Thanks, > Attilio > > Doesn't this padding to cache line size only help x86 processors in an SMP kernel? I was expecting to see some #ifdef SMP so that we don't pay a big price for no gain in small-memory ARM systems and such. But maybe I'm misunderstanding the reason for the padding. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:33:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B6CCE72E; Wed, 31 Oct 2012 18:33:53 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id BDAB58FC0C; Wed, 31 Oct 2012 18:33:52 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so1645116lbd.13 for ; Wed, 31 Oct 2012 11:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Fba1C/EP7k1s5uJF+KTU7e7As8c89jj4h0MISZtfNfs=; b=bZlG/+pC4mQH1ZiaBfu1vOf6NH210AkhAT2P+QEUbD6wa5aGassXFJpuRYnLPizh0j 8lG3JP7XEJHU4h3FHVM1HNP/nvgctAtHYdCAzMhqVlNxzA9S+AQON9SAL/SOApa110rN KN23VVDY7U+TKIwjStuOExo4bPpi8G01g+fehzT/JLNWFLujxYAgiediSWm4TZBu7GAr 66f1UZG4gIHFvTJQhc4hXKo7Jqpu+JAjgRn9j1ACMJJPs9nUjhdriU/2j+EGMyledaUf qipkLboOEa1Lbm/kXwQOVKVT3hWxPyjnZzTJC6bpACxACnu+NDzqDbpGjvDalamWMNHh 7K3A== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr12416850lab.15.1351708431305; Wed, 31 Oct 2012 11:33:51 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 31 Oct 2012 11:33:51 -0700 (PDT) In-Reply-To: <1351707964.1120.97.camel@revolution.hippie.lan> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> Date: Wed, 31 Oct 2012 18:33:51 +0000 X-Google-Sender-Auth: 08QWXV9Zg0uRD5XXoyabfGwHDNY Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:33:53 -0000 On Wed, Oct 31, 2012 at 6:26 PM, Ian Lepore wrote: > On Wed, 2012-10-31 at 18:10 +0000, Attilio Rao wrote: >> On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: >> > Author: attilio >> > Date: Wed Oct 31 18:07:18 2012 >> > New Revision: 242402 >> > URL: http://svn.freebsd.org/changeset/base/242402 >> > >> > Log: >> > Rework the known mutexes to benefit about staying on their own >> > cache line in order to avoid manual frobbing but using >> > struct mtx_padalign. >> >> Interested developers can now dig and look for other mutexes to >> convert and just do it. >> Please, however, try to enclose a description about the benchmark >> which lead you believe the necessity to pad the mutex and possibly >> some numbers, in particular when the lock belongs to structures or the >> ABI itself. >> >> Next steps involve porting the same mtx(9) changes to rwlock(9) and >> port pvh global pmap lock to rwlock_padalign. >> >> Thanks, >> Attilio >> >> > > Doesn't this padding to cache line size only help x86 processors in an > SMP kernel? I was expecting to see some #ifdef SMP so that we don't pay > a big price for no gain in small-memory ARM systems and such. But maybe > I'm misunderstanding the reason for the padding. I didn't want to do this because this would be meaning that SMP option may become a completely killer for modules/kernel ABI compatibility. Also, if you look at the modified list of locks I don't think they should be too much, I hardly believe ARM UP is going to hurt that much from loosing some padding in tdq structures or callout. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:50:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32587ACE; Wed, 31 Oct 2012 18:50:18 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id E193E8FC15; Wed, 31 Oct 2012 18:50:17 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so1275339pbb.13 for ; Wed, 31 Oct 2012 11:50:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=E7dGQrKCD+VptTo+YT4kemVmw3TvGALCZop9azqXUA8=; b=ErCV4jgavewes0nFg7PuKPb/6oObLbYMzCMsT+z5OgdNmy3bfuJr+Sj+T6x/MGdFDa KFhr8qNlu6ssTibU+w6MH0pqiWVZ/Owg/+ayof7x9pm0iz1UerQtSkFi65n0OBqbx8LK /8uGOw7ynGZH0V++kD6Ko7fIFOMA+mB4Eq4RzMu+nOfAf8kvCq8wsJWl/RpIM2yw8gmu Wskh3umQ801QITcjsH9dkZAw8VQRkHuRSiRw4//digsKa36H6YhoswKk110xmDc+AbR1 l8iOdaJMEfo1GECNdEMn0m884jrWGXXzSEK3zYQfRBbmqq/3Yrm1jn/b+SM2rmpqMvek Jd4g== MIME-Version: 1.0 Received: by 10.68.137.41 with SMTP id qf9mr44981185pbb.103.1351709417366; Wed, 31 Oct 2012 11:50:17 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Wed, 31 Oct 2012 11:50:17 -0700 (PDT) In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> Date: Wed, 31 Oct 2012 11:50:17 -0700 X-Google-Sender-Auth: 0OQYUSoNmcQEDu6ptPaJVmDQVqY Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Adrian Chadd To: attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:50:18 -0000 On 31 October 2012 11:33, Attilio Rao wrote: >> Doesn't this padding to cache line size only help x86 processors in an >> SMP kernel? I was expecting to see some #ifdef SMP so that we don't pay >> a big price for no gain in small-memory ARM systems and such. But maybe >> I'm misunderstanding the reason for the padding. > > I didn't want to do this because this would be meaning that SMP option > may become a completely killer for modules/kernel ABI compatibility. Right, but you didn't make it configurable for us embedded peeps who still care about memory usage. > Also, if you look at the modified list of locks I don't think they > should be too much, I hardly believe ARM UP is going to hurt that much > from loosing some padding in tdq structures or callout. There's a few million more embedded MIPS boards out there with 16mb/32mb of RAM than target PCs for FreeBSD. Would you mind making the padding part configurable and just default it to "do the padding" ? That way for the atheros MIPS builds I can turn it off and save on the memory overhead. Thanks, Adrian From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 18:57:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A0B52EAD; Wed, 31 Oct 2012 18:57:40 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 744288FC0A; Wed, 31 Oct 2012 18:57:39 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so1647081lag.13 for ; Wed, 31 Oct 2012 11:57:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=AvJorK+HfkdLFp7+4uuuoHQjfHdKjLDumnPEvXM2dLw=; b=vi0uY7uzPtgKYxkW7zSaZQjIMYToQhgwM/oGSE2zri/dvrZ38qIgjjdcvgMbPuQMgs D3YyIkmayDGrhLKrOQIQt4QitjOb7SWLpRUamWrCjP9j26wUJheBPs/wRNMedCu2wLfH rvGohF/gdPAuJMCJv91TfKHSAmQjS1cnn+St3hpEbZTcZtLcGx5OokxNlmoXr9JvsG71 PxMtFFeX8w2+JbKFJ/R9gTqqlphy8JYnej62L/f0uJ+aevxtITZW8nBCf7CCrbTw9k3F WTphs9VclLav0gxAenHctr2bBF4tswCC7SMe/H+DZgUY1z7omKmtJ7hF3Vfyh4HOm2oi xorA== MIME-Version: 1.0 Received: by 10.152.104.50 with SMTP id gb18mr35273324lab.9.1351709857556; Wed, 31 Oct 2012 11:57:37 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 31 Oct 2012 11:57:37 -0700 (PDT) In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> Date: Wed, 31 Oct 2012 18:57:37 +0000 X-Google-Sender-Auth: 55jo7ggJrKjZiPtoA_K-eNeXDJY Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Adrian Chadd Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 18:57:40 -0000 On 10/31/12, Adrian Chadd wrote: > On 31 October 2012 11:33, Attilio Rao wrote: > >>> Doesn't this padding to cache line size only help x86 processors in an >>> SMP kernel? I was expecting to see some #ifdef SMP so that we don't pay >>> a big price for no gain in small-memory ARM systems and such. But maybe >>> I'm misunderstanding the reason for the padding. >> >> I didn't want to do this because this would be meaning that SMP option >> may become a completely killer for modules/kernel ABI compatibility. > > Right, but you didn't make it configurable for us embedded peeps who > still care about memory usage. How is this possible without breaking the module/kernel ABI? >> Also, if you look at the modified list of locks I don't think they >> should be too much, I hardly believe ARM UP is going to hurt that much >> from loosing some padding in tdq structures or callout. > > There's a few million more embedded MIPS boards out there with > 16mb/32mb of RAM than target PCs for FreeBSD. > > Would you mind making the padding part configurable and just default > it to "do the padding" ? > That way for the atheros MIPS builds I can turn it off and save on the > memory overhead. This means that we will need to put a black cross on the compatibility between modules and kernel very likely. Changable size locks based on the options are a very bad idea and if they change the size based on the availability of SMP or a main option like that (ie. differently from debugging options) are even a worse idea. Besides the mtx_padalign mutexes should be not be used often in general, that's why I ask people to justify their introduction every time. And as last point, please consider that right now the locks converted are the same that were before, so there is no loss for mips or similar. All that assuming you can actually prove a real performance loss even in the new cases. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 19:30:35 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AC31A05; Wed, 31 Oct 2012 19:30:35 +0000 (UTC) (envelope-from peter@rulingia.com) Received: from vps.rulingia.com (host-122-100-2-194.octopus.com.au [122.100.2.194]) by mx1.freebsd.org (Postfix) with ESMTP id ACE858FC14; Wed, 31 Oct 2012 19:30:34 +0000 (UTC) Received: from server.rulingia.com (c220-239-241-202.belrs5.nsw.optusnet.com.au [220.239.241.202]) by vps.rulingia.com (8.14.5/8.14.5) with ESMTP id q9VJUQKK036713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 1 Nov 2012 06:30:27 +1100 (EST) (envelope-from peter@rulingia.com) X-Bogosity: Ham, spamicity=0.000000 Received: from server.rulingia.com (localhost.rulingia.com [127.0.0.1]) by server.rulingia.com (8.14.5/8.14.5) with ESMTP id q9VJUKVO022884 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 1 Nov 2012 06:30:20 +1100 (EST) (envelope-from peter@server.rulingia.com) Received: (from peter@localhost) by server.rulingia.com (8.14.5/8.14.5/Submit) id q9VJUKWW022883; Thu, 1 Nov 2012 06:30:20 +1100 (EST) (envelope-from peter) Date: Thu, 1 Nov 2012 06:30:20 +1100 From: Peter Jeremy To: Attilio Rao Subject: Re: svn commit: r242402 - in head/sys: kern vm Message-ID: <20121031193020.GJ3309@server.rulingia.com> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="wq9mPyueHGvFACwf" Content-Disposition: inline In-Reply-To: X-PGP-Key: http://www.rulingia.com/keys/peter.pgp User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Adrian Chadd , src-committers@FreeBSD.org, svn-src-all@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 19:30:35 -0000 --wq9mPyueHGvFACwf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2012-Oct-31 18:57:37 +0000, Attilio Rao wrote: >On 10/31/12, Adrian Chadd wrote: >> Right, but you didn't make it configurable for us embedded peeps who >> still care about memory usage. > >How is this possible without breaking the module/kernel ABI? Memory usage may override ABI compatibility in an embedded environment. >All that assuming you can actually prove a real performance loss even >in the new cases. The issue with padding on embedded systems is memory utilisation rather than performance. --=20 Peter Jeremy --wq9mPyueHGvFACwf Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCRfEwACgkQ/opHv/APuIdWigCaA2bGXHHIi1Dli5ZyWD3Habkn D9MAn1kvXN8/B4Q7McrNUSsSjBMakfYU =Q3FW -----END PGP SIGNATURE----- --wq9mPyueHGvFACwf-- From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 19:40:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 27124E2D; Wed, 31 Oct 2012 19:40:42 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 1DB428FC08; Wed, 31 Oct 2012 19:40:28 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id q9VJeSC3013412; Wed, 31 Oct 2012 13:40:28 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id q9VJePej006844; Wed, 31 Oct 2012 13:40:26 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Ian Lepore To: Peter Jeremy In-Reply-To: <20121031193020.GJ3309@server.rulingia.com> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> Content-Type: text/plain; charset="us-ascii" Date: Wed, 31 Oct 2012 13:40:25 -0600 Message-ID: <1351712425.1120.109.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: Attilio Rao , svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 19:40:42 -0000 On Thu, 2012-11-01 at 06:30 +1100, Peter Jeremy wrote: > On 2012-Oct-31 18:57:37 +0000, Attilio Rao wrote: > >On 10/31/12, Adrian Chadd wrote: > >> Right, but you didn't make it configurable for us embedded peeps who > >> still care about memory usage. > > > >How is this possible without breaking the module/kernel ABI? > > Memory usage may override ABI compatibility in an embedded environment. > > >All that assuming you can actually prove a real performance loss even > >in the new cases. > > The issue with padding on embedded systems is memory utilisation rather > than performance. > There are potential performance hits too, in that embedded systems tend to have tiny caches (16K L1 with no L2, that sort of thing), so purposely padding things so that large parts of a cache line aren't used for anything wastes a scarce resource. That said, I think a point Attilio was trying to make is that we won't see a large hit because this doesn't affect a large number of mutex instances. I'm willing to accept his expert advice on that, not in small part because I'm not sure how I'd go about disputing it. :) I'm really busy with $work right now, but things should calm down in a couple weeks, and I'd be willing to do some measurements on arm systems then, if I can get some help on how to generate useful data. -- Ian From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 19:42:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 730F2FAE; Wed, 31 Oct 2012 19:42:41 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-vb0-f54.google.com (mail-vb0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id B37BB8FC12; Wed, 31 Oct 2012 19:42:40 +0000 (UTC) Received: by mail-vb0-f54.google.com with SMTP id l1so2499235vba.13 for ; Wed, 31 Oct 2012 12:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=7OGLfspj0eqogegdBQ/jwKq4W1Fqe/k96yuraK1IcyE=; b=OPq/JZ4OHCN8papvYcIfKLSYDb2ruP+ZbKHpAJdHgc/y6Lohui9+lm4JbsPsJIPJAU uvIu+USjAm9NZFfoqOvNgbxhi9YQ07ojdsOvran/Ot1xeXy5MH3Wj7A4ILzLuUC1j0gV h/NtTCWYBvFcHGX53C4y5ZKOjSN1aCk5J1nimYcmoCrcaxq6JAvxmThw8kbS3ypEYRZ2 o8nt5vnt+aq+TZowYuc5ogMtUyt/9777GEDJe4VYbDj/+d6D669ONao4mTP/58IsxIcZ z7hF7zSeAwEKvUoY744ZkB4/OUdhDz3OAMxntOctmahCTYX83GUZu/j4NtCKZq5/i/8U oRnA== MIME-Version: 1.0 Received: by 10.221.11.15 with SMTP id pc15mr40735674vcb.70.1351712559616; Wed, 31 Oct 2012 12:42:39 -0700 (PDT) Received: by 10.58.225.2 with HTTP; Wed, 31 Oct 2012 12:42:39 -0700 (PDT) In-Reply-To: <20121031193020.GJ3309@server.rulingia.com> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> Date: Wed, 31 Oct 2012 12:42:39 -0700 Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Jim Harris To: Peter Jeremy Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Attilio Rao , svn-src-head@freebsd.org, Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 19:42:41 -0000 On Wed, Oct 31, 2012 at 12:30 PM, Peter Jeremy wrote: > On 2012-Oct-31 18:57:37 +0000, Attilio Rao wrote: > >On 10/31/12, Adrian Chadd wrote: > >> Right, but you didn't make it configurable for us embedded peeps who > >> still care about memory usage. > > > >How is this possible without breaking the module/kernel ABI? > > Memory usage may override ABI compatibility in an embedded environment. > > >All that assuming you can actually prove a real performance loss even > >in the new cases. > > The issue with padding on embedded systems is memory utilisation rather > than performance. Agree that for embedded systems, we need to be careful about proliferating this throughout the entire kernel. But for the usages thus far, Attilio is right that they should not affect UP. The ULE and callout changes made very recently are on per-CPU data structures, so for UP, that's padding just one mutex each. For the vpglock->mtx_padalign conversion, this is functionally a nop. vpglock was already doing this padding. -Jim From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 20:31:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9893AED1 for ; Wed, 31 Oct 2012 20:31:53 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id EC1788FC14 for ; Wed, 31 Oct 2012 20:31:52 +0000 (UTC) Received: (qmail 75289 invoked from network); 31 Oct 2012 22:08:16 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2012 22:08:16 -0000 Message-ID: <50918AAD.2090906@freebsd.org> Date: Wed, 31 Oct 2012 21:31:41 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r242402 - in head/sys: kern vm References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> <1351712425.1120.109.camel@revolution.hippie.lan> In-Reply-To: <1351712425.1120.109.camel@revolution.hippie.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , svn-src-head@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 20:31:53 -0000 On 31.10.2012 20:40, Ian Lepore wrote: > On Thu, 2012-11-01 at 06:30 +1100, Peter Jeremy wrote: >> On 2012-Oct-31 18:57:37 +0000, Attilio Rao wrote: >>> On 10/31/12, Adrian Chadd wrote: >>>> Right, but you didn't make it configurable for us embedded peeps who >>>> still care about memory usage. >>> >>> How is this possible without breaking the module/kernel ABI? >> >> Memory usage may override ABI compatibility in an embedded environment. >> >>> All that assuming you can actually prove a real performance loss even >>> in the new cases. >> >> The issue with padding on embedded systems is memory utilisation rather >> than performance. >> > > There are potential performance hits too, in that embedded systems tend > to have tiny caches (16K L1 with no L2, that sort of thing), so > purposely padding things so that large parts of a cache line aren't used > for anything wastes a scarce resource. You can define CACHE_LINE_SIZE to 0 on those platforms. Or to make it even more granular there could be a CACHE_LINE_SIZE_LOCKS that is used for lock padding. -- Andre > That said, I think a point Attilio was trying to make is that we won't > see a large hit because this doesn't affect a large number of mutex > instances. I'm willing to accept his expert advice on that, not in > small part because I'm not sure how I'd go about disputing it. :) > > I'm really busy with $work right now, but things should calm down in a > couple weeks, and I'd be willing to do some measurements on arm systems > then, if I can get some help on how to generate useful data. > > -- Ian > > > > From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 20:36:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1809E107; Wed, 31 Oct 2012 20:36:46 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B56798FC0A; Wed, 31 Oct 2012 20:36:45 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so1335870pbb.13 for ; Wed, 31 Oct 2012 13:36:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BabZ+rEDdIGovlqR6LhjlcltpTJYXLPne1orXtB06lk=; b=aiKXT+pbnyeU2Mw7+xMwOuN7hBv8P5Tamt7+/o+EX2hPRvEnRcIhq8ybEfEBlBauO+ ITkZRKjx7Ljw1qDxXnU8MBdaHqgnzDqn9OGXbJhf0r35PJetg9/z3qsT48Uf3vgif25L Z/zCzD+IiAtu//3u+dRJvwbMmx+p30Cen46mE1rVHpQSnqmM4JkUvkIE4dKb19FDiBD6 Xs2BblHFcIwW/3lShmiP7r472egJk1lp0JSFII1Edr9116EjiBifvubunwejz25/g9Er ydMKPe/iF7+1ggrFBVIg69VmaR7brfIGPzwBvzJoiB/aswV0bxiPAZyaf+NRZTgHHLw4 aUsw== MIME-Version: 1.0 Received: by 10.66.72.136 with SMTP id d8mr58047576pav.4.1351715805113; Wed, 31 Oct 2012 13:36:45 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Wed, 31 Oct 2012 13:36:45 -0700 (PDT) In-Reply-To: <50918AAD.2090906@freebsd.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> <1351712425.1120.109.camel@revolution.hippie.lan> <50918AAD.2090906@freebsd.org> Date: Wed, 31 Oct 2012 13:36:45 -0700 X-Google-Sender-Auth: kztoew8TaH-bxnY3fhHP0VcDmPo Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Adrian Chadd To: Andre Oppermann Content-Type: text/plain; charset=ISO-8859-1 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, Attilio Rao , svn-src-head@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 20:36:46 -0000 We definitely can't define CACHE_LINE_SIZE=0 on those platforms, as there are other reasons you need to know the cache line size. :) Adrian From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 20:54:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCABDC8F for ; Wed, 31 Oct 2012 20:54:10 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2D0388FC12 for ; Wed, 31 Oct 2012 20:54:09 +0000 (UTC) Received: (qmail 75406 invoked from network); 31 Oct 2012 22:30:39 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 31 Oct 2012 22:30:39 -0000 Message-ID: <50918FEC.3070602@freebsd.org> Date: Wed, 31 Oct 2012 21:54:04 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r242402 - in head/sys: kern vm References: <201210311807.q9VI7IcX000993@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 20:54:10 -0000 On 31.10.2012 19:10, Attilio Rao wrote: > On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: >> Author: attilio >> Date: Wed Oct 31 18:07:18 2012 >> New Revision: 242402 >> URL: http://svn.freebsd.org/changeset/base/242402 >> >> Log: >> Rework the known mutexes to benefit about staying on their own >> cache line in order to avoid manual frobbing but using >> struct mtx_padalign. > > Interested developers can now dig and look for other mutexes to > convert and just do it. > Please, however, try to enclose a description about the benchmark > which lead you believe the necessity to pad the mutex and possibly > some numbers, in particular when the lock belongs to structures or the > ABI itself. > > Next steps involve porting the same mtx(9) changes to rwlock(9) and > port pvh global pmap lock to rwlock_padalign. I'd say for an rwlock you can make it unconditional. The very purpose of it is to be aquired by multiple CPU's causing cache line dirtying for every concurrent reader. Rwlocks are only ever used because multiple concurrent readers are expected. -- Andre From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 20:58:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 04588E27; Wed, 31 Oct 2012 20:58:25 +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 E14248FC0C; Wed, 31 Oct 2012 20:58:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VKwOBm029395; Wed, 31 Oct 2012 20:58:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VKwO3O029393; Wed, 31 Oct 2012 20:58:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312058.q9VKwO3O029393@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 20:58:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242406 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 20:58:25 -0000 Author: adrian Date: Wed Oct 31 20:58:24 2012 New Revision: 242406 URL: http://svn.freebsd.org/changeset/base/242406 Log: Add the emulation PCI device id - these days, 0xabcd shows up all over the internet as "AR9380 and later which didn't get its PCI ID written in at power-on", so it's hardly an unknown constant. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah_devid.h Modified: head/sys/dev/ath/ath_hal/ah_devid.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_devid.h Wed Oct 31 20:51:41 2012 (r242405) +++ head/sys/dev/ath/ath_hal/ah_devid.h Wed Oct 31 20:58:24 2012 (r242406) @@ -85,6 +85,7 @@ /* AR9300 */ #define AR9300_DEVID_AR9380_PCIE 0x0030 +#define AR9300_DEVID_EMU_PCIE 0xabcd #define AR9300_DEVID_AR9340 0x0031 #define AR9300_DEVID_AR9485_PCIE 0x0032 #define AR9300_DEVID_AR9580_PCIE 0x0033 From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 21:00:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5672F9E; Wed, 31 Oct 2012 21:00:01 +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 BC7DC8FC0A; Wed, 31 Oct 2012 21:00:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VL01SU029713; Wed, 31 Oct 2012 21:00:01 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VL01Qo029709; Wed, 31 Oct 2012 21:00:01 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312100.q9VL01Qo029709@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 21:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242407 - head/sys/dev/ath/ath_hal X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 21:00:01 -0000 Author: adrian Date: Wed Oct 31 21:00:01 2012 New Revision: 242407 URL: http://svn.freebsd.org/changeset/base/242407 Log: Add in the last random assortment of missing bits for the AR9380 HAL. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ah.h head/sys/dev/ath/ath_hal/ah_internal.h Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Wed Oct 31 20:58:24 2012 (r242406) +++ head/sys/dev/ath/ath_hal/ah.h Wed Oct 31 21:00:01 2012 (r242407) @@ -119,7 +119,6 @@ typedef enum { HAL_CAP_NUM_GPIO_PINS = 36, /* number of GPIO pins */ HAL_CAP_CST = 38, /* hardware supports carrier sense timeout */ - HAL_CAP_RIFS_RX = 39, HAL_CAP_RIFS_TX = 40, HAL_CAP_FORCE_PPM = 41, @@ -156,7 +155,6 @@ typedef enum { HAL_CAP_RXFIFODEPTH = 80, /* Receive hardware FIFO depth */ HAL_CAP_RXBUFSIZE = 81, /* Receive Buffer Length */ HAL_CAP_NUM_MR_RETRIES = 82, /* limit on multirate retries */ - HAL_CAP_OL_PWRCTRL = 84, /* Open loop TX power control */ HAL_CAP_BB_PANIC_WATCHDOG = 92, @@ -229,6 +227,11 @@ typedef enum { #define HAL_NUM_TX_QUEUES 10 /* max possible # of queues */ +/* + * Receive queue types. These are used to tag + * each transmit queue in the hardware and to identify a set + * of transmit queues for operations such as start/stop dma. + */ typedef enum { HAL_RX_QUEUE_HP = 0, /* high priority recv queue */ HAL_RX_QUEUE_LP = 1, /* low priority recv queue */ @@ -417,6 +420,23 @@ typedef enum { } HAL_POWER_MODE; /* + * Enterprise mode flags + */ +#define AH_ENT_DUAL_BAND_DISABLE 0x00000001 +#define AH_ENT_CHAIN2_DISABLE 0x00000002 +#define AH_ENT_5MHZ_DISABLE 0x00000004 +#define AH_ENT_10MHZ_DISABLE 0x00000008 +#define AH_ENT_49GHZ_DISABLE 0x00000010 +#define AH_ENT_LOOPBACK_DISABLE 0x00000020 +#define AH_ENT_TPC_PERF_DISABLE 0x00000040 +#define AH_ENT_MIN_PKT_SIZE_DISABLE 0x00000080 +#define AH_ENT_SPECTRAL_PRECISION 0x00000300 +#define AH_ENT_SPECTRAL_PRECISION_S 8 +#define AH_ENT_RTSCTS_DELIM_WAR 0x00010000 + +#define AH_FIRST_DESC_NDELIMS 60 + +/* * NOTE WELL: * These are mapped to take advantage of the common locations for many of * the bits on all of the currently supported MAC chips. This is to make @@ -455,7 +475,7 @@ typedef enum { HAL_INT_TSFOOR = 0x04000000, /* Non-common mapping */ HAL_INT_TBTT = 0x08000000, /* Non-common mapping */ /* Atheros ref driver has a generic timer interrupt now..*/ - HAL_INT_GENTIMER = 0x08000000, /* Non-common mapping */ + HAL_INT_GENTIMER = 0x08000000, /* Non-common mapping */ HAL_INT_CST = 0x10000000, /* Non-common mapping */ HAL_INT_GTT = 0x20000000, /* Non-common mapping */ HAL_INT_FATAL = 0x40000000, /* Non-common mapping */ @@ -507,6 +527,33 @@ typedef enum { HAL_INT_THRESHOLD } HAL_INT_MITIGATION; +/* XXX this is duplicate information! */ +typedef struct { + u_int32_t cyclecnt_diff; /* delta cycle count */ + u_int32_t rxclr_cnt; /* rx clear count */ + u_int32_t txframecnt_diff; /* delta tx frame count */ + u_int32_t rxframecnt_diff; /* delta rx frame count */ + u_int32_t listen_time; /* listen time in msec - time for which ch is free */ + u_int32_t ofdmphyerr_cnt; /* OFDM err count since last reset */ + u_int32_t cckphyerr_cnt; /* CCK err count since last reset */ + u_int32_t ofdmphyerrcnt_diff; /* delta OFDM Phy Error Count */ + HAL_BOOL valid; /* if the stats are valid*/ +} HAL_ANISTATS; + +typedef struct { + u_int8_t txctl_offset; + u_int8_t txctl_numwords; + u_int8_t txstatus_offset; + u_int8_t txstatus_numwords; + + u_int8_t rxctl_offset; + u_int8_t rxctl_numwords; + u_int8_t rxstatus_offset; + u_int8_t rxstatus_numwords; + + u_int8_t macRevision; +} HAL_DESC_INFO; + typedef enum { HAL_GPIO_OUTPUT_MUX_AS_OUTPUT = 0, HAL_GPIO_OUTPUT_MUX_PCIE_ATTENTION_LED = 1, @@ -545,6 +592,17 @@ typedef struct { uint32_t beacons; } HAL_MIB_STATS; +/* + * These bits represent what's in ah_currentRDext. + */ +typedef enum { + REG_EXT_FCC_MIDBAND = 0, + REG_EXT_JAPAN_MIDBAND = 1, + REG_EXT_FCC_DFS_HT40 = 2, + REG_EXT_JAPAN_NONDFS_HT40 = 3, + REG_EXT_JAPAN_DFS_HT40 = 4 +} REG_EXT_BITMAP; + enum { HAL_MODE_11A = 0x001, /* 11a channels */ HAL_MODE_TURBO = 0x002, /* 11a turbo-only channels */ @@ -613,7 +671,7 @@ typedef struct { #define HAL_RATESERIES_2040 0x0002 /* use ext channel for series */ #define HAL_RATESERIES_HALFGI 0x0004 /* use half-gi for series */ #define HAL_RATESERIES_STBC 0x0008 /* use STBC for series */ - u_int tx_power_cap; + u_int tx_power_cap; /* in 1/2 dBm units XXX TODO */ } HAL_11N_RATE_SERIES; typedef enum { @@ -637,6 +695,11 @@ typedef enum { HAL_RX_CLEAR_EXT_LOW = 0x2, /* force extension channel to appear busy */ } HAL_HT_RXCLEAR; +typedef enum { + HAL_FREQ_BAND_5GHZ = 0, + HAL_FREQ_BAND_2GHZ = 1, +} HAL_FREQ_BAND; + /* * Antenna switch control. By default antenna selection * enables multiple (2) antenna use. To force use of the @@ -665,6 +728,18 @@ typedef struct { uint8_t kv_txmic[8]; /* TKIP TX MIC key (optional) */ } HAL_KEYVAL; +/* + * This is the TX descriptor field which marks the key padding requirement. + * The naming is unfortunately unclear. + */ +#define AH_KEYTYPE_MASK 0x0F +typedef enum { + HAL_KEY_TYPE_CLEAR, + HAL_KEY_TYPE_WEP, + HAL_KEY_TYPE_AES, + HAL_KEY_TYPE_TKIP, +} HAL_KEY_TYPE; + typedef enum { HAL_CIPHER_WEP = 0, HAL_CIPHER_AES_OCB = 1, @@ -694,8 +769,10 @@ typedef struct { uint32_t bs_nextdtim; /* next DTIM in TU */ uint32_t bs_intval; /* beacon interval+flags */ #define HAL_BEACON_PERIOD 0x0000ffff /* beacon interval period */ +#define HAL_BEACON_PERIOD_TU8 0x0007ffff /* beacon interval, tu/8 */ #define HAL_BEACON_ENA 0x00800000 /* beacon xmit enable */ #define HAL_BEACON_RESET_TSF 0x01000000 /* clear TSF */ +#define HAL_TSFOOR_THRESHOLD 0x00004240 /* TSF OOR thresh (16k uS) */ uint32_t bs_dtimperiod; uint16_t bs_cfpperiod; /* CFP period in TU */ uint16_t bs_cfpmaxduration; /* max CFP duration in TU */ @@ -703,6 +780,7 @@ typedef struct { uint16_t bs_timoffset; /* byte offset to TIM bitmap */ uint16_t bs_bmissthreshold; /* beacon miss threshold */ uint32_t bs_sleepduration; /* max sleep duration */ + uint32_t bs_tsfoor_threshold; /* TSF out of range threshold */ } HAL_BEACON_STATE; /* @@ -733,6 +811,7 @@ typedef struct { #define HAL_RSSI_EP_MULTIPLIER (1<<7) /* pow2 to optimize out * and / */ + struct ath_desc; struct ath_tx_status; struct ath_rx_status; @@ -790,6 +869,8 @@ typedef enum { HAL_ANI_MRC_CCK = 8, } HAL_ANI_CMD; +#define HAL_ANI_ALL 0xffffffff + /* * This is the layout of the ANI INTMIT capability. * @@ -805,7 +886,6 @@ typedef enum { HAL_CAP_INTMIT_SPUR_IMMUNITY_LEVEL = 6 } HAL_CAP_INTMIT_CMD; -/* DFS defines */ typedef struct { int32_t pe_firpwr; /* FIR pwr out threshold */ int32_t pe_rrssi; /* Radar rssi thresh */ @@ -845,10 +925,10 @@ typedef enum { HAL_DFS_MKK4_DOMAIN = 3, /* Japan dfs domain */ } HAL_DFS_DOMAIN; + /* * MFP decryption options for initializing the MAC. */ - typedef enum { HAL_MFP_QOSDATA = 0, /* Decrypt MFP frames like QoS data frames. All chips before Merlin. */ HAL_MFP_PASSTHRU, /* Don't decrypt MFP frames at all. Passthrough */ @@ -903,6 +983,20 @@ struct hal_dfs_event { typedef struct hal_dfs_event HAL_DFS_EVENT; /* + * Generic Timer domain + */ +typedef enum { + HAL_GEN_TIMER_TSF = 0, + HAL_GEN_TIMER_TSF2, + HAL_GEN_TIMER_TSF_ANY +} HAL_GEN_TIMER_DOMAIN; + +typedef enum { + HAL_RESET_NONE = 0x0, + HAL_RESET_BBPANIC = 0x1, +} HAL_RESET_TYPE; + +/* * BT Co-existence definitions */ typedef enum { @@ -1035,6 +1129,34 @@ typedef struct { HAL_BOOL bt_hold_rxclear; } HAL_BT_COEX_CONFIG; +struct hal_bb_panic_info { + u_int32_t status; + u_int32_t tsf; + u_int32_t phy_panic_wd_ctl1; + u_int32_t phy_panic_wd_ctl2; + u_int32_t phy_gen_ctrl; + u_int32_t rxc_pcnt; + u_int32_t rxf_pcnt; + u_int32_t txf_pcnt; + u_int32_t cycles; + u_int32_t wd; + u_int32_t det; + u_int32_t rdar; + u_int32_t r_odfm; + u_int32_t r_cck; + u_int32_t t_odfm; + u_int32_t t_cck; + u_int32_t agc; + u_int32_t src; +}; + +/* Serialize Register Access Mode */ +typedef enum { + SER_REG_MODE_OFF = 0, + SER_REG_MODE_ON = 1, + SER_REG_MODE_AUTO = 2, +} SER_REG_MODE; + typedef struct { int ah_debug; /* only used if AH_DEBUG is defined */ @@ -1046,6 +1168,44 @@ typedef struct int ah_additional_swba_backoff; /* in TU's */ int ah_force_full_reset; /* force full chip reset rather then warm reset */ int ah_serialise_reg_war; /* force serialisation of register IO */ + + /* XXX these don't belong here, they're just for the ar9300 HAL port effort */ + int ath_hal_desc_tpc; /* Per-packet TPC */ + int ath_hal_sta_update_tx_pwr_enable; /* GreenTX */ + int ath_hal_sta_update_tx_pwr_enable_S1; /* GreenTX */ + int ath_hal_sta_update_tx_pwr_enable_S2; /* GreenTX */ + int ath_hal_sta_update_tx_pwr_enable_S3; /* GreenTX */ + + /* I'm not sure what the default values for these should be */ + int ath_hal_pll_pwr_save; + int ath_hal_pcie_power_save_enable; + int ath_hal_intr_mitigation_rx; + int ath_hal_intr_mitigation_tx; + + int ath_hal_pcie_clock_req; +#define AR_PCIE_PLL_PWRSAVE_CONTROL (1<<0) +#define AR_PCIE_PLL_PWRSAVE_ON_D3 (1<<1) +#define AR_PCIE_PLL_PWRSAVE_ON_D0 (1<<2) + + int ath_hal_pcie_waen; + int ath_hal_pcie_ser_des_write; + + /* these are important for correct AR9300 behaviour */ + int ath_hal_ht_enable; /* needs to be enabled for AR9300 HT */ + int ath_hal_diversity_control; + int ath_hal_antenna_switch_swap; + int ath_hal_ext_lna_ctl_gpio; + int ath_hal_spur_mode; + int ath_hal_6mb_ack; /* should set this to 1 for 11a/11na? */ + int ath_hal_enable_msi; /* enable MSI interrupts (needed?) */ + int ath_hal_beacon_filter_interval; /* ok to be 0 for now? */ + + /* For now, set this to 0 - net80211 needs to know about hardware MFP support */ + int ath_hal_mfp_support; + + int ath_hal_enable_ani; /* should set this.. */ + int ath_hal_cwm_ignore_ext_cca; + int ath_hal_show_bb_panic; } HAL_OPS_CONFIG; /* @@ -1298,12 +1458,23 @@ struct ath_hal { void __ahdecl(*ah_set11nRateScenario)(struct ath_hal *, struct ath_desc *, u_int, u_int, HAL_11N_RATE_SERIES [], u_int, u_int); + + /* + * The next 4 (set11ntxdesc -> set11naggrlast) are specific + * to the EDMA HAL. Descriptors are chained together by + * using filltxdesc (not ChainTxDesc) and then setting the + * aggregate flags appropriately using first/middle/last. + */ + void __ahdecl(*ah_set11nTxDesc)(struct ath_hal *, + void *, u_int, HAL_PKT_TYPE, u_int, u_int, + u_int); void __ahdecl(*ah_set11nAggrFirst)(struct ath_hal *, struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *, struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, struct ath_desc *); + void __ahdecl(*ah_clr11nAggr)(struct ath_hal *, struct ath_desc *); void __ahdecl(*ah_set11nBurstDuration)(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ah_internal.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah_internal.h Wed Oct 31 20:58:24 2012 (r242406) +++ head/sys/dev/ath/ath_hal/ah_internal.h Wed Oct 31 21:00:01 2012 (r242407) @@ -136,6 +136,41 @@ struct ath_hal_rf *ath_hal_rfprobe(struc #define AH_MAXCHAN 96 #endif +#define HAL_NF_CAL_HIST_LEN_FULL 5 +#define HAL_NF_CAL_HIST_LEN_SMALL 1 +#define HAL_NUM_NF_READINGS 6 /* 3 chains * (ctl + ext) */ +#define HAL_NF_LOAD_DELAY 1000 + +/* + * PER_CHAN doesn't work for now, as it looks like the device layer + * has to pre-populate the per-channel list with nominal values. + */ +//#define ATH_NF_PER_CHAN 1 + +typedef struct { + u_int8_t curr_index; + int8_t invalidNFcount; /* TO DO: REMOVE THIS! */ + int16_t priv_nf[HAL_NUM_NF_READINGS]; +} HAL_NFCAL_BASE; + +typedef struct { + HAL_NFCAL_BASE base; + int16_t nf_cal_buffer[HAL_NF_CAL_HIST_LEN_FULL][HAL_NUM_NF_READINGS]; +} HAL_NFCAL_HIST_FULL; + +typedef struct { + HAL_NFCAL_BASE base; + int16_t nf_cal_buffer[HAL_NF_CAL_HIST_LEN_SMALL][HAL_NUM_NF_READINGS]; +} HAL_NFCAL_HIST_SMALL; + +#ifdef ATH_NF_PER_CHAN +typedef HAL_NFCAL_HIST_FULL HAL_CHAN_NFCAL_HIST; +#define AH_HOME_CHAN_NFCAL_HIST(ah, ichan) (ichan ? &ichan->nf_cal_hist: NULL) +#else +typedef HAL_NFCAL_HIST_SMALL HAL_CHAN_NFCAL_HIST; +#define AH_HOME_CHAN_NFCAL_HIST(ah, ichan) (&AH_PRIVATE(ah)->nf_cal_hist) +#endif /* ATH_NF_PER_CHAN */ + /* * Internal per-channel state. These are found * using ic_devdata in the ieee80211_channel. @@ -157,6 +192,12 @@ typedef struct { int16_t noiseFloorExt[AH_MAX_CHAINS]; #endif /* AH_SUPPORT_AR5416 */ uint16_t mainSpur; /* cached spur value for this channel */ + + /*XXX TODO: make these part of privFlags */ + uint8_t paprd_done:1, /* 1: PAPRD DONE, 0: PAPRD Cal not done */ + paprd_table_write_done:1; /* 1: DONE, 0: Cal data write not done */ + int one_time_cals_done; + HAL_CHAN_NFCAL_HIST nf_cal_hist; } HAL_CHANNEL_INTERNAL; /* channel requires noise floor check */ @@ -253,13 +294,21 @@ typedef struct { uint8_t halTxStreams; uint8_t halRxStreams; HAL_MFP_OPT_T halMfpSupport; + + /* AR9300 HAL porting capabilities */ + int hal_paprd_enabled; + int hal_pcie_lcr_offset; + int hal_pcie_lcr_extsync_en; int halNumTxMaps; int halTxDescLen; int halTxStatusLen; int halRxStatusLen; int halRxHpFifoDepth; int halRxLpFifoDepth; + uint32_t halRegCap; /* XXX needed? */ int halNumMRRetries; + int hal_ani_poll_interval; + int hal_channel_switch_time_usec; } HAL_CAPABILITIES; struct regDomain; @@ -364,6 +413,10 @@ struct ath_hal_private { */ uint32_t ah_fatalState[6]; /* AR_ISR+shadow regs */ int ah_rxornIsFatal; /* how to treat HAL_INT_RXORN */ + +#ifndef ATH_NF_PER_CHAN + HAL_NFCAL_HIST_FULL nf_cal_hist; +#endif /* ! ATH_NF_PER_CHAN */ }; #define AH_PRIVATE(_ah) ((struct ath_hal_private *)(_ah)) @@ -524,6 +577,14 @@ isBigEndian(void) OS_REG_WRITE(_a, _r, OS_REG_READ(_a, _r) &~ (_f)) #define OS_REG_IS_BIT_SET(_a, _r, _f) \ ((OS_REG_READ(_a, _r) & (_f)) != 0) +#define OS_REG_RMW_FIELD_ALT(_a, _r, _f, _v) \ + OS_REG_WRITE(_a, _r, \ + (OS_REG_READ(_a, _r) &~(_f<<_f##_S)) | \ + (((_v) << _f##_S) & (_f<<_f##_S))) +#define OS_REG_READ_FIELD(_a, _r, _f) \ + (((OS_REG_READ(_a, _r) & _f) >> _f##_S)) +#define OS_REG_READ_FIELD_ALT(_a, _r, _f) \ + ((OS_REG_READ(_a, _r) >> (_f##_S))&(_f)) /* Analog register writes may require a delay between each one (eg Merlin?) */ #define OS_A_REG_RMW_FIELD(_a, _r, _f, _v) \ @@ -732,6 +793,17 @@ enum { | HAL_MAC_HANG_UNKNOWN, }; +/* Merge these with above */ +typedef enum hal_hw_hangs { + HAL_DFS_BB_HANG_WAR = 0x1, + HAL_RIFS_BB_HANG_WAR = 0x2, + HAL_RX_STUCK_LOW_BB_HANG_WAR = 0x4, + HAL_MAC_HANG_WAR = 0x8, + HAL_PHYRESTART_CLR_WAR = 0x10, + HAL_MAC_HANG_DETECTED = 0x40000000, + HAL_BB_HANG_DETECTED = 0x80000000 +} hal_hw_hangs_t; + /* * Device revision information. */ From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 21:03:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 705D82B5; Wed, 31 Oct 2012 21:03:56 +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 579AC8FC08; Wed, 31 Oct 2012 21:03:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VL3uW5030381; Wed, 31 Oct 2012 21:03:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VL3ucb030375; Wed, 31 Oct 2012 21:03:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312103.q9VL3ucb030375@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 21:03:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242408 - in head/sys/dev/ath/ath_hal: ar5212 ar5416 ar9002 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 21:03:56 -0000 Author: adrian Date: Wed Oct 31 21:03:55 2012 New Revision: 242408 URL: http://svn.freebsd.org/changeset/base/242408 Log: HAL updates! * Add some more ANI spur immunity levels. * For AR5111 radios attached to an AR5212, limit the 5GHz channels that are available. A later revision of the AR5111 supports the 4.9GHz PSB channels but right now there's no check in place for the radio revision. If someone wants PSB support on AR5212+AR5111 radios then please let me know and I'll add the relevant version check. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Modified: head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Wed Oct 31 21:00:01 2012 (r242407) +++ head/sys/dev/ath/ath_hal/ar5212/ar5212_attach.c Wed Oct 31 21:03:55 2012 (r242408) @@ -786,7 +786,29 @@ ar5212FillCapabilityInfo(struct ath_hal else pCap->halHigh2GhzChan = 2732; - pCap->halLow5GhzChan = 4915; + /* + * For AR5111 version < 4, the lowest centre frequency supported is + * 5130MHz. For AR5111 version 4, the 4.9GHz channels are supported + * but only in 10MHz increments. + * + * In addition, the programming method is wrong - it uses the IEEE + * channel number to calculate the frequency, rather than the + * channel centre. Since half/quarter rates re-use some of the + * 5GHz channel IEEE numbers, this will result in a badly programmed + * synth. + * + * Until the relevant support is written, just limit lower frequency + * support for AR5111 so things aren't incorrectly programmed. + * + * XXX It's also possible this code doesn't correctly limit the + * centre frequencies of potential channels; this is very important + * for half/quarter rate! + */ + if (AH_RADIO_MAJOR(ah) == AR_RAD5111_SREV_MAJOR) { + pCap->halLow5GhzChan = 5120; /* XXX lowest centre = 5130MHz */ + } else { + pCap->halLow5GhzChan = 4915; + } pCap->halHigh5GhzChan = 6100; pCap->halCipherCkipSupport = AH_FALSE; Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Oct 31 21:00:01 2012 (r242407) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Oct 31 21:03:55 2012 (r242408) @@ -47,8 +47,8 @@ ar5416AniSetup(struct ath_hal *ah) .coarseHigh = { -14, -14, -14, -14, -12 }, .coarseLow = { -64, -64, -64, -64, -70 }, .firpwr = { -78, -78, -78, -78, -80 }, - .maxSpurImmunityLevel = 2, - .cycPwrThr1 = { 2, 4, 6 }, + .maxSpurImmunityLevel = 7, + .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 }, .maxFirstepLevel = 2, /* levels 0..2 */ .firstep = { 0, 4, 8 }, .ofdmTrigHigh = 500, @@ -61,7 +61,6 @@ ar5416AniSetup(struct ath_hal *ah) }; /* NB: disable ANI noise immmunity for reliable RIFS rx */ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL); - ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } /* Modified: head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Oct 31 21:00:01 2012 (r242407) +++ head/sys/dev/ath/ath_hal/ar9002/ar9280_attach.c Wed Oct 31 21:03:55 2012 (r242408) @@ -82,8 +82,8 @@ ar9280AniSetup(struct ath_hal *ah) .coarseHigh = { -14, -14, -14, -14, -12 }, .coarseLow = { -64, -64, -64, -64, -70 }, .firpwr = { -78, -78, -78, -78, -80 }, - .maxSpurImmunityLevel = 2, - .cycPwrThr1 = { 2, 4, 6 }, + .maxSpurImmunityLevel = 7, + .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 }, .maxFirstepLevel = 2, /* levels 0..2 */ .firstep = { 0, 4, 8 }, .ofdmTrigHigh = 500, Modified: head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Oct 31 21:00:01 2012 (r242407) +++ head/sys/dev/ath/ath_hal/ar9002/ar9285_attach.c Wed Oct 31 21:03:55 2012 (r242408) @@ -87,8 +87,8 @@ ar9285AniSetup(struct ath_hal *ah) .coarseHigh = { -14, -14, -14, -14, -12 }, .coarseLow = { -64, -64, -64, -64, -70 }, .firpwr = { -78, -78, -78, -78, -80 }, - .maxSpurImmunityLevel = 2, - .cycPwrThr1 = { 2, 4, 6 }, + .maxSpurImmunityLevel = 7, + .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 }, .maxFirstepLevel = 2, /* levels 0..2 */ .firstep = { 0, 4, 8 }, .ofdmTrigHigh = 500, Modified: head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Oct 31 21:00:01 2012 (r242407) +++ head/sys/dev/ath/ath_hal/ar9002/ar9287_attach.c Wed Oct 31 21:03:55 2012 (r242408) @@ -86,8 +86,8 @@ ar9287AniSetup(struct ath_hal *ah) .coarseHigh = { -14, -14, -14, -14, -12 }, .coarseLow = { -64, -64, -64, -64, -70 }, .firpwr = { -78, -78, -78, -78, -80 }, - .maxSpurImmunityLevel = 2, - .cycPwrThr1 = { 2, 4, 6 }, + .maxSpurImmunityLevel = 7, + .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 }, .maxFirstepLevel = 2, /* levels 0..2 */ .firstep = { 0, 4, 8 }, .ofdmTrigHigh = 500, From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 21:04:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A292E422; Wed, 31 Oct 2012 21:04:24 +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 8AB128FC15; Wed, 31 Oct 2012 21:04:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VL4OSJ030501; Wed, 31 Oct 2012 21:04:24 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VL4Ovl030498; Wed, 31 Oct 2012 21:04:24 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312104.q9VL4Ovl030498@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 21:04:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242409 - head/sys/dev/ath/ath_hal/ar9001 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 21:04:24 -0000 Author: adrian Date: Wed Oct 31 21:04:23 2012 New Revision: 242409 URL: http://svn.freebsd.org/changeset/base/242409 Log: Oops - missing from the last commit - add ANI immunity levels for AR9160. Obtained from: Qualcomm Atheros Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Modified: head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Wed Oct 31 21:03:55 2012 (r242408) +++ head/sys/dev/ath/ath_hal/ar9001/ar9160_attach.c Wed Oct 31 21:04:23 2012 (r242409) @@ -68,8 +68,8 @@ ar9160AniSetup(struct ath_hal *ah) .coarseHigh = { -14, -14, -14, -14, -12 }, .coarseLow = { -64, -64, -64, -64, -70 }, .firpwr = { -78, -78, -78, -78, -80 }, - .maxSpurImmunityLevel = 2, - .cycPwrThr1 = { 2, 4, 6 }, + .maxSpurImmunityLevel = 7, + .cycPwrThr1 = { 2, 4, 6, 8, 10, 12, 14, 16 }, .maxFirstepLevel = 2, /* levels 0..2 */ .firstep = { 0, 4, 8 }, .ofdmTrigHigh = 500, From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 21:06:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AE70D6BC; Wed, 31 Oct 2012 21:06:56 +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 96EA18FC08; Wed, 31 Oct 2012 21:06:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VL6unH030946; Wed, 31 Oct 2012 21:06:56 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VL6upt030944; Wed, 31 Oct 2012 21:06:56 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312106.q9VL6upt030944@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 21:06:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242411 - head/sys/dev/ath/ath_hal/ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 21:06:56 -0000 Author: adrian Date: Wed Oct 31 21:06:55 2012 New Revision: 242411 URL: http://svn.freebsd.org/changeset/base/242411 Log: Oops - this was incorrectly removed in a previous commit. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Oct 31 21:05:18 2012 (r242410) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Wed Oct 31 21:06:55 2012 (r242411) @@ -61,6 +61,7 @@ ar5416AniSetup(struct ath_hal *ah) }; /* NB: disable ANI noise immmunity for reliable RIFS rx */ AH5416(ah)->ah_ani_function &= ~(1 << HAL_ANI_NOISE_IMMUNITY_LEVEL); + ar5416AniAttach(ah, &aniparams, &aniparams, AH_TRUE); } /* From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 21:14:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DFC7890C; Wed, 31 Oct 2012 21:14:25 +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 C34358FC16; Wed, 31 Oct 2012 21:14:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VLEP9q032231; Wed, 31 Oct 2012 21:14:25 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VLEPiT032228; Wed, 31 Oct 2012 21:14:25 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201210312114.q9VLEPiT032228@svn.freebsd.org> From: Adrian Chadd Date: Wed, 31 Oct 2012 21:14:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242412 - head/sys/dev/ath/ath_hal/ar9001 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 21:14:26 -0000 Author: adrian Date: Wed Oct 31 21:14:25 2012 New Revision: 242412 URL: http://svn.freebsd.org/changeset/base/242412 Log: Since the PLL changes aren't in here yet for the AR9130 half/quarter rate support, disable it. Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Wed Oct 31 21:06:55 2012 (r242411) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_attach.c Wed Oct 31 21:14:25 2012 (r242412) @@ -301,6 +301,13 @@ ar9130FillCapabilityInfo(struct ath_hal /* BB Read WAR */ pCap->halHasBBReadWar = AH_TRUE; + /* + * Implement the PLL/config changes needed for half/quarter + * rates before re-enabling them here. + */ + pCap->halChanHalfRate = AH_FALSE; + pCap->halChanQuarterRate = AH_FALSE; + return AH_TRUE; } Modified: head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c Wed Oct 31 21:06:55 2012 (r242411) +++ head/sys/dev/ath/ath_hal/ar9001/ar9130_phy.c Wed Oct 31 21:14:25 2012 (r242412) @@ -33,6 +33,9 @@ ar9130InitPLL(struct ath_hal *ah, const uint32_t pll; + /* + * XXX TODO: support half/quarter rates + */ if (chan && IEEE80211_IS_CHAN_5GHZ(chan)) pll = 0x1450; else From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 22:11:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCE632E6; Wed, 31 Oct 2012 22:11:51 +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 B37AE8FC08; Wed, 31 Oct 2012 22:11:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VMBpsi044376; Wed, 31 Oct 2012 22:11:51 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VMBpHp044373; Wed, 31 Oct 2012 22:11:51 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201210312211.q9VMBpHp044373@svn.freebsd.org> From: Alexander Motin Date: Wed, 31 Oct 2012 22:11:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242417 - head/sys/dev/sound/pci/hda X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 22:11:51 -0000 Author: mav Date: Wed Oct 31 22:11:51 2012 New Revision: 242417 URL: http://svn.freebsd.org/changeset/base/242417 Log: ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker if unused in that configuration mixer at NID 15 is muted. Probably CODEC incorrectly reports its internal connections. Hide that muter from the driver to avoid muting and make built-in speaker work. There are several different CODECs sharing this ID and I have not enough information about them and the bug to implement more universal solution. Tested by: Big Yuuta MFC after: 2 weeks Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c Modified: head/sys/dev/sound/pci/hda/hdaa_patches.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Oct 31 22:02:48 2012 (r242416) +++ head/sys/dev/sound/pci/hda/hdaa_patches.c Wed Oct 31 22:11:51 2012 (r242417) @@ -541,6 +541,21 @@ hdaa_patch(struct hdaa_devinfo *devinfo) if (w != NULL) w->connsenable[0] = 0; break; + case HDA_CODEC_ALC269: + /* + * ASUS EeePC 1001px has strange variant of ALC269 CODEC, + * that mutes speaker if unused mixer at NID 15 is muted. + * Probably CODEC incorrectly reports internal connections. + * Hide that muter from the driver. There are several CODECs + * sharing this ID and I have not enough information about + * them to implement more universal solution. + */ + if (subid == 0x84371043) { + w = hdaa_widget_get(devinfo, 15); + if (w != NULL) + w->param.inamp_cap = 0; + } + break; case HDA_CODEC_CX20582: case HDA_CODEC_CX20583: case HDA_CODEC_CX20584: From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 22:55:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 62127D3D; Wed, 31 Oct 2012 22:55:45 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id F14898FC14; Wed, 31 Oct 2012 22:55:43 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so1817886lag.13 for ; Wed, 31 Oct 2012 15:55:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZflBhTTJ//NO9sHnaQq4nqJThCNPN+3hTRP9IwwkK5c=; b=dek9IKSOL0Cg6uNU8vj7A3DgPjxHHUXYkTTxNCEF5miyfKonhackce/eLYV9crg7k8 9cOcBFF69Gm2+IhB9oIU9OjfwhTRQprliTEbIiuxnb3Ro1c7EoYcJadJQf9ONS3ShEdI 16XQQEmKqYSljP1TcL+IJ94vKQ8ucVqMoZqeyJVq9fFltSC08Stgm/KS1w7bthBctoRl MmzJukjiVbzVWgFq6+XyVmDQ6WWFv+eqr4USV0WQ/xgFTHKosuco0bVAWAw/YkMqwayc 6HKgw0KFJCV96Sczc4V/P4pn8im1fvDx5r6gOqvklj/0gzmcSZWMVRvW9VL7R5QktLDx st9g== MIME-Version: 1.0 Received: by 10.112.36.200 with SMTP id s8mr15434822lbj.92.1351724142727; Wed, 31 Oct 2012 15:55:42 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 31 Oct 2012 15:55:42 -0700 (PDT) In-Reply-To: <50918AAD.2090906@freebsd.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> <1351712425.1120.109.camel@revolution.hippie.lan> <50918AAD.2090906@freebsd.org> Date: Wed, 31 Oct 2012 22:55:42 +0000 X-Google-Sender-Auth: Z8g6BNw5RhPFOC4g5RrYO-9Cmmo Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 Cc: Ian Lepore , Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 22:55:45 -0000 On Wed, Oct 31, 2012 at 8:31 PM, Andre Oppermann wrote: > On 31.10.2012 20:40, Ian Lepore wrote: >> >> On Thu, 2012-11-01 at 06:30 +1100, Peter Jeremy wrote: >>> >>> On 2012-Oct-31 18:57:37 +0000, Attilio Rao wrote: >>>> >>>> On 10/31/12, Adrian Chadd wrote: >>>>> >>>>> Right, but you didn't make it configurable for us embedded peeps who >>>>> still care about memory usage. >>>> >>>> >>>> How is this possible without breaking the module/kernel ABI? >>> >>> >>> Memory usage may override ABI compatibility in an embedded environment. >>> >>>> All that assuming you can actually prove a real performance loss even >>>> in the new cases. >>> >>> >>> The issue with padding on embedded systems is memory utilisation rather >>> than performance. >>> >> >> There are potential performance hits too, in that embedded systems tend >> to have tiny caches (16K L1 with no L2, that sort of thing), so >> purposely padding things so that large parts of a cache line aren't used >> for anything wastes a scarce resource. > > > You can define CACHE_LINE_SIZE to 0 on those platforms. > Or to make it even more granular there could be a CACHE_LINE_SIZE_LOCKS > that is used for lock padding. I think that this is a bright idea, albeit under the condition that just like CACHE_LINE_SIZE it won't change during STABLE branches timeframe and that it must not be dependent by SMP option. What do you think about this patch?: http://www.freebsd.org/~attilio/cache_line_size_locks.patch Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 23:25:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEEC337E; Wed, 31 Oct 2012 23:25:55 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3E36D8FC12; Wed, 31 Oct 2012 23:25:54 +0000 (UTC) Received: by mail-qc0-f182.google.com with SMTP id k19so1723424qcs.13 for ; Wed, 31 Oct 2012 16:25:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=tvEuR6/64EyPVl0CJfheNwt1Bxt0nSTCAUvvLHuGuug=; b=KrfGnz4qy6hElSI8miC+yOOxs2eJghqCJbG6sErrPFU/71uswoHFgm9rtaXSRmpBwM BvaJ5RqE7wY2wqmwF7UmZmOT2CmJKl3GNhIxF/lhHTocQ4WF8c26ev96WPG2NnXkc6Zl L3uTYFVRrC34T/JluHiCY2McpK1XrTztsK/4sd/AnT11iCbum+fB9GMn11ZicQVHgFyY 3R69ouFfSuuxCgAyla/iDU/D+lN3PuFJEivwfWN1Wyqhq1kloDiCXAxx0ugIIBa1Nq1+ vxQriH9+7i1kr/O3h4xzbxyoJ8UaxwUKQ62RQqLTfO4slZnKyDNsSCBXgN7z/tRFT6fH 92Yw== MIME-Version: 1.0 Received: by 10.224.42.8 with SMTP id q8mr25453044qae.77.1351725954520; Wed, 31 Oct 2012 16:25:54 -0700 (PDT) Received: by 10.49.35.37 with HTTP; Wed, 31 Oct 2012 16:25:54 -0700 (PDT) In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> <1351712425.1120.109.camel@revolution.hippie.lan> <50918AAD.2090906@freebsd.org> Date: Wed, 31 Oct 2012 16:25:54 -0700 Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Jim Harris To: attilio@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: Ian Lepore , Adrian Chadd , src-committers@freebsd.org, Andre Oppermann , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 23:25:56 -0000 On Wed, Oct 31, 2012 at 3:55 PM, Attilio Rao wrote: > On Wed, Oct 31, 2012 at 8:31 PM, Andre Oppermann > wrote: > > You can define CACHE_LINE_SIZE to 0 on those platforms. > > Or to make it even more granular there could be a CACHE_LINE_SIZE_LOCKS > > that is used for lock padding. > > I think that this is a bright idea, albeit under the condition that > just like CACHE_LINE_SIZE it won't change during STABLE branches > timeframe and that it must not be dependent by SMP option. > > What do you think about this patch?: > http://www.freebsd.org/~attilio/cache_line_size_locks.patch > Should CACHE_LINE_SIZE_LOCKS still be defined as CACHE_LINE_SIZE on arm, mips, etc. if SMP is enabled? This would ensure the padding that used to be there in vpglock doesn't go away. I'm also wondering if this should be named something different, perhaps LOCK_ALIGNMENT. -Jim From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 23:42:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A194D606; Wed, 31 Oct 2012 23:42:13 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4EF3D8FC0C; Wed, 31 Oct 2012 23:42:11 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so1841933lag.13 for ; Wed, 31 Oct 2012 16:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=BhXYQVGz4bkfnOTwPhbvEoQTtb8KVZ5cLOWYlAu3ZEs=; b=LI+Uxy4m2TdweV4sEFRmkNUm7btxz4f/i+zImyZXsFr4L6mONGfhcdyVuaIpksrK+y 9h1zL7Zd/nQaYHV2HC5sKmi7eQfLiAMt/mmwFRJCIsBx1/McfqgcRbHE66vlLotk8bNL vTwRPsYVOjfGMMjzQI532yod3P7JzesF676ATtrRqN1c4TrxYCTlPqdccnyK/bTnPiYw neZ15pd1bcaZ2aOROEorgzUnKxCU7erDO2aT0NHEf5jvsjV2o8hWdD55UkFroThPnooN fxWSez1EW4BxG0aO6GD9NKHw+N6Mwei0/DernwnbfD+jNIeU2Q7dvciAqW6WAG0l9Zpo 6lqg== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr13067746lab.15.1351726930893; Wed, 31 Oct 2012 16:42:10 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Wed, 31 Oct 2012 16:42:10 -0700 (PDT) In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121031193020.GJ3309@server.rulingia.com> <1351712425.1120.109.camel@revolution.hippie.lan> <50918AAD.2090906@freebsd.org> Date: Wed, 31 Oct 2012 23:42:10 +0000 X-Google-Sender-Auth: dzFv40A4jUeMN8nOBZD6IBE0oEc Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Jim Harris Content-Type: text/plain; charset=UTF-8 Cc: Ian Lepore , Adrian Chadd , src-committers@freebsd.org, Andre Oppermann , svn-src-all@freebsd.org, svn-src-head@freebsd.org, Peter Jeremy X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 23:42:14 -0000 On Wed, Oct 31, 2012 at 11:25 PM, Jim Harris wrote: > > > On Wed, Oct 31, 2012 at 3:55 PM, Attilio Rao wrote: >> >> On Wed, Oct 31, 2012 at 8:31 PM, Andre Oppermann >> wrote: >> > You can define CACHE_LINE_SIZE to 0 on those platforms. >> > Or to make it even more granular there could be a CACHE_LINE_SIZE_LOCKS >> > that is used for lock padding. >> >> I think that this is a bright idea, albeit under the condition that >> just like CACHE_LINE_SIZE it won't change during STABLE branches >> timeframe and that it must not be dependent by SMP option. >> >> What do you think about this patch?: >> http://www.freebsd.org/~attilio/cache_line_size_locks.patch > > > Should CACHE_LINE_SIZE_LOCKS still be defined as CACHE_LINE_SIZE on arm, > mips, etc. if SMP is enabled? This would ensure the padding that used to be > there in vpglock doesn't go away. As first thing, I'm strongly against having SMP-dependant lock sizes, as said so I won't be happy with whatever patch that changes lock sizes based on the SMP option presence or not. Said that, I'm not really sure if pad-aligned locks have the same performance weight on !Intel architectures. I suspect not. If this is not the case (then pad-aligned are important on some architectures where I used the 1 value) I just say to go and use CACHE_ALIGN_SIZE for them. I think the whole point of this patch was to prevent !Intel (or most of them, namely MIPS and ARM) architectures to avoid the pad-aligned effect at all, otherwise this patch looks moot to me. Said that, this changes completely the meaning of pad-align locks. If this patch goes in it switches from "mutexes padded and aligned to the cache line size" to "mutexes which can be padded and aligned if the architecture can have a real benefit from doing so". > I'm also wondering if this should be named something different, perhaps > LOCK_ALIGNMENT. I don't really mind whatever name you are happier with, so just pick up one. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 23:44:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 70639785; Wed, 31 Oct 2012 23:44:20 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 577AD8FC0A; Wed, 31 Oct 2012 23:44:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VNiKBj063746; Wed, 31 Oct 2012 23:44:20 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VNiKxK063744; Wed, 31 Oct 2012 23:44:20 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201210312344.q9VNiKxK063744@svn.freebsd.org> From: Jim Harris Date: Wed, 31 Oct 2012 23:44:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242420 - head/sys/dev/nvme X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 23:44:20 -0000 Author: jimharris Date: Wed Oct 31 23:44:19 2012 New Revision: 242420 URL: http://svn.freebsd.org/changeset/base/242420 Log: Use callout_reset_curcpu to allow the callout to be handled by the current CPU and not always CPU 0. This has the added benefit of reducing a huge amount of spinlock contention on the callout_cpu spinlock for CPU 0. Sponsored by: Intel Modified: head/sys/dev/nvme/nvme_qpair.c Modified: head/sys/dev/nvme/nvme_qpair.c ============================================================================== --- head/sys/dev/nvme/nvme_qpair.c Wed Oct 31 22:21:33 2012 (r242419) +++ head/sys/dev/nvme/nvme_qpair.c Wed Oct 31 23:44:19 2012 (r242420) @@ -390,7 +390,12 @@ nvme_qpair_submit_cmd(struct nvme_qpair req->cmd.cid = tr->cid; qpair->act_tr[tr->cid] = tr; +#if __FreeBSD_version >= 800030 + callout_reset_curcpu(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, + nvme_timeout, tr); +#else callout_reset(&tr->timer, NVME_TIMEOUT_IN_SEC * hz, nvme_timeout, tr); +#endif /* Copy the command from the tracker to the submission queue. */ memcpy(&qpair->cmd[qpair->sq_tail], &req->cmd, sizeof(req->cmd)); From owner-svn-src-head@FreeBSD.ORG Wed Oct 31 23:50:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3F48957; Wed, 31 Oct 2012 23:50:36 +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 AACDA8FC12; Wed, 31 Oct 2012 23:50:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9VNoa01065185; Wed, 31 Oct 2012 23:50:36 GMT (envelope-from jfv@svn.freebsd.org) Received: (from jfv@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9VNoaAa065183; Wed, 31 Oct 2012 23:50:36 GMT (envelope-from jfv@svn.freebsd.org) Message-Id: <201210312350.q9VNoaAa065183@svn.freebsd.org> From: Jack F Vogel Date: Wed, 31 Oct 2012 23:50:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242421 - head/sys/dev/ixgbe X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 31 Oct 2012 23:50:36 -0000 Author: jfv Date: Wed Oct 31 23:50:36 2012 New Revision: 242421 URL: http://svn.freebsd.org/changeset/base/242421 Log: A few important fixes: - Testing TSO6 has led me to discover that HW RSC is a problematic feature, it is ONLY designed to work with IPv4 in the first place, and if IP forwarding is done it can't be disabled as LRO in the stack, also initial testing we've done at Intel shows an equal performance using TSO[46] on the TX and LRO on RX, if you ran older code on 82599 or later hardware you actually could have detrimental performance for this reason. So I am disabling the feature by default and all our adapters will now use LRO instead. - If you have flow control off and multiple queues it was possible when the buffer of one queue becomes full that all RX movement is stalled, to eliminate this problem a feature bit is now set that will allow packets to be dropped when full rather than stall. Note, the default is to have flow control on, and this keeps this from happening. - Because of the recent fixes in the stack, LRO is now auto-disabled when problematic, so I have decided to enable it by default in the capabilities in the driver. - There are some 1G modules used by some customers, a couple small tweaks to properly support those in the media code. - A note: we have now done some testing of TSO6 and using LRO with IPv6 and it all works great!! Seeing line rate in both directions in best cases. Thanks bz for your excellent work!! Modified: head/sys/dev/ixgbe/ixgbe.c Modified: head/sys/dev/ixgbe/ixgbe.c ============================================================================== --- head/sys/dev/ixgbe/ixgbe.c Wed Oct 31 23:44:19 2012 (r242420) +++ head/sys/dev/ixgbe/ixgbe.c Wed Oct 31 23:50:36 2012 (r242421) @@ -47,7 +47,7 @@ int ixgbe_display_debug_stat /********************************************************************* * Driver version *********************************************************************/ -char ixgbe_driver_version[] = "2.4.8"; +char ixgbe_driver_version[] = "2.4.11"; /********************************************************************* * PCI Device ID Table @@ -181,6 +181,9 @@ static __inline void ixgbe_rx_discard(st static __inline void ixgbe_rx_input(struct rx_ring *, struct ifnet *, struct mbuf *, u32); +static void ixgbe_enable_rx_drop(struct adapter *); +static void ixgbe_disable_rx_drop(struct adapter *); + /* Support for pluggable optic modules */ static bool ixgbe_sfp_probe(struct adapter *); static void ixgbe_setup_optics(struct adapter *); @@ -292,6 +295,20 @@ TUNABLE_INT("hw.ixgbe.txd", &ixgbe_txd); static int ixgbe_rxd = PERFORM_RXD; TUNABLE_INT("hw.ixgbe.rxd", &ixgbe_rxd); +/* +** HW RSC control: +** this feature only works with +** IPv4, and only on 82599 and later. +** Also this will cause IP forwarding to +** fail and that can't be controlled by +** the stack as LRO can. For all these +** reasons I've deemed it best to leave +** this off and not bother with a tuneable +** interface, this would need to be compiled +** to enable. +*/ +static bool ixgbe_rsc_enable = FALSE; + /* Keep running tab on them for sanity check */ static int ixgbe_total_ports; @@ -1667,7 +1684,7 @@ ixgbe_media_status(struct ifnet * ifp, s ifmr->ifm_active |= IFM_100_TX | IFM_FDX; break; case IXGBE_LINK_SPEED_1GB_FULL: - ifmr->ifm_active |= IFM_1000_T | IFM_FDX; + ifmr->ifm_active |= adapter->optics | IFM_FDX; break; case IXGBE_LINK_SPEED_10GB_FULL: ifmr->ifm_active |= adapter->optics | IFM_FDX; @@ -2035,7 +2052,6 @@ ixgbe_local_timer(void *arg) /* ** Check the TX queues status - ** - central locked handling of OACTIVE ** - watchdog only if all queues show hung */ for (int i = 0; i < adapter->num_queues; i++, que++, txr++) { @@ -2210,6 +2226,11 @@ ixgbe_setup_optics(struct adapter *adapt return; } + if (layer & IXGBE_PHYSICAL_LAYER_1000BASE_SX) { + adapter->optics = IFM_1000_SX; + return; + } + if (layer & (IXGBE_PHYSICAL_LAYER_10GBASE_LR | IXGBE_PHYSICAL_LAYER_10GBASE_LRM)) { adapter->optics = IFM_10G_LR; @@ -2617,14 +2638,12 @@ ixgbe_setup_interface(device_t dev, stru ifp->if_capabilities |= IFCAP_HWCSUM | IFCAP_TSO | IFCAP_VLAN_HWCSUM; ifp->if_capabilities |= IFCAP_JUMBO_MTU; + ifp->if_capabilities |= IFCAP_LRO; ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_HWTSO | IFCAP_VLAN_MTU; ifp->if_capenable = ifp->if_capabilities; - /* Don't enable LRO by default */ - ifp->if_capabilities |= IFCAP_LRO; - /* ** Don't turn this on by default, if vlans are ** created on another pseudo device (eg. lagg) @@ -3899,6 +3918,10 @@ ixgbe_rsc_count(union ixgbe_adv_rx_desc * for an RX ring, this is toggled by the LRO capability * even though it is transparent to the stack. * + * NOTE: since this HW feature only works with IPV4 and + * our testing has shown soft LRO to be as effective + * I have decided to disable this by default. + * **********************************************************************/ static void ixgbe_setup_hw_rsc(struct rx_ring *rxr) @@ -3907,6 +3930,13 @@ ixgbe_setup_hw_rsc(struct rx_ring *rxr) struct ixgbe_hw *hw = &adapter->hw; u32 rscctrl, rdrxctl; + /* If turning LRO/RSC off we need to disable it */ + if ((adapter->ifp->if_capenable & IFCAP_LRO) == 0) { + rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(rxr->me)); + rscctrl &= ~IXGBE_RSCCTL_RSCEN; + return; + } + rdrxctl = IXGBE_READ_REG(hw, IXGBE_RDRXCTL); rdrxctl &= ~IXGBE_RDRXCTL_RSCFRSTSIZE; #ifdef DEV_NETMAP /* crcstrip is optional in netmap */ @@ -4108,12 +4138,8 @@ skip_head: /* ** Now set up the LRO interface: - ** 82598 uses software LRO, the - ** 82599 and X540 use a hardware assist. */ - if ((adapter->hw.mac.type != ixgbe_mac_82598EB) && - (ifp->if_capenable & IFCAP_RXCSUM) && - (ifp->if_capenable & IFCAP_LRO)) + if (ixgbe_rsc_enable) ixgbe_setup_hw_rsc(rxr); else if (ifp->if_capenable & IFCAP_LRO) { int err = tcp_lro_init(lro); @@ -5737,10 +5763,14 @@ ixgbe_set_flowcntl(SYSCTL_HANDLER_ARGS) case ixgbe_fc_tx_pause: case ixgbe_fc_full: adapter->hw.fc.requested_mode = adapter->fc; + if (adapter->num_queues > 1) + ixgbe_disable_rx_drop(adapter); break; case ixgbe_fc_none: default: adapter->hw.fc.requested_mode = ixgbe_fc_none; + if (adapter->num_queues > 1) + ixgbe_enable_rx_drop(adapter); } /* Don't autoneg if forcing a value */ adapter->hw.fc.disable_fc_autoneg = TRUE; @@ -5837,3 +5867,34 @@ ixgbe_set_thermal_test(SYSCTL_HANDLER_AR return (0); } + +/* +** Enable the hardware to drop packets when the buffer is +** full. This is useful when multiqueue,so that no single +** queue being full stalls the entire RX engine. We only +** enable this when Multiqueue AND when Flow Control is +** disabled. +*/ +static void +ixgbe_enable_rx_drop(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + + for (int i = 0; i < adapter->num_queues; i++) { + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + srrctl |= IXGBE_SRRCTL_DROP_EN; + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + } +} + +static void +ixgbe_disable_rx_drop(struct adapter *adapter) +{ + struct ixgbe_hw *hw = &adapter->hw; + + for (int i = 0; i < adapter->num_queues; i++) { + u32 srrctl = IXGBE_READ_REG(hw, IXGBE_SRRCTL(i)); + srrctl &= ~IXGBE_SRRCTL_DROP_EN; + IXGBE_WRITE_REG(hw, IXGBE_SRRCTL(i), srrctl); + } +} From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 00:09:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 34E00C88; Thu, 1 Nov 2012 00:09:02 +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 1C7478FC08; Thu, 1 Nov 2012 00:09:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1091Ct070089; Thu, 1 Nov 2012 00:09:01 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1091RK070087; Thu, 1 Nov 2012 00:09:01 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201211010009.qA1091RK070087@svn.freebsd.org> From: Alexander Motin Date: Thu, 1 Nov 2012 00:09:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242422 - head/sys/dev/ata X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 00:09:02 -0000 Author: mav Date: Thu Nov 1 00:09:01 2012 New Revision: 242422 URL: http://svn.freebsd.org/changeset/base/242422 Log: Only four specific ATA PIO commands transfer several sectors per DRQ block (interrupt). All other ATA PIO commands transfer one sector or 512 bytes at one time. Hardcode these exceptions in ata(4) with ATA_CAM option. This fixes timeout of READ LOG EXT command used by `smartctl -x /dev/adaX`. Modified: head/sys/dev/ata/ata-all.c Modified: head/sys/dev/ata/ata-all.c ============================================================================== --- head/sys/dev/ata/ata-all.c Wed Oct 31 23:50:36 2012 (r242421) +++ head/sys/dev/ata/ata-all.c Thu Nov 1 00:09:01 2012 (r242422) @@ -1501,6 +1501,14 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + if (ccb->ataio.cmd.command == ATA_READ_MUL || + ccb->ataio.cmd.command == ATA_READ_MUL48 || + ccb->ataio.cmd.command == ATA_WRITE_MUL || + ccb->ataio.cmd.command == ATA_WRITE_MUL48) { + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); + } else + request->transfersize = min(request->bytecount, 512); } else { request->data = ccb->csio.data_ptr; request->bytecount = ccb->csio.dxfer_len; @@ -1517,9 +1525,9 @@ ata_cam_begin_transaction(device_t dev, request->flags |= ATA_R_READ; if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT) request->flags |= ATA_R_WRITE; + request->transfersize = min(request->bytecount, + ch->curr[ccb->ccb_h.target_id].bytecount); } - request->transfersize = min(request->bytecount, - ch->curr[ccb->ccb_h.target_id].bytecount); request->retries = 0; request->timeout = (ccb->ccb_h.timeout + 999) / 1000; callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED); From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 01:05:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CE051714; Thu, 1 Nov 2012 01:05:09 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id A4BA88FC08; Thu, 1 Nov 2012 01:05:07 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1TTiXO-000F3J-JQ; Wed, 31 Oct 2012 17:21:34 -0700 Message-ID: <5091C087.6060307@FreeBSD.org> Date: Wed, 31 Oct 2012 17:21:27 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Pawel Jakub Dawidek Subject: Re: svn commit: r242101 - in head/usr.sbin/cron: cron crontab lib References: <201210252254.q9PMsUFK065335@svn.freebsd.org> <20121027192916.GD1405@garage.freebsd.pl> In-Reply-To: <20121027192916.GD1405@garage.freebsd.pl> 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 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 01:05:09 -0000 On 10/27/2012 12:29 PM, Pawel Jakub Dawidek wrote: > On behalf of Mother Earth thank you:) Thank You, Mother Earth, for noticing my humble attempts to make worl^HFreeBSD a better place. :) -Maxim From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 02:07:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C939E8E; Thu, 1 Nov 2012 02:07:13 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id CE2078FC08; Thu, 1 Nov 2012 02:07:12 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so1488203pbb.13 for ; Wed, 31 Oct 2012 19:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=rV9Cfkoy8qDnUCZlfvU00t2P+dN5WawOpw6ukIGcFgU=; b=G7Bqfjo94UWuJ3tJ6TZILsO+AdmKiHZTijjsiZb56Fvd3aDBVokYLEK3wkw81tlYo9 4WOD8U9f8ET7n+KRNBdXiKgJOX62AHMBa9Y+qLpz6xSoWC6pgyqRj+Q1XMFdJ5aHFBhI ay3VK9hufhuZJNBuY7xB1hYyCnV5mJ6qaQ7bkHnftQypRrPmlw+WJtPG5U60SFl/qXEe i4Cb+FsuhBYnD/QRnudf6Q24LzZUXCs4T+y+S1JjyX0BSRl5AmKeq6mzVkX9SwByvTqg aBPKHtBmiVhiRZDtWoT5bKTO8biClP7DN4hia+DOGW/qYeAxUGPhYJyK+fVDOCF9m7fK MtZw== Received: by 10.66.78.199 with SMTP id d7mr107205323pax.77.1351735631989; Wed, 31 Oct 2012 19:07:11 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id jw14sm3181162pbb.36.2012.10.31.19.07.07 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Oct 2012 19:07:10 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 01 Nov 2012 11:06:41 +0900 From: YongHyeon PYUN Date: Thu, 1 Nov 2012 11:06:41 +0900 To: Andre Oppermann Subject: Re: svn commit: r242161 - in head/sys: net netinet netpfil/pf Message-ID: <20121101020641.GC3154@michelle.cdnetworks.com> References: <201210262106.q9QL6YgY000943@svn.freebsd.org> <508BBE6C.7010409@freebsd.org> <20121027220137.GJ70741@FreeBSD.org> <20121029204104.GA1431@michelle.cdnetworks.com> <20121029052100.GO70741@FreeBSD.org> <20121029214038.GD1431@michelle.cdnetworks.com> <508E3C6B.2090102@freebsd.org> <20121030022507.GB4298@michelle.cdnetworks.com> <5090DA4A.5090502@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5090DA4A.5090502@freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 02:07:13 -0000 On Wed, Oct 31, 2012 at 08:59:06AM +0100, Andre Oppermann wrote: > On 30.10.2012 03:25, YongHyeon PYUN wrote: > >On Mon, Oct 29, 2012 at 09:20:59AM +0100, Andre Oppermann wrote: > >>On 29.10.2012 22:40, YongHyeon PYUN wrote: > >>>On Mon, Oct 29, 2012 at 09:21:00AM +0400, Gleb Smirnoff wrote: > >>>>On Mon, Oct 29, 2012 at 01:41:04PM -0700, YongHyeon PYUN wrote: > >>>>Y> On Sun, Oct 28, 2012 at 02:01:37AM +0400, Gleb Smirnoff wrote: > >>>>Y> > On Sat, Oct 27, 2012 at 12:58:52PM +0200, Andre Oppermann wrote: > >>>>Y> > A> On 26.10.2012 23:06, Gleb Smirnoff wrote: > >>>>Y> > A> > Author: glebius > >>>>Y> > A> > Date: Fri Oct 26 21:06:33 2012 > >>>>Y> > A> > New Revision: 242161 > >>>>Y> > A> > URL: http://svn.freebsd.org/changeset/base/242161 > >>>>Y> > A> > > >>>>Y> > A> > Log: > >>>>Y> > A> > o Remove last argument to ip_fragment(), and obtain all > >>>>needed information > >>>>Y> > A> > on checksums directly from mbuf flags. This simplifies > >>>>code. > >>>>Y> > A> > o Clear CSUM_IP from the mbuf in ip_fragment() if we did > >>>>checksums in > >>>>Y> > >>>>Y> I'm not sure whether ti(4)'s checksum offloading for IP fragmented > >>>>Y> packets(CSUM_IP_FRAGS) still works after this change. ti(4) > >>>>Y> requires CSUM_IP should be set for IP fragmented packets. Not sure > >>>>Y> whether it's a bug or not. I have a ti(4) controller but I don't > >>>>Y> remember where I can find it and don't have a link > >>>>Y> parter(1000baseSX) to test it. :-( > >>>> > >>>>ti(4) declares both CSUM_IP and CSUM_IP_FRAGS, so ip_fragment() won't do > >>> > >>>Because it supports both CSUM_IP and CSUM_IP_FRAGS. Probably ti(4) > >>>is the only controller that supports TCP/UDP checksum offloading > >>>for an IP fragmented packet. > >> > >>This is a bit weird if it doesn't do the fragmentation itself. > >>Computing the IP header checksum doesn't differ for normal and > >>fragmented packets. The protocol checksum (TCP or UDP) stays > >>the same for in the case of IP level fragmentation. It is only > >>visible in the first fragment which includes the protocol header. > > > >My interpretation for CSUM_IP_FRAGS works like the following. > > - Only peuso header checksum for TCP/UDP is computed by upper > > stack. > > - Controller has no ability to fragment the packet so it should > > done in upper stack(i.e. ip_output()). > > - When ip_output() has to fragment the packet, it just fragments > > the packet without completing TCP/UDP and IP checksum. If > > controller does not support CSUM_IP_FRAGS feature, ip_output() > > can't delay TCP/UDP checksum in this stage. > > - The fragmented packets are sent to driver. Driver sets > > appropriate bits of DMA descriptor based on fragmentation field > > of mbuf(M_FRAG, M_LASTFRAG) and issue the frame to controller. > > - The firmware of controller queues the fragmented frames up in > > its internal memory and hold off sending out the frames since it > > has to compute TCP/UDP checksum. When it sees a frame which > > indicates the end of fragmented frame it finally computes > > TCP/UDP checksum and send each frame out to wire by computing > > IP checksum on the fly. > >The difference is which one(upper stack vs. controller) computes > >TCP/UDP/IP checksum. > > Such a behavior doesn't make much sense and probably wasn't used at all > in practice. It's very complex as well. Plus you can't guarantee that It's job of firmware running on embedded MIPS R4000 in the controller. ti(4) was one of the best smart controller in the past and it even supported header split! > there won't be other packet slipping into the interface queue in an SMP > world. > Hmm, right, I should have noticed that after FreeBSD's removal for splnet()/splimp(). Since ti(4) is the only controller that supports TCP/UDP checksum offloading on IP fragmented packets and it's rare to see ti(4) controllers in these days, I think there is no much point to make the hardware feature work. I'll remove the feature in ti(4). From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 03:45:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DC309DA7; Thu, 1 Nov 2012 03:45:34 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AA68D8FC08; Thu, 1 Nov 2012 03:45:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA13jYEO009705; Thu, 1 Nov 2012 03:45:34 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA13jYlF009703; Thu, 1 Nov 2012 03:45:34 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211010345.qA13jYlF009703@svn.freebsd.org> From: Juli Mallett Date: Thu, 1 Nov 2012 03:45:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242423 - head/sys/contrib/octeon-sdk X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 03:45:35 -0000 Author: jmallett Date: Thu Nov 1 03:45:33 2012 New Revision: 242423 URL: http://svn.freebsd.org/changeset/base/242423 Log: Handle the management port on the EBT5600 and disable loopback. The XAUI port connected to the Broadcom switch does not seem operable, but it's unclear if that's simply due to a lack of configuration information for the switch. The switch does not seem to present any identifying information via MDIO, and is a BCM56512. Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c Modified: head/sys/contrib/octeon-sdk/cvmx-helper-board.c ============================================================================== --- head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Nov 1 00:09:01 2012 (r242422) +++ head/sys/contrib/octeon-sdk/cvmx-helper-board.c Thu Nov 1 03:45:33 2012 (r242423) @@ -451,6 +451,12 @@ int cvmx_helper_board_get_mii_address(in return ipd_port+1; else return -1; + case CVMX_BOARD_TYPE_EBT5600: + /* Board has 1 management port */ + if (ipd_port == CVMX_HELPER_BOARD_MGMT_IPD_PORT) + return 0; + /* Board has 1 XAUI port connected to a switch. */ + return -1; case CVMX_BOARD_TYPE_EBB5600: { static unsigned char qlm_switch_addr = 0; @@ -990,6 +996,7 @@ cvmx_helper_link_info_t __cvmx_helper_bo } /* Fall through to the generic code below */ break; + case CVMX_BOARD_TYPE_EBT5600: case CVMX_BOARD_TYPE_EBH5600: case CVMX_BOARD_TYPE_EBH5601: case CVMX_BOARD_TYPE_EBH5610: @@ -1289,6 +1296,11 @@ int __cvmx_helper_board_interface_probe( return 0; #endif break; + case CVMX_BOARD_TYPE_EBT5600: + /* Disable loopback. */ + if (interface == 3) + return 0; + break; case CVMX_BOARD_TYPE_EBT5810: return 1; /* Two ports on each SPI: 1 hooked to MAC, 1 loopback ** Loopback disabled by default. */ From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 04:07:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 333C2318; Thu, 1 Nov 2012 04:07:09 +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 1A8F58FC12; Thu, 1 Nov 2012 04:07:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1478Ws013064; Thu, 1 Nov 2012 04:07:08 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1478KB013057; Thu, 1 Nov 2012 04:07:08 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211010407.qA1478KB013057@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 04:07:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242424 - in head: share/man/man4 sys/conf sys/ddb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 04:07:09 -0000 Author: alfred Date: Thu Nov 1 04:07:08 2012 New Revision: 242424 URL: http://svn.freebsd.org/changeset/base/242424 Log: Small textdump enhancements. Allow textdumps to be called explicitly from DDB. If "dump" is called in DDB and textdumps are enabled then abort the dump and tell the user to turn off textdumps. Add options TEXTDUMP_PREFERRED to turn textdumps on by default. Add options TEXTDUMP_VERBOSE to be a bit more verbose while textdumping. Reviewed by: rwatson MFC after: 2 weeks Modified: head/share/man/man4/ddb.4 head/share/man/man4/textdump.4 head/sys/conf/NOTES head/sys/conf/options head/sys/ddb/db_command.c head/sys/ddb/db_textdump.c Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Nov 1 03:45:33 2012 (r242423) +++ head/share/man/man4/ddb.4 Thu Nov 1 04:07:08 2012 (r242424) @@ -1176,6 +1176,7 @@ section for more information on the scri .It Ic textdump set .It Ic textdump status .It Ic textdump unset +.It Ic textdump dump The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1184,6 +1185,9 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. +Use the +.Ic textdump dump +command to immediately perform a textdump. More information may be found in .Xr textdump 4 . .El Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Thu Nov 1 03:45:33 2012 (r242423) +++ head/share/man/man4/textdump.4 Thu Nov 1 04:07:08 2012 (r242424) @@ -36,6 +36,9 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB + +.Cd options TEXTDUMP_VERBOSE +.Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION The .Nm @@ -115,7 +118,11 @@ or by setting the .Dv debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , -it is possible to request that the next dump be a textdump. +it is possible to request that the next dump be a textdump. One can +also directly trigger a textdump in +.Xr ddb 4 +by running the command +.Ic textdump dump . .Pp If at the .Xr ddb 4 @@ -125,10 +132,30 @@ command line, the commands and .Ic textdump unset may be used to set, query, and clear the textdump pending flag. +The command +.Ic textdump dump +can be used to immediately trigger a textdump. .Pp As with regular kernel dumps, a dump partition must be automatically or manually configured using .Xr dumpon 8 . +.Pp +Additional kernel +.Xr config 8 +options: +.Bl -tag -width TEXTDUMP_PREFERRED +.It Cd TEXTDUMP_PREFERRED +sets textdumps to be the default manner of doing dumps. This means there +will be no need to +.Xr sysctl 8 +or use the +.Cr textdump set +.Xr ddb 8 +commands. +.It Cd TEXTDUMP_VERBOSE +will have the textdump facility be more verbose about each file it is emitting +as well as other diagnostics useful to debug the textdump facility itself. +.El .Sh EXAMPLES In the following example, the script .Dv kdb.enter.panic Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Thu Nov 1 03:45:33 2012 (r242423) +++ head/sys/conf/NOTES Thu Nov 1 04:07:08 2012 (r242424) @@ -389,6 +389,16 @@ options GDB options SYSCTL_DEBUG # +# Enable textdump by default, this disables kernel core dumps. +# +options TEXTDUMP_PREFERRED + +# +# Enable extra debug messages while performing textdumps. +# +options TEXTDUMP_VERBOSE + +# # NO_SYSCTL_DESCR omits the sysctl node descriptions to save space in the # resulting kernel. options NO_SYSCTL_DESCR Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Thu Nov 1 03:45:33 2012 (r242423) +++ head/sys/conf/options Thu Nov 1 04:07:08 2012 (r242424) @@ -61,6 +61,8 @@ KDB_TRACE opt_kdb.h KDB_UNATTENDED opt_kdb.h KLD_DEBUG opt_kld.h SYSCTL_DEBUG opt_sysctl.h +TEXTDUMP_PREFERRED opt_ddb.h +TEXTDUMP_VERBOSE opt_ddb.h # Miscellaneous options. ADAPTIVE_LOCKMGRS Modified: head/sys/ddb/db_command.c ============================================================================== --- head/sys/ddb/db_command.c Thu Nov 1 03:45:33 2012 (r242423) +++ head/sys/ddb/db_command.c Thu Nov 1 04:07:08 2012 (r242424) @@ -535,6 +535,11 @@ db_dump(db_expr_t dummy, boolean_t dummy { int error; + if (textdump_pending) { + db_printf("textdump_pending set.\n" + "run \"textdump unset\" first or \"textdump dump\" for a textdump.\n"); + return; + } error = doadump(FALSE); if (error) { db_printf("Cannot dump: "); Modified: head/sys/ddb/db_textdump.c ============================================================================== --- head/sys/ddb/db_textdump.c Thu Nov 1 03:45:33 2012 (r242423) +++ head/sys/ddb/db_textdump.c Thu Nov 1 04:07:08 2012 (r242424) @@ -61,6 +61,8 @@ __FBSDID("$FreeBSD$"); #include "opt_config.h" +#include "opt_ddb.h" + #include #include #include @@ -118,7 +120,11 @@ CTASSERT(sizeof(struct ustar_header) == * Is a textdump scheduled? If so, the shutdown code will invoke our dumpsys * routine instead of the machine-dependent kernel dump routine. */ -int textdump_pending; +#ifdef TEXTDUMP_PREFERRED +int textdump_pending = 1; +#else +int textdump_pending = 0; +#endif SYSCTL_INT(_debug_ddb_textdump, OID_AUTO, pending, CTLFLAG_RW, &textdump_pending, 0, "Perform textdump instead of regular kernel dump."); @@ -201,6 +207,10 @@ textdump_mkustar(char *block_buffer, con { struct ustar_header *uhp; +#ifdef TEXTDUMP_VERBOSE + if (textdump_error == 0) + printf("textdump: creating '%s'.\n", filename); +#endif uhp = (struct ustar_header *)block_buffer; bzero(uhp, sizeof(*uhp)); strlcpy(uhp->uh_filename, filename, sizeof(uhp->uh_filename)); @@ -237,6 +247,9 @@ textdump_writeblock(struct dumperinfo *d return (ENOSPC); textdump_error = dump_write(di, buffer, 0, offset + di->mediaoffset, TEXTDUMP_BLOCKSIZE); + if (textdump_error) + printf("textdump_writeblock: offset %jd, error %d\n", (intmax_t)offset, + textdump_error); return (textdump_error); } @@ -430,7 +443,7 @@ textdump_dumpsys(struct dumperinfo *di) * of data. */ if (di->mediasize < SIZEOF_METADATA + 2 * sizeof(kdh)) { - printf("Insufficient space on dump partition.\n"); + printf("Insufficient space on dump partition for minimal textdump.\n"); return; } textdump_error = 0; @@ -480,9 +493,9 @@ textdump_dumpsys(struct dumperinfo *di) if (textdump_error == 0) (void)dump_write(di, NULL, 0, 0, 0); if (textdump_error == ENOSPC) - printf("Insufficient space on dump partition\n"); + printf("Textdump: Insufficient space on dump partition\n"); else if (textdump_error != 0) - printf("Error %d writing dump\n", textdump_error); + printf("Textdump: Error %d writing dump\n", textdump_error); else printf("Textdump complete.\n"); textdump_pending = 0; @@ -499,7 +512,7 @@ static void db_textdump_usage(void) { - db_printf("textdump [unset|set|status]\n"); + db_printf("textdump [unset|set|status|dump]\n"); } void @@ -528,6 +541,10 @@ db_textdump_cmd(db_expr_t addr, boolean_ } else if (strcmp(db_tok_string, "unset") == 0) { textdump_pending = 0; db_printf("textdump unset\n"); - } else + } else if (strcmp(db_tok_string, "dump") == 0) { + textdump_pending = 1; + doadump(TRUE); + } else { db_textdump_usage(); + } } From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 05:39:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 109581ABF; Thu, 1 Nov 2012 05:39: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 EC9478FC08; Thu, 1 Nov 2012 05:39:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA15dLRj026528; Thu, 1 Nov 2012 05:39:21 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA15dLjs026526; Thu, 1 Nov 2012 05:39:21 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211010539.qA15dLjs026526@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 1 Nov 2012 05:39:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242425 - head/sys/dev/ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 05:39:22 -0000 Author: yongari Date: Thu Nov 1 05:39:21 2012 New Revision: 242425 URL: http://svn.freebsd.org/changeset/base/242425 Log: Remove TCP/UDP checksum offloading feature for IP fragmented datagrams. Traditionally upper stack fragmented packets without computing TCP/UDP checksum and these datagrams were passed to driver. But there are chances that other packets slip into the interface queue in SMP world. If this happens firmware running on MIPS 4000 processor in the controller would see mixed packets and it shall send out corrupted packets. While I'm here simplify checksum offloading setup. MFC After: 1 week Modified: head/sys/dev/ti/if_ti.c Modified: head/sys/dev/ti/if_ti.c ============================================================================== --- head/sys/dev/ti/if_ti.c Thu Nov 1 04:07:08 2012 (r242424) +++ head/sys/dev/ti/if_ti.c Thu Nov 1 05:39:21 2012 (r242425) @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); #include -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) /* * We can only turn on header splitting if we're using extended receive * BDs. @@ -3082,16 +3082,10 @@ ti_encap(struct ti_softc *sc, struct mbu m = *m_head; csum_flags = 0; - if (m->m_pkthdr.csum_flags) { - if (m->m_pkthdr.csum_flags & CSUM_IP) - csum_flags |= TI_BDFLAG_IP_CKSUM; - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) - csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; - if (m->m_flags & M_LASTFRAG) - csum_flags |= TI_BDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= TI_BDFLAG_IP_FRAG; - } + if (m->m_pkthdr.csum_flags & CSUM_IP) + csum_flags |= TI_BDFLAG_IP_CKSUM; + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) + csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; frag = sc->ti_tx_saved_prodidx; for (i = 0; i < nseg; i++) { From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 06:02:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EB17F6A; Thu, 1 Nov 2012 06:02:27 +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 BAA258FC18; Thu, 1 Nov 2012 06:02:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA162RTn029453; Thu, 1 Nov 2012 06:02:27 GMT (envelope-from yongari@svn.freebsd.org) Received: (from yongari@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA162R3w029451; Thu, 1 Nov 2012 06:02:27 GMT (envelope-from yongari@svn.freebsd.org) Message-Id: <201211010602.qA162R3w029451@svn.freebsd.org> From: Pyun YongHyeon Date: Thu, 1 Nov 2012 06:02:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242426 - head/sys/dev/bge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 06:02:28 -0000 Author: yongari Date: Thu Nov 1 06:02:27 2012 New Revision: 242426 URL: http://svn.freebsd.org/changeset/base/242426 Log: TCP/UDP checksum offloading feature for IP fragmented datagram was removed in r99417. bge(4) controllers can do TCP checksum offload for IP fragmented datagrams but unlike ti(4), it lacks UDP checksum offloading for IP fragmented datagrams. The problem was bge(4) blindly requested TCP/UDP checksum for IP fragmented datagrams such that it resulted in corrupted UDP datagrams before r99417. Remove remaining code for TCP checksum offloading for IP fragmented datagrams which should have been removed in r99417. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Thu Nov 1 05:39:21 2012 (r242425) +++ head/sys/dev/bge/if_bge.c Thu Nov 1 06:02:27 2012 (r242426) @@ -5103,10 +5103,6 @@ bge_encap(struct bge_softc *sc, struct m return (error); } } - if (m->m_flags & M_LASTFRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG_END; - else if (m->m_flags & M_FRAG) - csum_flags |= BGE_TXBDFLAG_IP_FRAG; } if ((m->m_pkthdr.csum_flags & CSUM_TSO) == 0) { @@ -5228,29 +5224,6 @@ bge_start_locked(struct ifnet *ifp) break; /* - * XXX - * The code inside the if() block is never reached since we - * must mark CSUM_IP_FRAGS in our if_hwassist to start getting - * requests to checksum TCP/UDP in a fragmented packet. - * - * XXX - * safety overkill. If this is a fragmented packet chain - * with delayed TCP/UDP checksums, then only encapsulate - * it if we have enough descriptors to handle the entire - * chain at once. - * (paranoia -- may not actually be needed) - */ - if (m_head->m_flags & M_FIRSTFRAG && - m_head->m_pkthdr.csum_flags & (CSUM_DELAY_DATA)) { - if ((BGE_TX_RING_CNT - sc->bge_txcnt) < - m_head->m_pkthdr.csum_data + 16) { - IFQ_DRV_PREPEND(&ifp->if_snd, m_head); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; - break; - } - } - - /* * Pack the data into the transmit ring. If we * don't have room, set the OACTIVE flag and wait * for the NIC to drain the ring. From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 06:16:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0CCDD295; Thu, 1 Nov 2012 06:16:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id BF0BD8FC14; Thu, 1 Nov 2012 06:16:43 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so1075754dad.13 for ; Wed, 31 Oct 2012 23:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=bytR9rDmCkLV0rt8fijchQxfDtfZx6q8zZRrsHx6Dwg=; b=Qs1g7sy7j4WBnNJZUkaSjN36HhOXLWAXu6FMyEQhDKnYZhbmCSMO5XqZPt7v5cetjl VwW1l4JFnnz7yOwG/Eghhm0wjvN8pJBUNU4sHpec/s3TbHlqCxccyQiTatKm7HMf+qHO IvvA4fvaUSWarONC7IEcyrh6/OwNhBgJL7TsM12xkY8pX4ZOOY2aDDxXY1/iLAVxhcvf y207r+r0AlYofrnwJfQUM91wHrlb74wplf0c2wxkIUjZdwyAXsr5jFRm35MnJEwsdVz5 AShnzsPV57K5XhEjIgbDpjjx8TICcphgf6yF83PX/qxI7Fp3tTaiSetb1TYjj6nT+AX5 LMGw== MIME-Version: 1.0 Received: by 10.68.137.198 with SMTP id qk6mr119369105pbb.60.1351750603040; Wed, 31 Oct 2012 23:16:43 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Wed, 31 Oct 2012 23:16:43 -0700 (PDT) In-Reply-To: <201211010539.qA15dLjs026526@svn.freebsd.org> References: <201211010539.qA15dLjs026526@svn.freebsd.org> Date: Wed, 31 Oct 2012 23:16:43 -0700 X-Google-Sender-Auth: CaxxeHGtwm1_ibhF6X6p8OdrAsQ Message-ID: Subject: Re: svn commit: r242425 - head/sys/dev/ti From: Adrian Chadd To: Pyun YongHyeon Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 06:16:44 -0000 so where'd this happen? interleaved TX nowdays via if_transmit() ? Adrian On 31 October 2012 22:39, Pyun YongHyeon wrote: > Author: yongari > Date: Thu Nov 1 05:39:21 2012 > New Revision: 242425 > URL: http://svn.freebsd.org/changeset/base/242425 > > Log: > Remove TCP/UDP checksum offloading feature for IP fragmented > datagrams. Traditionally upper stack fragmented packets without > computing TCP/UDP checksum and these datagrams were passed to > driver. But there are chances that other packets slip into the > interface queue in SMP world. If this happens firmware running on > MIPS 4000 processor in the controller would see mixed packets and > it shall send out corrupted packets. > While I'm here simplify checksum offloading setup. > > MFC After: 1 week > > Modified: > head/sys/dev/ti/if_ti.c > > Modified: head/sys/dev/ti/if_ti.c > ============================================================================== > --- head/sys/dev/ti/if_ti.c Thu Nov 1 04:07:08 2012 (r242424) > +++ head/sys/dev/ti/if_ti.c Thu Nov 1 05:39:21 2012 (r242425) > @@ -127,7 +127,7 @@ __FBSDID("$FreeBSD$"); > > #include > > -#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP | CSUM_IP_FRAGS) > +#define TI_CSUM_FEATURES (CSUM_IP | CSUM_TCP | CSUM_UDP) > /* > * We can only turn on header splitting if we're using extended receive > * BDs. > @@ -3082,16 +3082,10 @@ ti_encap(struct ti_softc *sc, struct mbu > > m = *m_head; > csum_flags = 0; > - if (m->m_pkthdr.csum_flags) { > - if (m->m_pkthdr.csum_flags & CSUM_IP) > - csum_flags |= TI_BDFLAG_IP_CKSUM; > - if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) > - csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; > - if (m->m_flags & M_LASTFRAG) > - csum_flags |= TI_BDFLAG_IP_FRAG_END; > - else if (m->m_flags & M_FRAG) > - csum_flags |= TI_BDFLAG_IP_FRAG; > - } > + if (m->m_pkthdr.csum_flags & CSUM_IP) > + csum_flags |= TI_BDFLAG_IP_CKSUM; > + if (m->m_pkthdr.csum_flags & (CSUM_TCP | CSUM_UDP)) > + csum_flags |= TI_BDFLAG_TCP_UDP_CKSUM; > > frag = sc->ti_tx_saved_prodidx; > for (i = 0; i < nseg; i++) { From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 07:07:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67853D3D; Thu, 1 Nov 2012 07:07:13 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 1A2AF8FC08; Thu, 1 Nov 2012 07:07:12 +0000 (UTC) Received: by mail-pb0-f54.google.com with SMTP id rp8so1643311pbb.13 for ; Thu, 01 Nov 2012 00:07:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=XbYvdjvkk/Dkud9PW7SArXYhOXgH1Enc5wDCiJ9kpx8=; b=jgQVPwBG48Vf7v1XtyNmPCBwfq4G7VA5tVaI5QMZ02DK5QCG9CrZz7ZbsMFwhLz4uK z06jVrxtq+FYqtUt9qsSMpsDaevNLntmUs6r0aTP7OVFoN+eFjjF5dxy5CmVbG9uAm14 WvTUgmj38iwg4NyvRElA9GXdtpxSMQF27UjxExW96IFOl9x8ZlyaeXUhQazElM8hMGoO d8zBk9S8jbFF/W35SNBI+6kHrGFPFUdrit0vpuGc4NYYrxlHzXUwpy3yMTN6tl2/XKjl kvTCfBHxnMp/ITmDuM/SqjfJz7w4f441X04r+d2VSwFa/SatLhEsKR+QKrHWT+Z0iFWH 2qKA== Received: by 10.68.191.200 with SMTP id ha8mr37957087pbc.51.1351753632640; Thu, 01 Nov 2012 00:07:12 -0700 (PDT) Received: from pyunyh@gmail.com (lpe4.p59-icn.cdngp.net. [114.111.62.249]) by mx.google.com with ESMTPS id lb3sm3578255pbc.73.2012.11.01.00.07.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 01 Nov 2012 00:07:11 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Thu, 01 Nov 2012 16:06:42 +0900 From: YongHyeon PYUN Date: Thu, 1 Nov 2012 16:06:42 +0900 To: Adrian Chadd Subject: Re: svn commit: r242425 - head/sys/dev/ti Message-ID: <20121101070642.GB1545@michelle.cdnetworks.com> References: <201211010539.qA15dLjs026526@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Pyun YongHyeon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: pyunyh@gmail.com List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 07:07:13 -0000 On Wed, Oct 31, 2012 at 11:16:43PM -0700, Adrian Chadd wrote: > so where'd this happen? interleaved TX nowdays via if_transmit() ? > if_output after fragmentation. > > > Adrian > > On 31 October 2012 22:39, Pyun YongHyeon wrote: > > Author: yongari > > Date: Thu Nov 1 05:39:21 2012 > > New Revision: 242425 > > URL: http://svn.freebsd.org/changeset/base/242425 > > > > Log: > > Remove TCP/UDP checksum offloading feature for IP fragmented > > datagrams. Traditionally upper stack fragmented packets without > > computing TCP/UDP checksum and these datagrams were passed to > > driver. But there are chances that other packets slip into the > > interface queue in SMP world. If this happens firmware running on > > MIPS 4000 processor in the controller would see mixed packets and > > it shall send out corrupted packets. > > While I'm here simplify checksum offloading setup. From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 07:51:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B6473ED; Thu, 1 Nov 2012 07:51:51 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 650AD8FC0C; Thu, 1 Nov 2012 07:51:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA17ppRi043320; Thu, 1 Nov 2012 07:51:51 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA17pp9a043318; Thu, 1 Nov 2012 07:51:51 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211010751.qA17pp9a043318@svn.freebsd.org> From: Joel Dahl Date: Thu, 1 Nov 2012 07:51:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242427 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 07:51:51 -0000 Author: joel (doc committer) Date: Thu Nov 1 07:51:50 2012 New Revision: 242427 URL: http://svn.freebsd.org/changeset/base/242427 Log: Minor mdoc fix. Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Thu Nov 1 06:02:27 2012 (r242426) +++ head/share/man/man4/textdump.4 Thu Nov 1 07:51:50 2012 (r242427) @@ -149,7 +149,7 @@ sets textdumps to be the default manner will be no need to .Xr sysctl 8 or use the -.Cr textdump set +.Ic textdump set .Xr ddb 8 commands. .It Cd TEXTDUMP_VERBOSE From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 07:53:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 584455D4; Thu, 1 Nov 2012 07:53:22 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 418868FC08; Thu, 1 Nov 2012 07:53:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA17rMvN043646; Thu, 1 Nov 2012 07:53:22 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA17rM5E043644; Thu, 1 Nov 2012 07:53:22 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211010753.qA17rM5E043644@svn.freebsd.org> From: Joel Dahl Date: Thu, 1 Nov 2012 07:53:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242428 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 07:53:22 -0000 Author: joel (doc committer) Date: Thu Nov 1 07:53:21 2012 New Revision: 242428 URL: http://svn.freebsd.org/changeset/base/242428 Log: Nuke whitespace. Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Thu Nov 1 07:51:50 2012 (r242427) +++ head/share/man/man4/textdump.4 Thu Nov 1 07:53:21 2012 (r242428) @@ -36,7 +36,6 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB - .Cd options TEXTDUMP_VERBOSE .Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION @@ -121,7 +120,7 @@ sysctl to 1 using it is possible to request that the next dump be a textdump. One can also directly trigger a textdump in .Xr ddb 4 -by running the command +by running the command .Ic textdump dump . .Pp If at the @@ -144,7 +143,7 @@ Additional kernel .Xr config 8 options: .Bl -tag -width TEXTDUMP_PREFERRED -.It Cd TEXTDUMP_PREFERRED +.It Cd TEXTDUMP_PREFERRED sets textdumps to be the default manner of doing dumps. This means there will be no need to .Xr sysctl 8 From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 09:38:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32D1B6B7; Thu, 1 Nov 2012 09:38:29 +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 1BD968FC0C; Thu, 1 Nov 2012 09:38:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA19cSga061341; Thu, 1 Nov 2012 09:38:28 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA19cS8U061338; Thu, 1 Nov 2012 09:38:28 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211010938.qA19cS8U061338@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 1 Nov 2012 09:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242429 - head/lib/libc/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 09:38:29 -0000 Author: jilles Date: Thu Nov 1 09:38:28 2012 New Revision: 242429 URL: http://svn.freebsd.org/changeset/base/242429 Log: fcntl(2): Fix typos in name of constant "F_DUP2FD_CLOEXEC". MFC after: 1 week Modified: head/lib/libc/sys/fcntl.2 Modified: head/lib/libc/sys/fcntl.2 ============================================================================== --- head/lib/libc/sys/fcntl.2 Thu Nov 1 07:53:21 2012 (r242428) +++ head/lib/libc/sys/fcntl.2 Thu Nov 1 09:38:28 2012 (r242429) @@ -94,7 +94,7 @@ It is functionally equivalent to .Bd -literal -offset indent dup2(fd, arg) .Ed -.It Dv F_DU2PFD_CLOEXEC +.It Dv F_DUP2FD_CLOEXEC Like .Dv F_DUP2FD , but the @@ -104,7 +104,7 @@ flag associated with the new file descri The .Dv F_DUP2FD and -.Dv F_DUP2DF_CLOEXEC +.Dv F_DUP2FD_CLOEXEC constants are not portable, so they should not be used if portability is needed. Use From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 10:08:27 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E7934C0D; Thu, 1 Nov 2012 10:08:27 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 5E3148FC0A; Thu, 1 Nov 2012 10:08:27 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qA1A8ERX051970; Thu, 1 Nov 2012 14:08:14 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qA1A8EC4051969; Thu, 1 Nov 2012 14:08:14 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 1 Nov 2012 14:08:14 +0400 From: Gleb Smirnoff To: Attilio Rao Subject: Re: svn commit: r242402 - in head/sys: kern vm Message-ID: <20121101100814.GB70741@FreeBSD.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Ian Lepore , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 10:08:28 -0000 On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: A> > Doesn't this padding to cache line size only help x86 processors in an A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't pay A> > a big price for no gain in small-memory ARM systems and such. But maybe A> > I'm misunderstanding the reason for the padding. A> A> I didn't want to do this because this would be meaning that SMP option A> may become a completely killer for modules/kernel ABI compatibility. Do we support loading non-SMP modules on SMP kernel and vice versa? -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 10:42:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3706F265; Thu, 1 Nov 2012 10:42:15 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1AC2E8FC0A; Thu, 1 Nov 2012 10:42:13 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so2198076lbd.13 for ; Thu, 01 Nov 2012 03:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=++2DOmMY1eVylm043dNOoZwiH72DMI07hpP0CjY5kPw=; b=dvv+6aEoCHawdX/Q7t3LdUfrDwHQF0Pqvz11SQ7J2UXMxg8r1UYCWjK0p8rXAEE5Gr rd9UW2k5dVlUno99w6n0A5c2f82lN3sXt9f0+8CdcsHUV4y4VYof5dKuz69pKMIUoc4w fGES734rDW7FkzmBVdF2UGQ0qao7ExL21E9DGbJ3R/bg7ywgvjM1H5Pq2BFsr4qokr3J gp3SwR1PbLUlfhIQBTdwvi7Ty/IyYnC1EG+WWpxE4TE2lJ848pntIEaD2Ze95enG0Rwf kiy/H3ixumYdivCksXevkF3wAMKXwRJlVSwlIlKafDCidBTyJygmjptbXqBY1UgWE1D4 VH3A== MIME-Version: 1.0 Received: by 10.112.41.36 with SMTP id c4mr15042418lbl.75.1351766527139; Thu, 01 Nov 2012 03:42:07 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 03:42:07 -0700 (PDT) In-Reply-To: <20121101100814.GB70741@FreeBSD.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> Date: Thu, 1 Nov 2012 10:42:07 +0000 X-Google-Sender-Auth: znGBs9oeJoOPTzs8g_KKQMH8omc Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Gleb Smirnoff Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 10:42:15 -0000 On 11/1/12, Gleb Smirnoff wrote: > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: > A> > Doesn't this padding to cache line size only help x86 processors in an > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't > pay > A> > a big price for no gain in small-memory ARM systems and such. But > maybe > A> > I'm misunderstanding the reason for the padding. > A> > A> I didn't want to do this because this would be meaning that SMP option > A> may become a completely killer for modules/kernel ABI compatibility. > > Do we support loading non-SMP modules on SMP kernel and vice versa? Actually that's my point, we do. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 11:38:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C870E70; Thu, 1 Nov 2012 11:38:35 +0000 (UTC) (envelope-from gabor@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E57598FC18; Thu, 1 Nov 2012 11:38:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1BcYqT082894; Thu, 1 Nov 2012 11:38:34 GMT (envelope-from gabor@svn.freebsd.org) Received: (from gabor@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1BcYxU082884; Thu, 1 Nov 2012 11:38:34 GMT (envelope-from gabor@svn.freebsd.org) Message-Id: <201211011138.qA1BcYxU082884@svn.freebsd.org> From: Gabor Kovesdan Date: Thu, 1 Nov 2012 11:38:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242430 - head/usr.bin/sort X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 11:38:35 -0000 Author: gabor Date: Thu Nov 1 11:38:34 2012 New Revision: 242430 URL: http://svn.freebsd.org/changeset/base/242430 Log: - Portability changes for ARM - Allow larger sort memory on 64-bit platforms Submitted by: Oleg Moskalenko Modified: head/usr.bin/sort/bwstring.c head/usr.bin/sort/bwstring.h head/usr.bin/sort/coll.c head/usr.bin/sort/coll.h head/usr.bin/sort/file.c head/usr.bin/sort/file.h head/usr.bin/sort/radixsort.c head/usr.bin/sort/sort.c head/usr.bin/sort/sort.h Modified: head/usr.bin/sort/bwstring.c ============================================================================== --- head/usr.bin/sort/bwstring.c Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/bwstring.c Thu Nov 1 11:38:34 2012 (r242430) @@ -69,7 +69,7 @@ initialise_months(void) continue; if (debug_sort) printf("month[%d]=%s\n", i, tmp); - len = strlen(tmp); + len = strlen((char*)tmp); if (len < 1) continue; while (isblank(*tmp)) @@ -95,13 +95,13 @@ initialise_months(void) continue; if (debug_sort) printf("month[%d]=%s\n", i, tmp); - len = strlen(tmp); + len = strlen((char*)tmp); if (len < 1) continue; while (isblank(*tmp)) ++tmp; m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1)); - if (mbstowcs(m, tmp, len) == ((size_t) -1)) + if (mbstowcs(m, (char*)tmp, len) == ((size_t) -1)) continue; m[len] = L'\0'; for (unsigned int j = 0; j < len; j++) @@ -421,7 +421,7 @@ bwsnocpy(struct bwstring *dst, const str * The output is ended either with '\n' (nl == true) * or '\0' (nl == false). */ -int +size_t bwsfwrite(struct bwstring *bws, FILE *f, bool zero_ended) { @@ -442,11 +442,11 @@ bwsfwrite(struct bwstring *bws, FILE *f, } else { wchar_t eols; - int printed = 0; + size_t printed = 0; eols = zero_ended ? btowc('\0') : btowc('\n'); - while (printed < (int) BWSLEN(bws)) { + while (printed < BWSLEN(bws)) { const wchar_t *s = bws->data.wstr + printed; if (*s == L'\0') { @@ -479,7 +479,7 @@ bwsfwrite(struct bwstring *bws, FILE *f, struct bwstring * bwsfgetln(FILE *f, size_t *len, bool zero_ended, struct reader_buffer *rb) { - wchar_t eols; + wint_t eols; eols = zero_ended ? btowc('\0') : btowc('\n'); @@ -494,7 +494,7 @@ bwsfgetln(FILE *f, size_t *len, bool zer return (NULL); } if (*len > 0) { - if (ret[*len - 1] == eols) + if (ret[*len - 1] == (wchar_t)eols) --(*len); } return (bwssbdup(ret, *len)); @@ -513,11 +513,9 @@ bwsfgetln(FILE *f, size_t *len, bool zer if (ret[*len - 1] == '\n') --(*len); } - return (bwscsbdup(ret, *len)); + return (bwscsbdup((unsigned char*)ret, *len)); } else { - wchar_t c = 0; - *len = 0; if (feof(f)) @@ -532,6 +530,8 @@ bwsfgetln(FILE *f, size_t *len, bool zer if (MB_CUR_MAX == 1) while (!feof(f)) { + int c; + c = fgetc(f); if (c == EOF) { @@ -553,6 +553,8 @@ bwsfgetln(FILE *f, size_t *len, bool zer } else while (!feof(f)) { + wint_t c = 0; + c = fgetwc(f); if (c == WEOF) { @@ -750,7 +752,7 @@ bwscoll(const struct bwstring *bws1, con } else if (s2[i] == 0) return (+1); - res = strcoll(s1 + i, s2 + i); + res = strcoll((const char*)(s1 + i), (const char*)(s2 + i)); if (res) return (res); @@ -872,7 +874,7 @@ bwstod(struct bwstring *s0, bool *empty) return (0); } - ret = strtod(s, &ep); + ret = strtod((char*)s, &ep); if ((unsigned char*) ep == s) { *empty = true; return (0); @@ -923,11 +925,11 @@ bws_month_score(const struct bwstring *s while (isblank(*s) && s < end) ++s; - len = strlen(s); + len = strlen((const char*)s); for (int i = 11; i >= 0; --i) { if (cmonths[i] && - (s == (unsigned char*)strstr(s, cmonths[i]))) + (s == (unsigned char*)strstr((const char*)s, (char*)(cmonths[i])))) return (i); } Modified: head/usr.bin/sort/bwstring.h ============================================================================== --- head/usr.bin/sort/bwstring.h Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/bwstring.h Thu Nov 1 11:38:34 2012 (r242430) @@ -93,7 +93,7 @@ struct bwstring *bwsnocpy(struct bwstrin int bwscmp(const struct bwstring *bws1, const struct bwstring *bws2, size_t offset); int bwsncmp(const struct bwstring *bws1, const struct bwstring *bws2, size_t offset, size_t len); int bwscoll(const struct bwstring *bws1, const struct bwstring *bws2, size_t offset); -int bwsfwrite(struct bwstring *bws, FILE *f, bool zero_ended); +size_t bwsfwrite(struct bwstring *bws, FILE *f, bool zero_ended); struct bwstring *bwsfgetln(FILE *file, size_t *len, bool zero_ended, struct reader_buffer *rb); static inline bwstring_iterator Modified: head/usr.bin/sort/coll.c ============================================================================== --- head/usr.bin/sort/coll.c Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/coll.c Thu Nov 1 11:38:34 2012 (r242430) @@ -47,11 +47,11 @@ __FBSDID("$FreeBSD$"); struct key_specs *keys; size_t keys_num = 0; -wchar_t symbol_decimal_point = L'.'; +wint_t symbol_decimal_point = L'.'; /* there is no default thousands separator in collate rules: */ -wchar_t symbol_thousands_sep = 0; -wchar_t symbol_negative_sign = L'-'; -wchar_t symbol_positive_sign = L'+'; +wint_t symbol_thousands_sep = 0; +wint_t symbol_negative_sign = L'-'; +wint_t symbol_positive_sign = L'+'; static int wstrcoll(struct key_value *kv1, struct key_value *kv2, size_t offset); static int gnumcoll(struct key_value*, struct key_value *, size_t offset); @@ -260,7 +260,7 @@ skip_fields_to_start(const struct bwstri while (cpos < BWSLEN(s)) { bool isblank; - isblank = iswblank(BWS_GET(s,cpos)); + isblank = iswblank(BWS_GET(s, cpos)); if (isblank && !pb) { --fields; @@ -277,7 +277,7 @@ skip_fields_to_start(const struct bwstri size_t cpos = 0; while (cpos < BWSLEN(s)) { - if (BWS_GET(s,cpos) == sort_opts_vals.field_sep) { + if (BWS_GET(s,cpos) == (wchar_t)sort_opts_vals.field_sep) { --fields; if (fields <= 1) return (cpos + 1); @@ -328,7 +328,7 @@ find_field_end(const struct bwstring *s, next_field_start = skip_fields_to_start(s, f2 + 1, &empty_field); if ((next_field_start > 0) && sort_opts_vals.tflag && - (sort_opts_vals.field_sep == BWS_GET(s, + ((wchar_t)sort_opts_vals.field_sep == BWS_GET(s, next_field_start - 1))) --next_field_start; } else @@ -699,7 +699,7 @@ static void setsuffix(wchar_t c, unsigne * point is in sfrac, tail is the pointer to the remainder of the string. */ static int -read_number(struct bwstring *s0, int *sign, wchar_t *smain, int *main_len, wchar_t *sfrac, int *frac_len, unsigned char *si) +read_number(struct bwstring *s0, int *sign, wchar_t *smain, size_t *main_len, wchar_t *sfrac, size_t *frac_len, unsigned char *si) { bwstring_iterator s; @@ -711,7 +711,7 @@ read_number(struct bwstring *s0, int *si while (iswblank(bws_get_iter_value(s))) s = bws_iterator_inc(s, 1); - if (bws_get_iter_value(s) == symbol_negative_sign) { + if (bws_get_iter_value(s) == (wchar_t)symbol_negative_sign) { *sign = -1; s = bws_iterator_inc(s, 1); } @@ -727,7 +727,7 @@ read_number(struct bwstring *s0, int *si s = bws_iterator_inc(s, 1); *main_len += 1; } else if (symbol_thousands_sep && - (bws_get_iter_value(s) == symbol_thousands_sep)) + (bws_get_iter_value(s) == (wchar_t)symbol_thousands_sep)) s = bws_iterator_inc(s, 1); else break; @@ -735,7 +735,7 @@ read_number(struct bwstring *s0, int *si smain[*main_len] = 0; - if (bws_get_iter_value(s) == symbol_decimal_point) { + if (bws_get_iter_value(s) == (wchar_t)symbol_decimal_point) { s = bws_iterator_inc(s, 1); while (iswdigit(bws_get_iter_value(s)) && *frac_len < MAX_NUM_SIZE) { @@ -798,7 +798,8 @@ numcoll_impl(struct key_value *kv1, stru struct bwstring *s1, *s2; wchar_t sfrac1[MAX_NUM_SIZE + 1], sfrac2[MAX_NUM_SIZE + 1]; wchar_t smain1[MAX_NUM_SIZE + 1], smain2[MAX_NUM_SIZE + 1]; - int cmp_res, frac1, frac2, main1, main2, sign1, sign2; + int cmp_res, sign1, sign2; + size_t frac1, frac2, main1, main2; unsigned char SI1, SI2; bool e1, e2, key1_read, key2_read; Modified: head/usr.bin/sort/coll.h ============================================================================== --- head/usr.bin/sort/coll.h Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/coll.h Thu Nov 1 11:38:34 2012 (r242430) @@ -133,12 +133,12 @@ extern struct key_specs *keys; extern size_t keys_num; /* - * Main localised symbols + * Main localised symbols. These must be wint_t as they may hold WEOF. */ -extern wchar_t symbol_decimal_point; -extern wchar_t symbol_thousands_sep; -extern wchar_t symbol_negative_sign; -extern wchar_t symbol_positive_sign; +extern wint_t symbol_decimal_point; +extern wint_t symbol_thousands_sep; +extern wint_t symbol_negative_sign; +extern wint_t symbol_positive_sign; /* funcs */ Modified: head/usr.bin/sort/file.c ============================================================================== --- head/usr.bin/sort/file.c Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/file.c Thu Nov 1 11:38:34 2012 (r242430) @@ -229,7 +229,7 @@ read_file0_line(struct file0_reader *f0r char * new_tmp_file_name(void) { - static unsigned int tfcounter = 0; + static size_t tfcounter = 0; static const char *fn = ".bsdsort."; char *ret; size_t sz; @@ -237,7 +237,7 @@ new_tmp_file_name(void) sz = strlen(tmpdir) + 1 + strlen(fn) + 32 + 1; ret = sort_malloc(sz); - sprintf(ret, "%s/%s%d.%u", tmpdir, fn, (int) getpid(), tfcounter++); + sprintf(ret, "%s/%s%d.%lu", tmpdir, fn, (int) getpid(), (unsigned long)(tfcounter++)); tmp_file_atexit(ret); return (ret); } @@ -300,7 +300,7 @@ file_list_clean(struct file_list *fl) if (fl) { if (fl->fns) { - int i; + size_t i; for (i = 0; i < fl->count; i++) { if (fl->fns[i]) { @@ -345,7 +345,7 @@ sort_list_add(struct sort_list *l, struc size_t indx = l->count; if ((l->list == NULL) || (indx >= l->size)) { - int newsize = (l->size + 1) + 1024; + size_t newsize = (l->size + 1) + 1024; l->list = sort_realloc(l->list, sizeof(struct sort_list_item*) * newsize); @@ -439,7 +439,8 @@ check(const char *fn) struct bwstring *s1, *s2, *s1disorder, *s2disorder; struct file_reader *fr; struct keys_array *ka1, *ka2; - int res, pos, posdisorder; + int res; + size_t pos, posdisorder; s1 = s2 = s1disorder = s2disorder = NULL; ka1 = ka2 = NULL; @@ -979,7 +980,7 @@ file_header_close(struct file_header **f * Swap two array elements */ static void -file_header_swap(struct file_header **fh, int i1, int i2) +file_header_swap(struct file_header **fh, size_t i1, size_t i2) { struct file_header *tmp; @@ -995,11 +996,11 @@ file_header_swap(struct file_header **fh * "Raises" last element to its right place */ static void -file_header_heap_swim(struct file_header **fh, int indx) +file_header_heap_swim(struct file_header **fh, size_t indx) { if (indx > 0) { - int parent_index; + size_t parent_index; parent_index = (indx - 1) >> 1; @@ -1015,16 +1016,16 @@ file_header_heap_swim(struct file_header * Sink the top element to its correct position */ static void -file_header_heap_sink(struct file_header **fh, int indx, int size) +file_header_heap_sink(struct file_header **fh, size_t indx, size_t size) { - int left_child_index; - int right_child_index; + size_t left_child_index; + size_t right_child_index; left_child_index = indx + indx + 1; right_child_index = left_child_index + 1; if (left_child_index < size) { - int min_child_index; + size_t min_child_index; min_child_index = left_child_index; @@ -1045,7 +1046,7 @@ file_header_heap_sink(struct file_header * Adds element to the "left" end */ static void -file_header_list_rearrange_from_header(struct file_header **fh, int size) +file_header_list_rearrange_from_header(struct file_header **fh, size_t size) { file_header_heap_sink(fh, 0, size); @@ -1055,7 +1056,7 @@ file_header_list_rearrange_from_header(s * Adds element to the "right" end */ static void -file_header_list_push(struct file_header *f, struct file_header **fh, int size) +file_header_list_push(struct file_header *f, struct file_header **fh, size_t size) { fh[size++] = f; @@ -1118,10 +1119,10 @@ file_header_read_next(struct file_header * Merge array of "files headers" */ static void -file_headers_merge(int fnum, struct file_header **fh, FILE *f_out) +file_headers_merge(size_t fnum, struct file_header **fh, FILE *f_out) { struct last_printed lp; - int i; + size_t i; memset(&lp, 0, sizeof(lp)); @@ -1149,13 +1150,13 @@ file_headers_merge(int fnum, struct file * stdout. */ static void -merge_files_array(int argc, char **argv, const char *fn_out) +merge_files_array(size_t argc, char **argv, const char *fn_out) { if (argv && fn_out) { struct file_header **fh; FILE *f_out; - int i; + size_t i; f_out = openfile(fn_out, "w"); @@ -1189,12 +1190,12 @@ shrink_file_list(struct file_list *fl) return (0); else { struct file_list new_fl; - int indx = 0; + size_t indx = 0; file_list_init(&new_fl, true); while (indx < fl->count) { char *fnew; - int num; + size_t num; num = fl->count - indx; fnew = new_tmp_file_name(); @@ -1203,7 +1204,7 @@ shrink_file_list(struct file_list *fl) num = max_open_files - 1; merge_files_array(num, fl->fns + indx, fnew); if (fl->tmp) { - int i; + size_t i; for (i = 0; i < num; i++) unlink(fl->fns[indx + i]); @@ -1379,7 +1380,7 @@ sub_list_cmp(struct sort_list *l1, struc * Swap two array elements */ static void -sub_list_swap(struct sort_list **sl, int i1, int i2) +sub_list_swap(struct sort_list **sl, size_t i1, size_t i2) { struct sort_list *tmp; @@ -1395,11 +1396,11 @@ sub_list_swap(struct sort_list **sl, int * "Raises" last element to its right place */ static void -sub_list_swim(struct sort_list **sl, int indx) +sub_list_swim(struct sort_list **sl, size_t indx) { if (indx > 0) { - int parent_index; + size_t parent_index; parent_index = (indx - 1) >> 1; @@ -1415,16 +1416,16 @@ sub_list_swim(struct sort_list **sl, int * Sink the top element to its correct position */ static void -sub_list_sink(struct sort_list **sl, int indx, int size) +sub_list_sink(struct sort_list **sl, size_t indx, size_t size) { - int left_child_index; - int right_child_index; + size_t left_child_index; + size_t right_child_index; left_child_index = indx + indx + 1; right_child_index = left_child_index + 1; if (left_child_index < size) { - int min_child_index; + size_t min_child_index; min_child_index = left_child_index; @@ -1445,7 +1446,7 @@ sub_list_sink(struct sort_list **sl, int * Adds element to the "right" end */ static void -sub_list_push(struct sort_list *s, struct sort_list **sl, int size) +sub_list_push(struct sort_list *s, struct sort_list **sl, size_t size) { sl[size++] = s; Modified: head/usr.bin/sort/file.h ============================================================================== --- head/usr.bin/sort/file.h Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/file.h Thu Nov 1 11:38:34 2012 (r242430) @@ -65,8 +65,8 @@ struct file_reader; struct file_list { char **fns; - int count; - int sz; + size_t count; + size_t sz; bool tmp; }; Modified: head/usr.bin/sort/radixsort.c ============================================================================== --- head/usr.bin/sort/radixsort.c Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/radixsort.c Thu Nov 1 11:38:34 2012 (r242430) @@ -203,7 +203,7 @@ pop_ls_mt(void) } static void -add_to_sublevel(struct sort_level *sl, struct sort_list_item *item, int indx) +add_to_sublevel(struct sort_level *sl, struct sort_list_item *item, size_t indx) { struct sort_level *ssl; Modified: head/usr.bin/sort/sort.c ============================================================================== --- head/usr.bin/sort/sort.c Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/sort.c Thu Nov 1 11:38:34 2012 (r242430) @@ -117,7 +117,7 @@ static bool print_symbols_on_debug; /* * Arguments from file (when file0-from option is used: */ -static int argc_from_file0 = -1; +static size_t argc_from_file0 = (size_t)-1; static char **argv_from_file0; /* @@ -244,9 +244,9 @@ read_fns_from_file0(const char *fn) char *line = read_file0_line(&f0r); if (line && *line) { + if (argc_from_file0 == (size_t)-1) + argc_from_file0 = 0; ++argc_from_file0; - if (argc_from_file0 < 1) - argc_from_file0 = 1; argv_from_file0 = sort_realloc(argv_from_file0, argc_from_file0 * sizeof(char *)); if (argv_from_file0 == NULL) @@ -1221,7 +1221,7 @@ main(int argc, char **argv) ks->sm.func = get_sort_func(&(ks->sm)); } - if (argc_from_file0 >= 0) { + if (argv_from_file0) { argc = argc_from_file0; argv = argv_from_file0; } Modified: head/usr.bin/sort/sort.h ============================================================================== --- head/usr.bin/sort/sort.h Thu Nov 1 09:38:28 2012 (r242429) +++ head/usr.bin/sort/sort.h Thu Nov 1 11:38:34 2012 (r242430) @@ -77,7 +77,7 @@ extern MD5_CTX md5_ctx; */ struct sort_opts { - wchar_t field_sep; + wint_t field_sep; int sort_method; bool cflag; bool csilentflag; From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 11:53:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 40FE415A; Thu, 1 Nov 2012 11:53:58 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 166AD8FC16; Thu, 1 Nov 2012 11:53:56 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so2224754lag.13 for ; Thu, 01 Nov 2012 04:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=eBiDGbmdEblKpbypZdVhbRj23WeMKNrdKCB52MSdhXI=; b=diIc4As7vuDzHXTZifCiG0jpbuNGL6SdJr1PW8EMsWTkXGpLTVwJsiV2tQ9u9ByCyw Nwm530RhZtcklYv7QO4xueg7iBCSN3cRphSagvIOKO1jWgeIBFPGqZuExJcTvHnoiZ3Q uWoIsj7LSr/0elel26m3tAXM9kd+DFEt5JiiA7V0pWLdl5y0uBiLFzW/e0sX9+/3D7kS wROC21mJqqDTVvGgZnkHNDuvPnCzo64oTWgvuy7zWKonMa90JdaBNBCSQ+IuYEffs2KV Vi7sjWZ+WFbHJ/iKHgkErFpFOQn5Eut2ycvioejrYWgzA+ZUZteHFALZ/Q4jk5mpvOFR N6xQ== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr14469547lab.15.1351770835426; Thu, 01 Nov 2012 04:53:55 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 04:53:55 -0700 (PDT) In-Reply-To: <50918FEC.3070602@freebsd.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <50918FEC.3070602@freebsd.org> Date: Thu, 1 Nov 2012 11:53:55 +0000 X-Google-Sender-Auth: GND0Z4KyMdgcWcjZFwPNW7OTfF0 Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Andre Oppermann Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 11:53:58 -0000 On 10/31/12, Andre Oppermann wrote: > On 31.10.2012 19:10, Attilio Rao wrote: >> On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: >>> Author: attilio >>> Date: Wed Oct 31 18:07:18 2012 >>> New Revision: 242402 >>> URL: http://svn.freebsd.org/changeset/base/242402 >>> >>> Log: >>> Rework the known mutexes to benefit about staying on their own >>> cache line in order to avoid manual frobbing but using >>> struct mtx_padalign. >> >> Interested developers can now dig and look for other mutexes to >> convert and just do it. >> Please, however, try to enclose a description about the benchmark >> which lead you believe the necessity to pad the mutex and possibly >> some numbers, in particular when the lock belongs to structures or the >> ABI itself. >> >> Next steps involve porting the same mtx(9) changes to rwlock(9) and >> port pvh global pmap lock to rwlock_padalign. > > I'd say for an rwlock you can make it unconditional. The very purpose > of it is to be aquired by multiple CPU's causing cache line dirtying > for every concurrent reader. Rwlocks are only ever used because multiple > concurrent readers are expected. I thought about it, but I think the same arguments as for mutexes remains. The real problem is that having default rwlocks pad-aligned will put showstoppers for their usage in sensitive structures. For example, I have plans to use them in vm_object at some point to replace VM_OBJECT_LOCK and I do want to avoid the extra-bloat for such structures. Also, please keep in mind that there is no direct relation between "read acquisition" and "high contention" with the latter being the real reason for having pad-aligned locks. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 12:26:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BA0B8A6; Thu, 1 Nov 2012 12:26:32 +0000 (UTC) (envelope-from cognet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 133B08FC0C; Thu, 1 Nov 2012 12:26:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1CQV5N090656; Thu, 1 Nov 2012 12:26:31 GMT (envelope-from cognet@svn.freebsd.org) Received: (from cognet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1CQVDb090654; Thu, 1 Nov 2012 12:26:31 GMT (envelope-from cognet@svn.freebsd.org) Message-Id: <201211011226.qA1CQVDb090654@svn.freebsd.org> From: Olivier Houchard Date: Thu, 1 Nov 2012 12:26:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242431 - head/sys/arm/mv/armadaxp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 12:26:32 -0000 Author: cognet Date: Thu Nov 1 12:26:31 2012 New Revision: 242431 URL: http://svn.freebsd.org/changeset/base/242431 Log: Fix build for SMP. Submitted by: Giovanni Trematerra Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c Modified: head/sys/arm/mv/armadaxp/armadaxp_mp.c ============================================================================== --- head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Nov 1 11:38:34 2012 (r242430) +++ head/sys/arm/mv/armadaxp/armadaxp_mp.c Thu Nov 1 12:26:31 2012 (r242431) @@ -179,7 +179,7 @@ platform_mp_start_ap(void) for (cpu_num = 1; cpu_num < mp_ncpus; cpu_num++ ) bus_space_write_4(fdtbus_bs_tag, CPU_PMU(cpu_num), CPU_PMU_BOOT, - pmap_kextract(mpentry)); + pmap_kextract((vm_offset_t)mpentry)); cpu_idcache_wbinv_all(); From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:01:17 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 104E7A35; Thu, 1 Nov 2012 14:01:17 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id CADB88FC1F; Thu, 1 Nov 2012 14:01:16 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA1E1FQ5045485; Thu, 1 Nov 2012 08:01:15 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA1E1CpI007711; Thu, 1 Nov 2012 08:01:12 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Ian Lepore To: attilio@FreeBSD.org In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> Content-Type: text/plain; charset="us-ascii" Date: Thu, 01 Nov 2012 08:01:12 -0600 Message-ID: <1351778472.1120.117.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:01:17 -0000 On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: > On 11/1/12, Gleb Smirnoff wrote: > > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: > > A> > Doesn't this padding to cache line size only help x86 processors in an > > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't > > pay > > A> > a big price for no gain in small-memory ARM systems and such. But > > maybe > > A> > I'm misunderstanding the reason for the padding. > > A> > > A> I didn't want to do this because this would be meaning that SMP option > > A> may become a completely killer for modules/kernel ABI compatibility. > > > > Do we support loading non-SMP modules on SMP kernel and vice versa? > > Actually that's my point, we do. > > Attilio > > Well we've got other similar problems lurking then. What about a module compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then it gets run on a different arm system whose kernel is compiled with #define CACHE_LINE_SIZE 64? -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:05:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D0E9FB7B; Thu, 1 Nov 2012 14:05:46 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id AC17B8FC12; Thu, 1 Nov 2012 14:05:45 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so2366193lbd.13 for ; Thu, 01 Nov 2012 07:05:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=q4TqSL0uQbxwJnLq3zAQOChNaWRVD5OeOkbccO3a5Bk=; b=qyoNWe4a0y1Qn7dHefuBb+xaCKE37ug9XBDet6o2ATu24KLA7H6hzOmYk3bQvCIQyW 8O/28ThgpRJ0+GYD6a6i/nP7ZqK3G/t6U96m4bpgwqOsxNz05NS5a46aDcaIKBIjSpg9 W9b/NiXnbyoLrsKF/aIUoAuQZYWcWUki0x7um1EZp28S1pb5odCcJEMGczHZKeGBzlzx A1uRZ9MklXTKjhEKOsV/mGm2IjZdzLbYKpbwUZ8lFkjf1nSPaTUk85Jc2mAqwqszTIo0 dWVLABaetM3zoZXdrSbn5QCTMtSUnJqJfagXP8IpBrnJ+MhF6NtHFD/WaVjCR0i/wXjC 1Sjw== MIME-Version: 1.0 Received: by 10.152.110.234 with SMTP id id10mr14865643lab.15.1351778744194; Thu, 01 Nov 2012 07:05:44 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 07:05:44 -0700 (PDT) In-Reply-To: <1351778472.1120.117.camel@revolution.hippie.lan> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> Date: Thu, 1 Nov 2012 14:05:44 +0000 X-Google-Sender-Auth: S8VdgtNcY-MpZHkRpLVXMncOh80 Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:05:46 -0000 On Thu, Nov 1, 2012 at 2:01 PM, Ian Lepore wrote: > On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: >> On 11/1/12, Gleb Smirnoff wrote: >> > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: >> > A> > Doesn't this padding to cache line size only help x86 processors in an >> > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't >> > pay >> > A> > a big price for no gain in small-memory ARM systems and such. But >> > maybe >> > A> > I'm misunderstanding the reason for the padding. >> > A> >> > A> I didn't want to do this because this would be meaning that SMP option >> > A> may become a completely killer for modules/kernel ABI compatibility. >> > >> > Do we support loading non-SMP modules on SMP kernel and vice versa? >> >> Actually that's my point, we do. >> >> Attilio >> >> > > Well we've got other similar problems lurking then. What about a module > compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then > it gets run on a different arm system whose kernel is compiled with > #define CACHE_LINE_SIZE 64? That should not happen. Is that a real case where you build a module for an ARM family and want to run against a kernel compiled for another? CACHE_LINE_SIZE must not change during a STABLE release lifetime, of course, for the same arch. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:07:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51C19CA7; Thu, 1 Nov 2012 14:07:03 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 213D38FC18; Thu, 1 Nov 2012 14:07:01 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so2341011lag.13 for ; Thu, 01 Nov 2012 07:07:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=ZbvoZVD6PoGVODhVgoXDU2WloSSzpIDTKx/J3sMmeRQ=; b=uhuhg+fIDYhyb69kCP6qRyqaEwCrfAdF7E2KlrktCJc1GAQoMzag/vq284AyAg8lxz IxAeHnosXsJWVGqp1WvYLNIAuiOOj2qpUpB63ZRnLMDs+mJO2EKlvu0rLtrM/c5XNFoE iKfW2Te1QMi8gfeTHLfWantNpJPk34K+vAMZ0y25PL2Z1Jhmzvx7D5eOM3mdwsVwvS8F uA0e+4r7+3RFDg6WWuuCOAsHdYF2OvPAIzFUAuWDCvi6TfbfdAYqDGOC1rAk73LSwjsj 2jsPAIhmn9WHQmLwI+HmNGQWS0osxA4WQLW7z3Svu+NfphAAh93nGEkc06YXBgElbL01 u42A== MIME-Version: 1.0 Received: by 10.112.47.129 with SMTP id d1mr15818957lbn.115.1351778820698; Thu, 01 Nov 2012 07:07:00 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 07:07:00 -0700 (PDT) In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> Date: Thu, 1 Nov 2012 14:07:00 +0000 X-Google-Sender-Auth: 1N0fgANgwHO93Zd9D8cNYmnQPJs Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:07:03 -0000 On Thu, Nov 1, 2012 at 2:05 PM, Attilio Rao wrote: > On Thu, Nov 1, 2012 at 2:01 PM, Ian Lepore > wrote: >> On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: >>> On 11/1/12, Gleb Smirnoff wrote: >>> > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: >>> > A> > Doesn't this padding to cache line size only help x86 processors in an >>> > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't >>> > pay >>> > A> > a big price for no gain in small-memory ARM systems and such. But >>> > maybe >>> > A> > I'm misunderstanding the reason for the padding. >>> > A> >>> > A> I didn't want to do this because this would be meaning that SMP option >>> > A> may become a completely killer for modules/kernel ABI compatibility. >>> > >>> > Do we support loading non-SMP modules on SMP kernel and vice versa? >>> >>> Actually that's my point, we do. >>> >>> Attilio >>> >>> >> >> Well we've got other similar problems lurking then. What about a module >> compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then >> it gets run on a different arm system whose kernel is compiled with >> #define CACHE_LINE_SIZE 64? > > That should not happen. Is that a real case where you build a module > for an ARM family and want to run against a kernel compiled for > another? Besides that, the ARM CACHE_LINE_SIZE is defined in the shared headers so there is no way this can be a problem. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:29:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8C699B for ; Thu, 1 Nov 2012 14:29:49 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 2879C8FC0C for ; Thu, 1 Nov 2012 14:29:48 +0000 (UTC) Received: (qmail 79366 invoked from network); 1 Nov 2012 16:06:09 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Nov 2012 16:06:09 -0000 Message-ID: <50928755.6070401@freebsd.org> Date: Thu, 01 Nov 2012 15:29:41 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: attilio@FreeBSD.org Subject: Re: svn commit: r242402 - in head/sys: kern vm References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <50918FEC.3070602@freebsd.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:29:49 -0000 On 01.11.2012 12:53, Attilio Rao wrote: > On 10/31/12, Andre Oppermann wrote: >> On 31.10.2012 19:10, Attilio Rao wrote: >>> On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao wrote: >>>> Author: attilio >>>> Date: Wed Oct 31 18:07:18 2012 >>>> New Revision: 242402 >>>> URL: http://svn.freebsd.org/changeset/base/242402 >>>> >>>> Log: >>>> Rework the known mutexes to benefit about staying on their own >>>> cache line in order to avoid manual frobbing but using >>>> struct mtx_padalign. >>> >>> Interested developers can now dig and look for other mutexes to >>> convert and just do it. >>> Please, however, try to enclose a description about the benchmark >>> which lead you believe the necessity to pad the mutex and possibly >>> some numbers, in particular when the lock belongs to structures or the >>> ABI itself. >>> >>> Next steps involve porting the same mtx(9) changes to rwlock(9) and >>> port pvh global pmap lock to rwlock_padalign. >> >> I'd say for an rwlock you can make it unconditional. The very purpose >> of it is to be aquired by multiple CPU's causing cache line dirtying >> for every concurrent reader. Rwlocks are only ever used because multiple >> concurrent readers are expected. > > I thought about it, but I think the same arguments as for mutexes remains. > The real problem is that having default rwlocks pad-aligned will put > showstoppers for their usage in sensitive structures. For example, I > have plans to use them in vm_object at some point to replace > VM_OBJECT_LOCK and I do want to avoid the extra-bloat for such > structures. > > Also, please keep in mind that there is no direct relation between > "read acquisition" and "high contention" with the latter being the > real reason for having pad-aligned locks. I do not agree. If there is no contention then there is no need for a rwlock, a normal mutex would be sufficient. A rwlock is used when multiple concurrent readers are expected. Each read lock and unlock dirties the cache line for all other CPU's. Please note that I don't want to prevent you from doing the work all over for rwlocks. It's just that the use case for a non-padded rwlock is very narrow. -- Andre From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:37:18 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BFD0E24B; Thu, 1 Nov 2012 14:37:18 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 84D708FC12; Thu, 1 Nov 2012 14:37:18 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA1EbHx3046401; Thu, 1 Nov 2012 08:37:17 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA1EbF6a007731; Thu, 1 Nov 2012 08:37:15 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Ian Lepore To: attilio@FreeBSD.org In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Thu, 01 Nov 2012 08:37:15 -0600 Message-ID: <1351780635.1120.135.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:37:18 -0000 On Thu, 2012-11-01 at 14:07 +0000, Attilio Rao wrote: > On Thu, Nov 1, 2012 at 2:05 PM, Attilio Rao wrote: > > On Thu, Nov 1, 2012 at 2:01 PM, Ian Lepore > > wrote: > >> On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: > >>> On 11/1/12, Gleb Smirnoff wrote: > >>> > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: > >>> > A> > Doesn't this padding to cache line size only help x86 processors in an > >>> > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we don't > >>> > pay > >>> > A> > a big price for no gain in small-memory ARM systems and such. But > >>> > maybe > >>> > A> > I'm misunderstanding the reason for the padding. > >>> > A> > >>> > A> I didn't want to do this because this would be meaning that SMP option > >>> > A> may become a completely killer for modules/kernel ABI compatibility. > >>> > > >>> > Do we support loading non-SMP modules on SMP kernel and vice versa? > >>> > >>> Actually that's my point, we do. > >>> > >>> Attilio > >>> > >>> > >> > >> Well we've got other similar problems lurking then. What about a module > >> compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then > >> it gets run on a different arm system whose kernel is compiled with > >> #define CACHE_LINE_SIZE 64? > > > > That should not happen. Is that a real case where you build a module > > for an ARM family and want to run against a kernel compiled for > > another? > > Besides that, the ARM CACHE_LINE_SIZE is defined in the shared headers > so there is no way this can be a problem. I've been under the impression that in the ARM and MIPS worlds, the cache line size can change from one family/series of chips to another, just as support for SMP can change from one family to another. If I'm not mistaken in that assumption, then there can't be something like a generic arm module that will run on any arm kernel regardless of how the kernel was built, not if compile-time constants get cooked into the binaries in a way that affects the ABI/KBI. Back from some quick googling... yep, arm cortex-a8 processors have a 64-byte cache line size. Maybe we don't support those yet, which is why the value appears to be constant in arm param.h right now. -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:39:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A45F343C for ; Thu, 1 Nov 2012 14:39:37 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id E01C38FC12 for ; Thu, 1 Nov 2012 14:39:36 +0000 (UTC) Received: (qmail 79419 invoked from network); 1 Nov 2012 16:15:58 -0000 Received: from c00l3r.networx.ch (HELO [127.0.0.1]) ([62.48.2.2]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 1 Nov 2012 16:15:58 -0000 Message-ID: <509289A2.7080304@freebsd.org> Date: Thu, 01 Nov 2012 15:39:30 +0100 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: Jack F Vogel Subject: Re: svn commit: r242421 - head/sys/dev/ixgbe References: <201210312350.q9VNoaAa065183@svn.freebsd.org> In-Reply-To: <201210312350.q9VNoaAa065183@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:39:37 -0000 On 01.11.2012 00:50, Jack F Vogel wrote: > Author: jfv > Date: Wed Oct 31 23:50:36 2012 > New Revision: 242421 > URL: http://svn.freebsd.org/changeset/base/242421 > > Log: > A few important fixes: > - Testing TSO6 has led me to discover that HW RSC is > a problematic feature, it is ONLY designed to work > with IPv4 in the first place, and if IP forwarding > is done it can't be disabled as LRO in the stack, > also initial testing we've done at Intel shows an > equal performance using TSO[46] on the TX and LRO > on RX, if you ran older code on 82599 or later hardware > you actually could have detrimental performance for > this reason. So I am disabling the feature by default > and all our adapters will now use LRO instead. Yes, it's very important that LRO is *not* used when forwarding is enabled (= acting as a router). > - If you have flow control off and multiple queues it > was possible when the buffer of one queue becomes > full that all RX movement is stalled, to eliminate > this problem a feature bit is now set that will allow > packets to be dropped when full rather than stall. > Note, the default is to have flow control on, and this > keeps this from happening. > > - Because of the recent fixes in the stack, LRO is now > auto-disabled when problematic, so I have decided to > enable it by default in the capabilities in the driver. A very important cautionary note here: LRO is only good when combined with very low RTTs (that is in LAN environments). On everything over 5ms is breaks the TCP ACK clock badly and performance will suffer greatly. This is because every ACK increases the congestion window. With a greatly reduced ACK rate the ramping up of CWND on startup and after a loss event is severely limited. Combined with ABC (appropriate byte counting) where the CWND increases only once per ACK by at most one MSS the effect is greatly pronounced as well. The higher the RTT goes the worse the effects become. I haven't checked yet whether our soft-LRO does ACK compression or not. If it does, we need a workaround and some tcp_input magic to reduce the negative impact. I'm looking into it. > - There are some 1G modules used by some customers, a couple > small tweaks to properly support those in the media code. > > - A note: we have now done some testing of TSO6 and using > LRO with IPv6 and it all works great!! Seeing line rate > in both directions in best cases. Thanks bz for your > excellent work!! Indeed! > Modified: > head/sys/dev/ixgbe/ixgbe.c -- Andre From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:43:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 120148A6; Thu, 1 Nov 2012 14:43:24 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id C99D28FC0A; Thu, 1 Nov 2012 14:43:22 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so2403124lbd.13 for ; Thu, 01 Nov 2012 07:43:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=8L77GiuJ7oB8jSdZepK0e1DEz1pBJQaH1etANJxkxfY=; b=BQ0l0LtXtTSc4V4sL/lVeZj41rgzIXRNdXzkwTy4mP8zpwe/91NUu4bOqg/Tn8MznW DRm56P9C54gTZBOxh1i6Wrux768sQLX4fm2fyv9OMQgGPvy6GTUnUUCA7NSe0LGpscbp gS7Ed5ySc0Arwy6hH66sSM3D8wHWqUuPHTq9QEkSiy1eazo3JJwx/iOfSDHhEtlpF2dB 0XCkQ1VJbX1zA08LFwUdlPdsXwPUEjj5Y5i193XV+tXBWIhUa4WKy4emmCXJqc+kaiov 9ekuNFvPyidqdZ8WYqmZNKidYNQ2TZEi4y7TmjqJCLsms3WlobrdIU1ba2XYn17UvLZT 3Sfg== MIME-Version: 1.0 Received: by 10.112.82.103 with SMTP id h7mr15977545lby.50.1351781001319; Thu, 01 Nov 2012 07:43:21 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 07:43:21 -0700 (PDT) In-Reply-To: <1351780635.1120.135.camel@revolution.hippie.lan> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> <1351780635.1120.135.camel@revolution.hippie.lan> Date: Thu, 1 Nov 2012 14:43:21 +0000 X-Google-Sender-Auth: U2LAWiSGNQxXDkUCTD8JQAoZVfY Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Ian Lepore Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Gleb Smirnoff , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:43:24 -0000 On 11/1/12, Ian Lepore wrote: > On Thu, 2012-11-01 at 14:07 +0000, Attilio Rao wrote: >> On Thu, Nov 1, 2012 at 2:05 PM, Attilio Rao wrote: >> > On Thu, Nov 1, 2012 at 2:01 PM, Ian Lepore >> > wrote: >> >> On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: >> >>> On 11/1/12, Gleb Smirnoff wrote: >> >>> > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: >> >>> > A> > Doesn't this padding to cache line size only help x86 >> >>> > processors in an >> >>> > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we >> >>> > don't >> >>> > pay >> >>> > A> > a big price for no gain in small-memory ARM systems and such. >> >>> > But >> >>> > maybe >> >>> > A> > I'm misunderstanding the reason for the padding. >> >>> > A> >> >>> > A> I didn't want to do this because this would be meaning that SMP >> >>> > option >> >>> > A> may become a completely killer for modules/kernel ABI >> >>> > compatibility. >> >>> > >> >>> > Do we support loading non-SMP modules on SMP kernel and vice versa? >> >>> >> >>> Actually that's my point, we do. >> >>> >> >>> Attilio >> >>> >> >>> >> >> >> >> Well we've got other similar problems lurking then. What about a >> >> module >> >> compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then >> >> it gets run on a different arm system whose kernel is compiled with >> >> #define CACHE_LINE_SIZE 64? >> > >> > That should not happen. Is that a real case where you build a module >> > for an ARM family and want to run against a kernel compiled for >> > another? >> >> Besides that, the ARM CACHE_LINE_SIZE is defined in the shared headers >> so there is no way this can be a problem. > > I've been under the impression that in the ARM and MIPS worlds, the > cache line size can change from one family/series of chips to another, > just as support for SMP can change from one family to another. If I'm > not mistaken in that assumption, then there can't be something like a > generic arm module that will run on any arm kernel regardless of how the > kernel was built, not if compile-time constants get cooked into the > binaries in a way that affects the ABI/KBI. I'm far from being an ARM expert so I trust what you say. This only means you cannot build a module for a family and expect to retain ABI compatibility among all the ARM families. If cache-lines are different I don't think there is much we can do, which has nothing to do with pad-align locking. Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 14:49:30 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9C290C78; Thu, 1 Nov 2012 14:49:30 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 5FB908FC0A; Thu, 1 Nov 2012 14:49:30 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA1EnTci046699; Thu, 1 Nov 2012 08:49:29 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA1EnRYn007754; Thu, 1 Nov 2012 08:49:27 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Ian Lepore To: attilio@FreeBSD.org In-Reply-To: References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> <1351780635.1120.135.camel@revolution.hippie.lan> Content-Type: text/plain; charset="us-ascii" Date: Thu, 01 Nov 2012 08:49:27 -0600 Message-ID: <1351781367.1120.140.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Gleb Smirnoff , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 14:49:30 -0000 On Thu, 2012-11-01 at 14:43 +0000, Attilio Rao wrote: > On 11/1/12, Ian Lepore wrote: > > On Thu, 2012-11-01 at 14:07 +0000, Attilio Rao wrote: > >> On Thu, Nov 1, 2012 at 2:05 PM, Attilio Rao wrote: > >> > On Thu, Nov 1, 2012 at 2:01 PM, Ian Lepore > >> > wrote: > >> >> On Thu, 2012-11-01 at 10:42 +0000, Attilio Rao wrote: > >> >>> On 11/1/12, Gleb Smirnoff wrote: > >> >>> > On Wed, Oct 31, 2012 at 06:33:51PM +0000, Attilio Rao wrote: > >> >>> > A> > Doesn't this padding to cache line size only help x86 > >> >>> > processors in an > >> >>> > A> > SMP kernel? I was expecting to see some #ifdef SMP so that we > >> >>> > don't > >> >>> > pay > >> >>> > A> > a big price for no gain in small-memory ARM systems and such. > >> >>> > But > >> >>> > maybe > >> >>> > A> > I'm misunderstanding the reason for the padding. > >> >>> > A> > >> >>> > A> I didn't want to do this because this would be meaning that SMP > >> >>> > option > >> >>> > A> may become a completely killer for modules/kernel ABI > >> >>> > compatibility. > >> >>> > > >> >>> > Do we support loading non-SMP modules on SMP kernel and vice versa? > >> >>> > >> >>> Actually that's my point, we do. > >> >>> > >> >>> Attilio > >> >>> > >> >>> > >> >> > >> >> Well we've got other similar problems lurking then. What about a > >> >> module > >> >> compiled on an arm system that had #define CACHE_LINE_SIZE 32 and then > >> >> it gets run on a different arm system whose kernel is compiled with > >> >> #define CACHE_LINE_SIZE 64? > >> > > >> > That should not happen. Is that a real case where you build a module > >> > for an ARM family and want to run against a kernel compiled for > >> > another? > >> > >> Besides that, the ARM CACHE_LINE_SIZE is defined in the shared headers > >> so there is no way this can be a problem. > > > > I've been under the impression that in the ARM and MIPS worlds, the > > cache line size can change from one family/series of chips to another, > > just as support for SMP can change from one family to another. If I'm > > not mistaken in that assumption, then there can't be something like a > > generic arm module that will run on any arm kernel regardless of how the > > kernel was built, not if compile-time constants get cooked into the > > binaries in a way that affects the ABI/KBI. > > I'm far from being an ARM expert so I trust what you say. > This only means you cannot build a module for a family and expect to > retain ABI compatibility among all the ARM families. If cache-lines > are different I don't think there is much we can do, which has nothing > to do with pad-align locking. > I do a lot of work with armv4 and recently v5 chips, but nothing with the v6/v7 stuff yet, so I'm not really an expert on these issues either. I've heard some talk from the folks working on arm v6/v7 support about things like unified kernels and an arm GENERIC kernel config, but I'm pretty hazy myself on how that vision is shaping up. -- Ian From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 15:14:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EBF482B6; Thu, 1 Nov 2012 15:14: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 D1F618FC08; Thu, 1 Nov 2012 15:14:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1FEbxC018271; Thu, 1 Nov 2012 15:14:37 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1FEbOJ018266; Thu, 1 Nov 2012 15:14:37 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211011514.qA1FEbOJ018266@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 1 Nov 2012 15:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242432 - in head/sys: amd64/amd64 amd64/include x86/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 15:14:38 -0000 Author: kib Date: Thu Nov 1 15:14:37 2012 New Revision: 242432 URL: http://svn.freebsd.org/changeset/base/242432 Log: Provide the reading and display of the Standard Extended Features, introduced with the IvyBridge CPUs. Provide the definitions for new bits in CR3 and CR4 registers. Tested by: avg, Michael Moll MFC after: 2 weeks Modified: head/sys/amd64/amd64/identcpu.c head/sys/amd64/amd64/initcpu.c head/sys/amd64/include/md_var.h head/sys/x86/include/specialreg.h Modified: head/sys/amd64/amd64/identcpu.c ============================================================================== --- head/sys/amd64/amd64/identcpu.c Thu Nov 1 12:26:31 2012 (r242431) +++ head/sys/amd64/amd64/identcpu.c Thu Nov 1 15:14:37 2012 (r242432) @@ -384,6 +384,18 @@ printcpuinfo(void) ); } + if (cpu_stdext_feature != 0) { + printf("\n Standard Extended Features=0x%b", + cpu_stdext_feature, + "\020" + "\001GSFSBASE" + "\002TSCADJ" + "\010SMEP" + "\012ENHMOVSB" + "\013INVPCID" + ); + } + if (via_feature_rng != 0 || via_feature_xcrypt != 0) print_via_padlock_info(); @@ -501,6 +513,11 @@ identify_cpu(void) } } + if (cpu_high >= 7) { + cpuid_count(7, 0, regs); + cpu_stdext_feature = regs[1]; + } + if (cpu_vendor_id == CPU_VENDOR_INTEL || cpu_vendor_id == CPU_VENDOR_AMD || cpu_vendor_id == CPU_VENDOR_CENTAUR) { Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu Nov 1 12:26:31 2012 (r242431) +++ head/sys/amd64/amd64/initcpu.c Thu Nov 1 15:14:37 2012 (r242432) @@ -72,6 +72,7 @@ u_int cpu_vendor_id; /* CPU vendor ID * u_int cpu_fxsr; /* SSE enabled */ u_int cpu_mxcsr_mask; /* Valid bits in mxcsr */ u_int cpu_clflush_line_size = 32; +u_int cpu_stdext_feature; u_int cpu_max_ext_state_size; SYSCTL_UINT(_hw, OID_AUTO, via_feature_rng, CTLFLAG_RD, Modified: head/sys/amd64/include/md_var.h ============================================================================== --- head/sys/amd64/include/md_var.h Thu Nov 1 12:26:31 2012 (r242431) +++ head/sys/amd64/include/md_var.h Thu Nov 1 15:14:37 2012 (r242432) @@ -48,6 +48,7 @@ extern u_int amd_pminfo; extern u_int via_feature_rng; extern u_int via_feature_xcrypt; extern u_int cpu_clflush_line_size; +extern u_int cpu_stdext_feature; extern u_int cpu_fxsr; extern u_int cpu_high; extern u_int cpu_id; Modified: head/sys/x86/include/specialreg.h ============================================================================== --- head/sys/x86/include/specialreg.h Thu Nov 1 12:26:31 2012 (r242431) +++ head/sys/x86/include/specialreg.h Thu Nov 1 15:14:37 2012 (r242432) @@ -52,6 +52,8 @@ #define CR0_NW 0x20000000 /* Not Write-through */ #define CR0_CD 0x40000000 /* Cache Disable */ +#define CR3_PCID_SAVE 0x8000000000000000 + /* * Bits in PPro special registers */ @@ -66,7 +68,10 @@ #define CR4_PCE 0x00000100 /* Performance monitoring counter enable */ #define CR4_FXSR 0x00000200 /* Fast FPU save/restore used by OS */ #define CR4_XMM 0x00000400 /* enable SIMD/MMX2 to use except 16 */ +#define CR4_FSGSBASE 0x00010000 /* Enable FS/GS BASE accessing instructions */ +#define CR4_PCIDE 0x00020000 /* Enable Context ID */ #define CR4_XSAVE 0x00040000 /* XSETBV/XGETBV */ +#define CR4_SMEP 0x00100000 /* Supervisor-Mode Execution Prevention */ /* * Bits in AMD64 special registers. EFER is 64 bits wide. @@ -272,6 +277,12 @@ #define AMDID_COREID_SIZE 0x0000f000 #define AMDID_COREID_SIZE_SHIFT 12 +#define CPUID_STDEXT_FSGSBASE 0x00000001 +#define CPUID_STDEXT_TSC_ADJUST 0x00000002 +#define CPUID_STDEXT_SMEP 0x00000080 +#define CPUID_STDEXT_ENH_MOVSB 0x00000200 +#define CPUID_STDEXT_INVPCID 0x00000400 + /* * CPUID manufacturers identifiers */ From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 15:17:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AC171440; Thu, 1 Nov 2012 15:17:44 +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 7AEAE8FC0A; Thu, 1 Nov 2012 15:17:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1FHi3m018812; Thu, 1 Nov 2012 15:17:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1FHiUe018809; Thu, 1 Nov 2012 15:17:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211011517.qA1FHiUe018809@svn.freebsd.org> From: Konstantin Belousov Date: Thu, 1 Nov 2012 15:17:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242433 - head/sys/amd64/amd64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 15:17:44 -0000 Author: kib Date: Thu Nov 1 15:17:43 2012 New Revision: 242433 URL: http://svn.freebsd.org/changeset/base/242433 Log: Enable the new instructions for reading and writing bases for %fs, %gs, when supported. Note that WRFSBASE and WRGSBASE are not very useful on FreeBSD right now, because a return from the kernel mode to userspace reloads the bases specified by the sysarch(2) syscall, most likely. Enable the Supervisor Mode Execution Prevention (SMEP) when supported. Since the loader(8) performs hand-off to the kernel with the page tables which contradict the SMEP, postpone enabling the SMEP on BSP until pmap switched for the proper kernel tables. Debugged with the help from: avg Tested by: avg, Michael Moll MFC after: 1 month Modified: head/sys/amd64/amd64/initcpu.c head/sys/amd64/amd64/pmap.c Modified: head/sys/amd64/amd64/initcpu.c ============================================================================== --- head/sys/amd64/amd64/initcpu.c Thu Nov 1 15:14:37 2012 (r242432) +++ head/sys/amd64/amd64/initcpu.c Thu Nov 1 15:17:43 2012 (r242433) @@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include @@ -153,11 +154,25 @@ void initializecpu(void) { uint64_t msr; + uint32_t cr4; + cr4 = rcr4(); if ((cpu_feature & CPUID_XMM) && (cpu_feature & CPUID_FXSR)) { - load_cr4(rcr4() | CR4_FXSR | CR4_XMM); + cr4 |= CR4_FXSR | CR4_XMM; cpu_fxsr = hw_instruction_sse = 1; } + if (cpu_stdext_feature & CPUID_STDEXT_FSGSBASE) + cr4 |= CR4_FSGSBASE; + + /* + * Postpone enabling the SMEP on the boot CPU until the page + * tables are switched from the boot loader identity mapping + * to the kernel tables. The boot loader enables the U bit in + * its tables. + */ + if (!IS_BSP() && (cpu_stdext_feature & CPUID_STDEXT_SMEP)) + cr4 |= CR4_SMEP; + load_cr4(cr4); if ((amd_feature & AMDID_NX) != 0) { msr = rdmsr(MSR_EFER) | EFER_NXE; wrmsr(MSR_EFER, msr); Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Thu Nov 1 15:14:37 2012 (r242432) +++ head/sys/amd64/amd64/pmap.c Thu Nov 1 15:17:43 2012 (r242433) @@ -622,6 +622,8 @@ pmap_bootstrap(vm_paddr_t *firstaddr) /* XXX do %cr0 as well */ load_cr4(rcr4() | CR4_PGE | CR4_PSE); load_cr3(KPML4phys); + if (cpu_stdext_feature & CPUID_STDEXT_SMEP) + load_cr4(rcr4() | CR4_SMEP); /* * Initialize the kernel pmap (which is statically allocated). From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 16:20:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7FD11D30; Thu, 1 Nov 2012 16:20:03 +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 67A068FC0C; Thu, 1 Nov 2012 16:20:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1GK3nV029235; Thu, 1 Nov 2012 16:20:03 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1GK3qX029232; Thu, 1 Nov 2012 16:20:03 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201211011620.qA1GK3qX029232@svn.freebsd.org> From: Alan Cox Date: Thu, 1 Nov 2012 16:20:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242434 - head/sys/vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 16:20:03 -0000 Author: alc Date: Thu Nov 1 16:20:02 2012 New Revision: 242434 URL: http://svn.freebsd.org/changeset/base/242434 Log: In general, we call pmap_remove_all() before calling vm_page_cache(). So, the call to pmap_remove_all() within vm_page_cache() is usually redundant. This change eliminates that call to pmap_remove_all() and introduces a call to pmap_remove_all() before vm_page_cache() in the one place where it didn't already exist. When iterating over a paging queue, if the object containing the current page has a zero reference count, then the page can't have any managed mappings. So, a call to pmap_remove_all() is pointless. Change a panic() call in vm_page_cache() to a KASSERT(). MFC after: 6 weeks Modified: head/sys/vm/vm_page.c head/sys/vm/vm_pageout.c Modified: head/sys/vm/vm_page.c ============================================================================== --- head/sys/vm/vm_page.c Thu Nov 1 15:17:43 2012 (r242433) +++ head/sys/vm/vm_page.c Thu Nov 1 16:20:02 2012 (r242434) @@ -2277,9 +2277,9 @@ vm_page_cache(vm_page_t m) if ((m->oflags & (VPO_UNMANAGED | VPO_BUSY)) || m->busy || m->hold_count || m->wire_count) panic("vm_page_cache: attempting to cache busy page"); - pmap_remove_all(m); - if (m->dirty != 0) - panic("vm_page_cache: page %p is dirty", m); + KASSERT(!pmap_page_is_mapped(m), + ("vm_page_cache: page %p is mapped", m)); + KASSERT(m->dirty == 0, ("vm_page_cache: page %p is dirty", m)); if (m->valid == 0 || object->type == OBJT_DEFAULT || (object->type == OBJT_SWAP && !vm_pager_has_page(object, m->pindex, NULL, NULL))) { Modified: head/sys/vm/vm_pageout.c ============================================================================== --- head/sys/vm/vm_pageout.c Thu Nov 1 15:17:43 2012 (r242433) +++ head/sys/vm/vm_pageout.c Thu Nov 1 16:20:02 2012 (r242434) @@ -594,7 +594,7 @@ vm_pageout_launder(int queue, int tries, continue; } vm_page_test_dirty(m); - if (m->dirty == 0) + if (m->dirty == 0 && object->ref_count != 0) pmap_remove_all(m); if (m->dirty != 0) { vm_page_unlock(m); @@ -1059,31 +1059,16 @@ vm_pageout_scan(int pass) } /* - * If the upper level VM system does not believe that the page - * is fully dirty, but it is mapped for write access, then we - * consult the pmap to see if the page's dirty status should - * be updated. + * If the page appears to be clean at the machine-independent + * layer, then remove all of its mappings from the pmap in + * anticipation of placing it onto the cache queue. If, + * however, any of the page's mappings allow write access, + * then the page may still be modified until the last of those + * mappings are removed. */ - if (m->dirty != VM_PAGE_BITS_ALL && - pmap_page_is_write_mapped(m)) { - /* - * Avoid a race condition: Unless write access is - * removed from the page, another processor could - * modify it before all access is removed by the call - * to vm_page_cache() below. If vm_page_cache() finds - * that the page has been modified when it removes all - * access, it panics because it cannot cache dirty - * pages. In principle, we could eliminate just write - * access here rather than all access. In the expected - * case, when there are no last instant modifications - * to the page, removing all access will be cheaper - * overall. - */ - if (pmap_is_modified(m)) - vm_page_dirty(m); - else if (m->dirty == 0) - pmap_remove_all(m); - } + vm_page_test_dirty(m); + if (m->dirty == 0 && object->ref_count != 0) + pmap_remove_all(m); if (m->valid == 0) { /* From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 16:39:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 86AC51E3; Thu, 1 Nov 2012 16:39:02 +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 6E98A8FC0C; Thu, 1 Nov 2012 16:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1Gd2BU032679; Thu, 1 Nov 2012 16:39:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1Gd2Vm032676; Thu, 1 Nov 2012 16:39:02 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211011639.qA1Gd2Vm032676@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 1 Nov 2012 16:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242435 - head/sys/dev/sound/pcm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 16:39:02 -0000 Author: hselasky Date: Thu Nov 1 16:39:01 2012 New Revision: 242435 URL: http://svn.freebsd.org/changeset/base/242435 Log: Add missing inclusion guard. Modified: head/sys/dev/sound/pcm/mixer.h Modified: head/sys/dev/sound/pcm/mixer.h ============================================================================== --- head/sys/dev/sound/pcm/mixer.h Thu Nov 1 16:20:02 2012 (r242434) +++ head/sys/dev/sound/pcm/mixer.h Thu Nov 1 16:39:01 2012 (r242435) @@ -27,6 +27,9 @@ * $FreeBSD$ */ +#ifndef _PCM_MIXER_H_ +#define _PCM_MIXER_H_ + struct snd_mixer *mixer_create(device_t dev, kobj_class_t cls, void *devinfo, const char *desc); int mixer_delete(struct snd_mixer *m); @@ -75,3 +78,5 @@ extern int mixer_count; sizeof(oss_mixer_enuminfo)) #define MIXER_DECLARE(name) static DEFINE_CLASS(name, name ## _methods, MIXER_SIZE) + +#endif /* _PCM_MIXER_H_ */ From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 16:54:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B106A76A; Thu, 1 Nov 2012 16:54:26 +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 96FEC8FC14; Thu, 1 Nov 2012 16:54:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1GsQle035572; Thu, 1 Nov 2012 16:54:26 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1GsQiF035570; Thu, 1 Nov 2012 16:54:26 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211011654.qA1GsQiF035570@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 1 Nov 2012 16:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242438 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 16:54:26 -0000 Author: hselasky Date: Thu Nov 1 16:54:26 2012 New Revision: 242438 URL: http://svn.freebsd.org/changeset/base/242438 Log: Export all mixer nodes into dev.pcm.X.mixer.Y sysctl nodes, hence the PCM API doesn't support showing all the knobs. Make sure all the USB audio mixer nodes are freed at detach. Before this patch USB audio would leak some memory at detach. Print out buffer sizes in number of samples at attach. Fix setting of volume controls when the number of channels is greater than two. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Nov 1 16:52:00 2012 (r242437) +++ head/sys/dev/sound/usb/uaudio.c Thu Nov 1 16:54:26 2012 (r242438) @@ -71,6 +71,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #define USB_DEBUG_VAR uaudio_debug #include @@ -138,14 +139,16 @@ union uaudio_sed { }; struct uaudio_mixer_node { + const char *name; + int32_t minval; int32_t maxval; -#define MIX_MAX_CHAN 8 +#define MIX_MAX_CHAN 16 int32_t wValue[MIX_MAX_CHAN]; /* using nchan */ uint32_t mul; uint32_t ctl; - uint16_t wData[MIX_MAX_CHAN]; /* using nchan */ + int wData[MIX_MAX_CHAN]; /* using nchan */ uint16_t wIndex; uint8_t update[(MIX_MAX_CHAN + 7) / 8]; @@ -165,6 +168,8 @@ struct uaudio_mixer_node { uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN]; uint8_t class; + uint8_t desc[64]; + struct uaudio_mixer_node *next; }; @@ -277,7 +282,9 @@ struct uaudio_softc { struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; struct uaudio_search_result sc_mixer_clocks; + struct sysctl_ctx_list sc_sysctl_ctx; + struct mtx *sc_mixer_lock; struct usb_device *sc_udev; struct usb_xfer *sc_mixer_xfer[1]; struct uaudio_mixer_node *sc_mixer_root; @@ -399,6 +406,13 @@ static usb_callback_t uaudio_mixer_write static usb_callback_t umidi_bulk_read_callback; static usb_callback_t umidi_bulk_write_callback; +/* ==== USB mixer ==== */ + +static int uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS); +static void uaudio_mixer_ctl_free(struct uaudio_softc *); +static void uaudio_mixer_register_sysctl(struct uaudio_softc *, device_t); +static void uaudio_mixer_reload_all(struct uaudio_softc *); + /* ==== USB audio v1.0 ==== */ static void uaudio_mixer_add_mixer(struct uaudio_softc *, @@ -700,6 +714,8 @@ uaudio_attach(device_t dev) if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS)) sc->sc_uq_au_vendor_class = 1; + sysctl_ctx_init(&sc->sc_sysctl_ctx); + umidi_init(dev); device_set_usb_desc(dev); @@ -720,19 +736,27 @@ uaudio_attach(device_t dev) sc->sc_mixer_count); if (sc->sc_play_chan.valid) { - device_printf(dev, "Play: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Play: %d Hz, %d ch, %s format, " + "2x%d samples buffer.\n", sc->sc_play_chan.sample_rate, sc->sc_play_chan.channels, - sc->sc_play_chan.p_fmt->description); + sc->sc_play_chan.p_fmt->description, + (sc->sc_play_chan.bytes_per_frame[0] * + sc->sc_play_chan.intr_frames) / + sc->sc_play_chan.sample_size); } else { device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { - device_printf(dev, "Record: %d Hz, %d ch, %s format.\n", + device_printf(dev, "Record: %d Hz, %d ch, %s format, " + "2x%d samples buffer.\n", sc->sc_rec_chan.sample_rate, - sc->sc_play_chan.channels, - sc->sc_rec_chan.p_fmt->description); + sc->sc_rec_chan.channels, + sc->sc_rec_chan.p_fmt->description, + (sc->sc_rec_chan.bytes_per_frame[0] * + sc->sc_rec_chan.intr_frames) / + sc->sc_rec_chan.sample_size); } else { device_printf(dev, "No recording.\n"); } @@ -773,6 +797,10 @@ uaudio_attach(device_t dev) DPRINTF("child attach failed\n"); goto detach; } + + /* reload all mixer settings */ + uaudio_mixer_reload_all(sc); + return (0); /* success */ detach: @@ -808,9 +836,8 @@ uaudio_attach_sub(device_t dev, kobj_cla */ uaudio_pcm_setflags(dev, SD_F_SOFTPCMVOL); } - if (mixer_init(dev, mixer_class, sc)) { + if (mixer_init(dev, mixer_class, sc)) goto detach; - } sc->sc_mixer_init = 1; snprintf(status, sizeof(status), "at ? %s", PCM_KLDSTRING(snd_uaudio)); @@ -832,6 +859,8 @@ uaudio_attach_sub(device_t dev, kobj_cla } pcm_setstatus(dev, status); + uaudio_mixer_register_sysctl(sc, dev); + return (0); /* success */ detach: @@ -867,6 +896,10 @@ uaudio_detach(device_t dev) { struct uaudio_softc *sc = device_get_softc(dev); + /* free all sysctls */ + + sysctl_ctx_free(&sc->sc_sysctl_ctx); + /* * Stop USB transfers early so that any audio applications * will time out and close opened /dev/dspX.Y device(s), if @@ -885,6 +918,10 @@ uaudio_detach(device_t dev) umidi_detach(dev); + /* free mixer data */ + + uaudio_mixer_ctl_free(sc); + return (0); } @@ -2036,6 +2073,149 @@ uaudio_chan_stop(struct uaudio_chan *ch) * AC - Audio Controller - routines *========================================================================*/ +static int +uaudio_mixer_sysctl_handler(SYSCTL_HANDLER_ARGS) +{ + struct uaudio_softc *sc; + struct uaudio_mixer_node *pmc; + int hint; + int error; + int temp = 0; + int chan = 0; + + sc = (struct uaudio_softc *)oidp->oid_arg1; + hint = oidp->oid_arg2; + + if (sc->sc_mixer_lock == NULL) + return (ENXIO); + + /* lookup mixer node */ + + mtx_lock(sc->sc_mixer_lock); + for (pmc = sc->sc_mixer_root; pmc != NULL; pmc = pmc->next) { + for (chan = 0; chan != (int)pmc->nchan; chan++) { + if (pmc->wValue[chan] != -1 && + pmc->wValue[chan] == hint) { + temp = pmc->wData[chan]; + goto found; + } + } + } +found: + mtx_unlock(sc->sc_mixer_lock); + + error = sysctl_handle_int(oidp, &temp, 0, req); + if (error != 0 || req->newptr == NULL) + return (error); + + /* update mixer value */ + + mtx_lock(sc->sc_mixer_lock); + if (pmc != NULL && + temp >= pmc->minval && + temp <= pmc->maxval) { + + pmc->wData[chan] = temp; + pmc->update[(chan / 8)] |= (1 << (chan % 8)); + + /* start the transfer, if not already started */ + usbd_transfer_start(sc->sc_mixer_xfer[0]); + } + mtx_unlock(sc->sc_mixer_lock); + + return (0); +} + +static void +uaudio_mixer_ctl_free(struct uaudio_softc *sc) +{ + struct uaudio_mixer_node *p_mc; + + while ((p_mc = sc->sc_mixer_root) != NULL) { + sc->sc_mixer_root = p_mc->next; + free(p_mc, M_USBDEV); + } +} + +static void +uaudio_mixer_register_sysctl(struct uaudio_softc *sc, device_t dev) +{ + struct uaudio_mixer_node *pmc; + struct sysctl_oid *mixer_tree; + struct sysctl_oid *control_tree; + char buf[32]; + int chan; + int n; + + mixer_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "mixer", + CTLFLAG_RD, NULL, ""); + + if (mixer_tree == NULL) + return; + + for (n = 0, pmc = sc->sc_mixer_root; pmc != NULL; + pmc = pmc->next, n++) { + + for (chan = 0; chan < pmc->nchan; chan++) { + + if (pmc->nchan > 1) { + snprintf(buf, sizeof(buf), "%s_%d_%d", + pmc->name, n, chan); + } else { + snprintf(buf, sizeof(buf), "%s_%d", + pmc->name, n); + } + + control_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(mixer_tree), OID_AUTO, buf, + CTLFLAG_RD, NULL, ""); + + if (control_tree == NULL) + continue; + + SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(control_tree), + OID_AUTO, "val", CTLTYPE_INT | CTLFLAG_RW, sc, + pmc->wValue[chan], + uaudio_mixer_sysctl_handler, "I", "Current value"); + + SYSCTL_ADD_INT(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(control_tree), + OID_AUTO, "min", CTLFLAG_RD, 0, pmc->minval, + "Minimum value"); + + SYSCTL_ADD_INT(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(control_tree), + OID_AUTO, "max", CTLFLAG_RD, 0, pmc->maxval, + "Maximum value"); + + SYSCTL_ADD_STRING(&sc->sc_sysctl_ctx, + SYSCTL_CHILDREN(control_tree), + OID_AUTO, "desc", CTLFLAG_RD, pmc->desc, 0, + "Description"); + } + } +} + +static void +uaudio_mixer_reload_all(struct uaudio_softc *sc) +{ + struct uaudio_mixer_node *pmc; + int chan; + + if (sc->sc_mixer_lock == NULL) + return; + + mtx_lock(sc->sc_mixer_lock); + for (pmc = sc->sc_mixer_root; pmc != NULL; pmc = pmc->next) { + for (chan = 0; chan < pmc->nchan; chan++) + pmc->update[chan / 8] |= (1 << (chan % 8)); + } + usbd_transfer_start(sc->sc_mixer_xfer[0]); + mtx_unlock(sc->sc_mixer_lock); +} + static void uaudio_mixer_add_ctl_sub(struct uaudio_softc *sc, struct uaudio_mixer_node *mc) { @@ -2287,9 +2467,9 @@ uaudio_mixer_add_selector(struct uaudio_ DPRINTFN(3, "bUnitId=%d bNrInPins=%d\n", d->bUnitId, d->bNrInPins); - if (d->bNrInPins == 0) { + if (d->bNrInPins == 0) return; - } + memset(&mix, 0, sizeof(mix)); mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); @@ -2297,10 +2477,17 @@ uaudio_mixer_add_selector(struct uaudio_ uaudio_mixer_determine_class(&iot[id], &mix); mix.nchan = 1; mix.type = MIX_SELECTOR; - mix.ctl = SOUND_MIXER_NRDEVICES; mix.minval = 1; mix.maxval = d->bNrInPins; + mix.name = "selector"; + + i = d->baSourceId[d->bNrInPins]; + if (i == 0 || + usbd_req_get_string_any(sc->sc_udev, NULL, + mix.desc, sizeof(mix.desc), i) != 0) { + mix.desc[0] = 0; + } if (mix.maxval > MAX_SELECTOR_INPUT_PIN) { mix.maxval = MAX_SELECTOR_INPUT_PIN; @@ -2341,10 +2528,17 @@ uaudio20_mixer_add_selector(struct uaudi uaudio20_mixer_determine_class(&iot[id], &mix); mix.nchan = 1; mix.type = MIX_SELECTOR; - mix.ctl = SOUND_MIXER_NRDEVICES; mix.minval = 1; mix.maxval = d->bNrInPins; + mix.name = "selector"; + + i = d->baSourceId[d->bNrInPins]; + if (i == 0 || + usbd_req_get_string_any(sc->sc_udev, NULL, + mix.desc, sizeof(mix.desc), i) != 0) { + mix.desc[0] = 0; + } if (mix.maxval > MAX_SELECTOR_INPUT_PIN) mix.maxval = MAX_SELECTOR_INPUT_PIN; @@ -2400,18 +2594,18 @@ uaudio_mixer_add_feature(struct uaudio_s uint8_t ctl; uint8_t i; - if (d->bControlSize == 0) { + if (d->bControlSize == 0) return; - } + memset(&mix, 0, sizeof(mix)); nchan = (d->bLength - 7) / d->bControlSize; mmask = uaudio_mixer_feature_get_bmaControls(d, 0); cmask = 0; - if (nchan == 0) { + if (nchan == 0) return; - } + /* figure out what we can control */ for (chan = 1; chan < nchan; chan++) { @@ -2426,6 +2620,13 @@ uaudio_mixer_add_feature(struct uaudio_s } mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + i = d->bmaControls[d->bControlSize]; + if (i == 0 || + usbd_req_get_string_any(sc->sc_udev, NULL, + mix.desc, sizeof(mix.desc), i) != 0) { + mix.desc[0] = 0; + } + for (ctl = 1; ctl <= LOUDNESS_CONTROL; ctl++) { fumask = FU_MASK(ctl); @@ -2454,50 +2655,58 @@ uaudio_mixer_add_feature(struct uaudio_s case MUTE_CONTROL: mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "mute"; break; case VOLUME_CONTROL: mix.type = MIX_SIGNED_16; mix.ctl = mixernumber; + mix.name = "vol"; break; case BASS_CONTROL: mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_BASS; + mix.name = "bass"; break; case MID_CONTROL: mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "mid"; break; case TREBLE_CONTROL: mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_TREBLE; + mix.name = "treble"; break; case GRAPHIC_EQUALIZER_CONTROL: continue; /* XXX don't add anything */ - break; case AGC_CONTROL: mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "agc"; break; case DELAY_CONTROL: mix.type = MIX_UNSIGNED_16; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "delay"; break; case BASS_BOOST_CONTROL: mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "boost"; break; case LOUDNESS_CONTROL: mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_LOUD; /* Is this correct ? */ + mix.name = "loudness"; break; default: @@ -2547,6 +2756,13 @@ uaudio20_mixer_add_feature(struct uaudio mix.wIndex = MAKE_WORD(d->bUnitId, sc->sc_mixer_iface_no); + i = d->bmaControls[nchan][0]; + if (i == 0 || + usbd_req_get_string_any(sc->sc_udev, NULL, + mix.desc, sizeof(mix.desc), i) != 0) { + mix.desc[0] = 0; + } + for (ctl = 3; ctl != 0; ctl <<= 2) { mixernumber = uaudio20_mixer_feature_name(&iot[id], &mix); @@ -2555,56 +2771,67 @@ uaudio20_mixer_add_feature(struct uaudio case (3 << 0): mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "mute"; what = MUTE_CONTROL; break; case (3 << 2): mix.type = MIX_SIGNED_16; mix.ctl = mixernumber; + mix.name = "vol"; what = VOLUME_CONTROL; break; case (3 << 4): mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_BASS; + mix.name = "bass"; what = BASS_CONTROL; break; case (3 << 6): mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "mid"; what = MID_CONTROL; break; case (3 << 8): mix.type = MIX_SIGNED_8; mix.ctl = SOUND_MIXER_TREBLE; + mix.name = "treble"; what = TREBLE_CONTROL; break; case (3 << 12): mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "agc"; what = AGC_CONTROL; break; case (3 << 14): mix.type = MIX_UNSIGNED_16; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "delay"; what = DELAY_CONTROL; break; case (3 << 16): mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_NRDEVICES; /* XXXXX */ + mix.name = "boost"; what = BASS_BOOST_CONTROL; break; case (3 << 18): mix.type = MIX_ON_OFF; mix.ctl = SOUND_MIXER_LOUD; /* Is this correct ? */ + mix.name = "loudness"; what = LOUDNESS_CONTROL; break; case (3 << 20): mix.type = MIX_SIGNED_16; mix.ctl = mixernumber; + mix.name = "igain"; what = INPUT_GAIN_CONTROL; break; case (3 << 22): mix.type = MIX_SIGNED_16; mix.ctl = mixernumber; + mix.name = "igainpad"; what = INPUT_GAIN_PAD_CONTROL; break; default: @@ -2807,11 +3034,16 @@ uaudio_mixer_verify_desc(const void *arg if (u.desc->bLength < len) { goto error; } - len += u.su->bNrInPins; + len += u.su->bNrInPins + 1; break; case UDESCSUB_AC_FEATURE: - len += (sizeof(*u.fu) + 1); + len += sizeof(*u.fu) + 1; + + if (u.desc->bLength < len) + goto error; + + len += u.fu->bControlSize; break; case UDESCSUB_AC_PROCESSING: @@ -2939,14 +3171,11 @@ uaudio20_mixer_verify_desc(const void *a if (u.desc->bLength < len) goto error; - len += u.su->bNrInPins; + len += u.su->bNrInPins + 1; break; case UDESCSUB_AC_FEATURE: len += sizeof(*u.fu) + 1; - - if (u.desc->bLength < len) - goto error; break; case UDESCSUB_AC_EFFECT: @@ -4303,9 +4532,11 @@ uaudio_mixer_init_sub(struct uaudio_soft { DPRINTF("\n"); + sc->sc_mixer_lock = mixer_get_lock(m); + if (usbd_transfer_setup(sc->sc_udev, &sc->sc_mixer_iface_index, sc->sc_mixer_xfer, uaudio_mixer_config, 1, sc, - mixer_get_lock(m))) { + sc->sc_mixer_lock)) { DPRINTFN(0, "could not allocate USB " "transfer for audio mixer!\n"); return (ENOMEM); @@ -4326,6 +4557,8 @@ uaudio_mixer_uninit_sub(struct uaudio_so usbd_transfer_unsetup(sc->sc_mixer_xfer, 1); + sc->sc_mixer_lock = NULL; + return (0); } @@ -4334,17 +4567,16 @@ uaudio_mixer_set(struct uaudio_softc *sc unsigned left, unsigned right) { struct uaudio_mixer_node *mc; + int chan; - for (mc = sc->sc_mixer_root; mc; - mc = mc->next) { + for (mc = sc->sc_mixer_root; mc != NULL; mc = mc->next) { if (mc->ctl == type) { - if (mc->nchan == 2) { - /* set Right */ - uaudio_mixer_ctl_set(sc, mc, 1, (int)(right * 255) / 100); + for (chan = 0; chan < mc->nchan; chan++) { + uaudio_mixer_ctl_set(sc, mc, chan, + (int)((chan == 0 ? left : right) * + 255) / 100); } - /* set Left or Mono */ - uaudio_mixer_ctl_set(sc, mc, 0, (int)(left * 255) / 100); } } } From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 17:01:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6D74935; Thu, 1 Nov 2012 17:01:05 +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 CEC9A8FC1E; Thu, 1 Nov 2012 17:01:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1H15cL036815; Thu, 1 Nov 2012 17:01:05 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1H15fb036810; Thu, 1 Nov 2012 17:01:05 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011701.qA1H15fb036810@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:01:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242439 - in head/sys: dev/null geom kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 17:01:06 -0000 Author: alfred Date: Thu Nov 1 17:01:05 2012 New Revision: 242439 URL: http://svn.freebsd.org/changeset/base/242439 Log: Provide a device name in the sysctl tree for programs to query the state of crashdump target devices. This will be used to add a "-l" (ell) flag to dumpon(8) to list the currently configured dumpdev. Reviewed by: phk Modified: head/sys/dev/null/null.c head/sys/geom/geom_dev.c head/sys/kern/kern_shutdown.c head/sys/sys/conf.h Modified: head/sys/dev/null/null.c ============================================================================== --- head/sys/dev/null/null.c Thu Nov 1 16:54:26 2012 (r242438) +++ head/sys/dev/null/null.c Thu Nov 1 17:01:05 2012 (r242439) @@ -91,7 +91,7 @@ null_ioctl(struct cdev *dev __unused, u_ case DIOCSKERNELDUMP: error = priv_check(td, PRIV_SETDUMPER); if (error == 0) - error = set_dumper(NULL); + error = set_dumper(NULL, NULL); break; case FIONBIO: break; Modified: head/sys/geom/geom_dev.c ============================================================================== --- head/sys/geom/geom_dev.c Thu Nov 1 16:54:26 2012 (r242438) +++ head/sys/geom/geom_dev.c Thu Nov 1 17:01:05 2012 (r242439) @@ -359,7 +359,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd case DIOCSKERNELDUMP: u = *((u_int *)data); if (!u) { - set_dumper(NULL); + set_dumper(NULL, NULL); error = 0; break; } @@ -368,7 +368,7 @@ g_dev_ioctl(struct cdev *dev, u_long cmd i = sizeof kd; error = g_io_getattr("GEOM::kerneldump", cp, &i, &kd); if (!error) { - error = set_dumper(&kd.di); + error = set_dumper(&kd.di, devtoname(dev)); if (!error) dev->si_flags |= SI_DUMPDEV; } @@ -526,7 +526,7 @@ g_dev_orphan(struct g_consumer *cp) /* Reset any dump-area set on this device */ if (dev->si_flags & SI_DUMPDEV) - set_dumper(NULL); + set_dumper(NULL, NULL); /* Destroy the struct cdev *so we get no more requests */ destroy_dev(dev); Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Thu Nov 1 16:54:26 2012 (r242438) +++ head/sys/kern/kern_shutdown.c Thu Nov 1 17:01:05 2012 (r242439) @@ -712,18 +712,28 @@ kthread_shutdown(void *arg, int howto) printf("done\n"); } +static char dumpdevname[sizeof(((struct cdev*)NULL)->si_name)]; +SYSCTL_STRING(_kern_shutdown, OID_AUTO, dumpdevname, CTLFLAG_RD, + dumpdevname, 0, "Device for kernel dumps"); + /* Registration of dumpers */ int -set_dumper(struct dumperinfo *di) +set_dumper(struct dumperinfo *di, const char *devname) { if (di == NULL) { bzero(&dumper, sizeof dumper); + dumpdevname[0] = '\0'; return (0); } if (dumper.dumper != NULL) return (EBUSY); dumper = *di; + strlcpy(dumpdevname, devname, sizeof(dumpdevname)); + if (strlen(dumpdevname) != strlen(devname)) { + printf("set_dumper: device name truncated from '%s' -> '%s'\n", + devname, dumpdevname); + } return (0); } Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Thu Nov 1 16:54:26 2012 (r242438) +++ head/sys/sys/conf.h Thu Nov 1 17:01:05 2012 (r242439) @@ -331,7 +331,7 @@ struct dumperinfo { off_t mediasize; /* Space available in bytes. */ }; -int set_dumper(struct dumperinfo *); +int set_dumper(struct dumperinfo *, const char *_devname); int dump_write(struct dumperinfo *, void *, vm_offset_t, off_t, size_t); void dumpsys(struct dumperinfo *); int doadump(boolean_t); From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 17:13:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FCCDB75; Thu, 1 Nov 2012 17:13:05 +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 2869C8FC12; Thu, 1 Nov 2012 17:13:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1HD52u038882; Thu, 1 Nov 2012 17:13:05 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HD4p3038880; Thu, 1 Nov 2012 17:13:04 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011713.qA1HD4p3038880@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 17:13:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242440 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 17:13:05 -0000 Author: alfred Date: Thu Nov 1 17:13:04 2012 New Revision: 242440 URL: http://svn.freebsd.org/changeset/base/242440 Log: Add whitespace between mandatory and optional kernel config options. Approved by: joel Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Thu Nov 1 17:01:05 2012 (r242439) +++ head/share/man/man4/textdump.4 Thu Nov 1 17:13:04 2012 (r242440) @@ -36,6 +36,7 @@ .Sh SYNOPSIS .Cd options KDB .Cd options DDB +.Pp .Cd options TEXTDUMP_VERBOSE .Cd options TEXTDUMP_PREFERRED .Sh DESCRIPTION From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 17:17:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8A9F2CB9; Thu, 1 Nov 2012 17:17:06 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 732FE8FC16; Thu, 1 Nov 2012 17:17:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1HH6mM039650; Thu, 1 Nov 2012 17:17:06 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1HH6fo039648; Thu, 1 Nov 2012 17:17:06 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211011717.qA1HH6fo039648@svn.freebsd.org> From: Joel Dahl Date: Thu, 1 Nov 2012 17:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242441 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 17:17:06 -0000 Author: joel (doc committer) Date: Thu Nov 1 17:17:05 2012 New Revision: 242441 URL: http://svn.freebsd.org/changeset/base/242441 Log: Sort textdump options list. Submitted by: bde Modified: head/share/man/man4/ddb.4 Modified: head/share/man/man4/ddb.4 ============================================================================== --- head/share/man/man4/ddb.4 Thu Nov 1 17:13:04 2012 (r242440) +++ head/share/man/man4/ddb.4 Thu Nov 1 17:17:05 2012 (r242441) @@ -1173,10 +1173,15 @@ See the .Sx SCRIPTING section for more information on the scripting facility. .Pp +.It Ic textdump dump .It Ic textdump set .It Ic textdump status .It Ic textdump unset -.It Ic textdump dump +Use the +.Ic textdump dump +command to immediately perform a textdump. +More information may be found in +.Xr textdump 4 . The .Ic textdump set command may be used to force the next kernel core dump to be a textdump @@ -1185,11 +1190,6 @@ rather than a traditional memory dump or reports whether a textdump has been scheduled. .Ic textdump unset cancels a request to perform a textdump as the next kernel core dump. -Use the -.Ic textdump dump -command to immediately perform a textdump. -More information may be found in -.Xr textdump 4 . .El .Sh VARIABLES The debugger accesses registers and variables as From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 18:42:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CCCC4F0A for ; Thu, 1 Nov 2012 18:42:14 +0000 (UTC) (envelope-from mailer-daemon@vniz.net) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 436288FC15 for ; Thu, 1 Nov 2012 18:42:13 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so2644741lbd.13 for ; Thu, 01 Nov 2012 11:42:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:disposition-notification-to:date:from:user-agent :mime-version:to:cc:subject:references:in-reply-to:openpgp :content-type:content-transfer-encoding:x-gm-message-state; bh=z9zUldJH6Su7lK3o67B7wKM7HcgobZS3my6KJdNP38o=; b=Rqa/m5zvALiuapvbj++NmES98BFMWUltm0UrIaL6mH8KOvXAPmpxQluVoD6+hIklJV SWmg/pSH0UMszNpMTsDO4GDsAQhjhiJFihjf9OXSWOkBMOmTUyw16XsAWW0Tdc/PZRO4 NEk2OWdDZN9LEjUTvB/LyoOEboTbgtajsW4XVrdhynONTMWU4ZOe90+F7Y4kh7YLa14R ecQXGGo0dMQaPNF5vOvjrYA8TtSXVagAVsO216DUPo48AkoouXIvwB9nvX0Zomg4rlek eTFaBbQxmYvadkD+sFTmdukj+P3tQYgJw/XHn0Dk2bF2FmmIt3gwzzNJ4SxGUo5y8kHr E2uw== Received: by 10.112.39.100 with SMTP id o4mr14233873lbk.23.1351795332779; Thu, 01 Nov 2012 11:42:12 -0700 (PDT) Received: from [192.168.1.2] ([89.169.140.97]) by mx.google.com with ESMTPS id z9sm2531165lbk.15.2012.11.01.11.42.11 (version=SSLv3 cipher=OTHER); Thu, 01 Nov 2012 11:42:12 -0700 (PDT) Message-ID: <5092C283.4000904@freebsd.org> Date: Thu, 01 Nov 2012 22:42:11 +0400 From: Andrey Chernov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:16.0) Gecko/20121026 Thunderbird/16.0.2 MIME-Version: 1.0 To: Alexander Motin Subject: Re: svn commit: r242417 - head/sys/dev/sound/pci/hda References: <201210312211.q9VMBpHp044373@svn.freebsd.org> In-Reply-To: <201210312211.q9VMBpHp044373@svn.freebsd.org> OpenPGP: id=964474DD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQnFswl4ijCohU0+HslYs+SrNl7XG3OuYOcwt6KkTdjUt29FRlcQwar/zjEnsdunnXBNyNRd Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 18:42:14 -0000 On 01.11.2012 2:11, Alexander Motin wrote: > Author: mav > Date: Wed Oct 31 22:11:51 2012 > New Revision: 242417 > URL: http://svn.freebsd.org/changeset/base/242417 > > Log: > ASUS EeePC 1001px has strange variant of ALC269 CODEC, that mutes speaker > if unused in that configuration mixer at NID 15 is muted. Probably CODEC > incorrectly reports its internal connections. Hide that muter from the > driver to avoid muting and make built-in speaker work. Realteks mutes speakers in case headphones are plugged in. Perhaps it is related to this thing. From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 18:59:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AFC35BC; Thu, 1 Nov 2012 18:59:20 +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 2A4718FC15; Thu, 1 Nov 2012 18:59:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1IxKxM057005; Thu, 1 Nov 2012 18:59:20 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1IxJBI057002; Thu, 1 Nov 2012 18:59:19 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211011859.qA1IxJBI057002@svn.freebsd.org> From: Alfred Perlstein Date: Thu, 1 Nov 2012 18:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242451 - head/sbin/dumpon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 18:59:20 -0000 Author: alfred Date: Thu Nov 1 18:59:19 2012 New Revision: 242451 URL: http://svn.freebsd.org/changeset/base/242451 Log: Add an option to display the current dump device via dumpon -l. MFC after: 2 weeks Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c Directory Properties: head/sbin/dumpon/ (props changed) Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Thu Nov 1 18:55:17 2012 (r242450) +++ head/sbin/dumpon/dumpon.8 Thu Nov 1 18:59:19 2012 (r242451) @@ -41,6 +41,8 @@ .Nm .Op Fl v .Cm off +.Nm +.Fl l .Sh DESCRIPTION The .Nm @@ -72,6 +74,13 @@ total amount of physical memory as repor variable. .Pp The +.Fl l +flag causes +.Nm +to print the current dump device or _PATH_DEVNULL ("/dev/null") if no device is +configured. +.Pp +The .Fl v flag causes .Nm Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Thu Nov 1 18:55:17 2012 (r242450) +++ head/sbin/dumpon/dumpon.c Thu Nov 1 18:59:19 2012 (r242451) @@ -46,6 +46,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -60,9 +61,10 @@ static int verbose; static void usage(void) { - fprintf(stderr, "%s\n%s\n", + fprintf(stderr, "%s\n%s\n%s\n", "usage: dumpon [-v] special_file", - " dumpon [-v] off"); + " dumpon [-v] off", + " dumpon -l"); exit(EX_USAGE); } @@ -92,15 +94,45 @@ check_size(int fd, const char *fn) } } +static void +listdumpdev(void) +{ + char dumpdev[PATH_MAX]; + size_t len; + const char *sysctlname = "kern.shutdown.dumpdevname"; + + len = sizeof(dumpdev); + if (sysctlbyname(sysctlname, &dumpdev, &len, NULL, 0) != 0) { + if (errno == ENOMEM) { + err(EX_OSERR, "Kernel returned too large of a buffer for '%s'\n", + sysctlname); + } else { + err(EX_OSERR, "Sysctl get '%s'\n", sysctlname); + } + } + if (verbose) { + printf("kernel dumps on "); + } + if (strlen(dumpdev) == 0) { + printf("%s\n", _PATH_DEVNULL); + } else { + printf("%s\n", dumpdev); + } +} + int main(int argc, char *argv[]) { int ch; int i, fd; u_int u; + int do_listdumpdev = 0; - while ((ch = getopt(argc, argv, "v")) != -1) + while ((ch = getopt(argc, argv, "lv")) != -1) switch((char)ch) { + case 'l': + do_listdumpdev = 1; + break; case 'v': verbose = 1; break; @@ -111,6 +143,11 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; + if (do_listdumpdev) { + listdumpdev(); + exit(EX_OK); + } + if (argc != 1) usage(); From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 19:38:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 50A68DD5; Thu, 1 Nov 2012 19:38:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38D8B8FC08; Thu, 1 Nov 2012 19:38:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1Jc4kF062979; Thu, 1 Nov 2012 19:38:04 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1Jc4gD062977; Thu, 1 Nov 2012 19:38:04 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211011938.qA1Jc4gD062977@svn.freebsd.org> From: Eitan Adler Date: Thu, 1 Nov 2012 19:38:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242452 - head/etc/root X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 19:38:04 -0000 Author: eadler Date: Thu Nov 1 19:38:03 2012 New Revision: 242452 URL: http://svn.freebsd.org/changeset/base/242452 Log: The test fails with "exit 1" if /usr/games/fortune doesn't actually exist. Fix that. PR: conf/71994 Submitted by: Mikael Eklund Reviewed by: crees Reviewed by: jilles Approved by: cperciva (implicit) MFC after: 3 days Modified: head/etc/root/dot.login Modified: head/etc/root/dot.login ============================================================================== --- head/etc/root/dot.login Thu Nov 1 18:59:19 2012 (r242451) +++ head/etc/root/dot.login Thu Nov 1 19:38:03 2012 (r242452) @@ -6,4 +6,4 @@ # # Uncomment to display a random cookie each login: -# [ -x /usr/games/fortune ] && /usr/games/fortune -s +# if ( -x /usr/games/fortune ) /usr/games/fortune -s From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 20:09:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B476715A; Thu, 1 Nov 2012 20:09:48 +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 9AF238FC0A; Thu, 1 Nov 2012 20:09:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1K9m9I067676; Thu, 1 Nov 2012 20:09:48 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1K9mQe067674; Thu, 1 Nov 2012 20:09:48 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211012009.qA1K9mQe067674@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 1 Nov 2012 20:09:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242453 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 20:09:48 -0000 Author: hselasky Date: Thu Nov 1 20:09:48 2012 New Revision: 242453 URL: http://svn.freebsd.org/changeset/base/242453 Log: Fix sysctl free bug in last commit, which eventually leads to a panic. Add software mixer table for FastTrack Ultra. Only set volume controls which are valid at startup for standard USB audio devices, so that settings like treble and bass use the reset defaults. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Nov 1 19:38:03 2012 (r242452) +++ head/sys/dev/sound/usb/uaudio.c Thu Nov 1 20:09:48 2012 (r242453) @@ -167,6 +167,7 @@ struct uaudio_mixer_node { #define MAX_SELECTOR_INPUT_PIN 256 uint8_t slctrtype[MAX_SELECTOR_INPUT_PIN]; uint8_t class; + uint8_t val_default; uint8_t desc[64]; @@ -282,7 +283,6 @@ struct uaudio_softc { struct uaudio_chan sc_play_chan; struct umidi_chan sc_midi_chan; struct uaudio_search_result sc_mixer_clocks; - struct sysctl_ctx_list sc_sysctl_ctx; struct mtx *sc_mixer_lock; struct usb_device *sc_udev; @@ -412,6 +412,7 @@ static int uaudio_mixer_sysctl_handler(S static void uaudio_mixer_ctl_free(struct uaudio_softc *); static void uaudio_mixer_register_sysctl(struct uaudio_softc *, device_t); static void uaudio_mixer_reload_all(struct uaudio_softc *); +static void uaudio_mixer_controls_create_ftu(struct uaudio_softc *); /* ==== USB audio v1.0 ==== */ @@ -714,8 +715,6 @@ uaudio_attach(device_t dev) if (usb_test_quirk(uaa, UQ_AU_VENDOR_CLASS)) sc->sc_uq_au_vendor_class = 1; - sysctl_ctx_init(&sc->sc_sysctl_ctx); - umidi_init(dev); device_set_usb_desc(dev); @@ -732,6 +731,15 @@ uaudio_attach(device_t dev) sc->sc_audio_rev >> 8, sc->sc_audio_rev & 0xff); + if (sc->sc_mixer_count == 0) { + if (uaa->info.idVendor == USB_VENDOR_MAUDIO && + (uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA || + uaa->info.idProduct == USB_PRODUCT_MAUDIO_FASTTRACKULTRA8R)) { + DPRINTF("Generating mixer descriptors\n"); + uaudio_mixer_controls_create_ftu(sc); + } + } + DPRINTF("%d mixer controls\n", sc->sc_mixer_count); @@ -896,10 +904,6 @@ uaudio_detach(device_t dev) { struct uaudio_softc *sc = device_get_softc(dev); - /* free all sysctls */ - - sysctl_ctx_free(&sc->sc_sysctl_ctx); - /* * Stop USB transfers early so that any audio applications * will time out and close opened /dev/dspX.Y device(s), if @@ -2147,7 +2151,7 @@ uaudio_mixer_register_sysctl(struct uaud int chan; int n; - mixer_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, + mixer_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(device_get_sysctl_tree(dev)), OID_AUTO, "mixer", CTLFLAG_RD, NULL, ""); @@ -2167,30 +2171,30 @@ uaudio_mixer_register_sysctl(struct uaud pmc->name, n); } - control_tree = SYSCTL_ADD_NODE(&sc->sc_sysctl_ctx, + control_tree = SYSCTL_ADD_NODE(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(mixer_tree), OID_AUTO, buf, - CTLFLAG_RD, NULL, ""); + CTLFLAG_RD, NULL, "Mixer control nodes"); if (control_tree == NULL) continue; - SYSCTL_ADD_PROC(&sc->sc_sysctl_ctx, + SYSCTL_ADD_PROC(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(control_tree), OID_AUTO, "val", CTLTYPE_INT | CTLFLAG_RW, sc, pmc->wValue[chan], uaudio_mixer_sysctl_handler, "I", "Current value"); - SYSCTL_ADD_INT(&sc->sc_sysctl_ctx, + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(control_tree), OID_AUTO, "min", CTLFLAG_RD, 0, pmc->minval, "Minimum value"); - SYSCTL_ADD_INT(&sc->sc_sysctl_ctx, + SYSCTL_ADD_INT(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(control_tree), OID_AUTO, "max", CTLFLAG_RD, 0, pmc->maxval, "Maximum value"); - SYSCTL_ADD_STRING(&sc->sc_sysctl_ctx, + SYSCTL_ADD_STRING(device_get_sysctl_ctx(dev), SYSCTL_CHILDREN(control_tree), OID_AUTO, "desc", CTLFLAG_RD, pmc->desc, 0, "Description"); @@ -2198,6 +2202,157 @@ uaudio_mixer_register_sysctl(struct uaud } } +/* M-Audio FastTrack Ultra Mixer Description */ +/* Origin: Linux USB Audio driver */ +static void +uaudio_mixer_controls_create_ftu(struct uaudio_softc *sc) +{ + struct uaudio_mixer_node mix; + int chx; + int chy; + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(6, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(8, 0); + mix.class = UAC_OUTPUT; + mix.type = MIX_UNSIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect"; + mix.minval = 0; + mix.maxval = 7; + mix.mul = 7; + mix.nchan = 1; + mix.update[0] = 1; + strlcpy(mix.desc, "Room1,2,3,Hall1,2,Plate,Delay,Echo", sizeof(mix.desc)); + uaudio_mixer_add_ctl_sub(sc, &mix); + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(5, sc->sc_mixer_iface_no); + + for (chx = 0; chx != 8; chx++) { + for (chy = 0; chy != 8; chy++) { + + mix.wValue[0] = MAKE_WORD(chx + 1, chy + 1); + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "mix_rec"; + mix.nchan = 1; + mix.update[0] = 1; + mix.val_default = 0; + snprintf(mix.desc, sizeof(mix.desc), + "AIn%d - Out%d Record Volume", chy + 1, chx + 1); + + uaudio_mixer_add_ctl(sc, &mix); + + mix.wValue[0] = MAKE_WORD(chx + 1, chy + 1 + 8); + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "mix_play"; + mix.nchan = 1; + mix.update[0] = 1; + mix.val_default = (chx == chy) ? 1 : 0; + snprintf(mix.desc, sizeof(mix.desc), + "DIn%d - Out%d Playback Volume", chy + 1, chx + 1); + + uaudio_mixer_add_ctl(sc, &mix); + } + } + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(6, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(2, 0); + mix.class = UAC_OUTPUT; + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_vol"; + mix.nchan = 1; + mix.update[0] = 1; + mix.minval = 0; + mix.maxval = 0x7f; + mix.mul = 0x7f; + mix.nchan = 1; + mix.update[0] = 1; + strlcpy(mix.desc, "Effect Volume", sizeof(mix.desc)); + uaudio_mixer_add_ctl_sub(sc, &mix); + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(6, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(3, 0); + mix.class = UAC_OUTPUT; + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_dur"; + mix.nchan = 1; + mix.update[0] = 1; + mix.minval = 0; + mix.maxval = 0x7f00; + mix.mul = 0x7f00; + mix.nchan = 1; + mix.update[0] = 1; + strlcpy(mix.desc, "Effect Duration", sizeof(mix.desc)); + uaudio_mixer_add_ctl_sub(sc, &mix); + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(6, sc->sc_mixer_iface_no); + mix.wValue[0] = MAKE_WORD(4, 0); + mix.class = UAC_OUTPUT; + mix.type = MIX_SIGNED_8; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_fb"; + mix.nchan = 1; + mix.update[0] = 1; + mix.minval = 0; + mix.maxval = 0x7f; + mix.mul = 0x7f; + mix.nchan = 1; + mix.update[0] = 1; + strlcpy(mix.desc, "Effect Feedback Volume", sizeof(mix.desc)); + uaudio_mixer_add_ctl_sub(sc, &mix); + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(7, sc->sc_mixer_iface_no); + for (chy = 0; chy != 4; chy++) { + + mix.wValue[0] = MAKE_WORD(7, chy + 1); + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_ret"; + mix.nchan = 1; + mix.update[0] = 1; + snprintf(mix.desc, sizeof(mix.desc), + "Effect Return %d Volume", chy + 1); + + uaudio_mixer_add_ctl(sc, &mix); + } + + memset(&mix, 0, sizeof(mix)); + mix.wIndex = MAKE_WORD(5, sc->sc_mixer_iface_no); + + for (chy = 0; chy != 8; chy++) { + mix.wValue[0] = MAKE_WORD(9, chy + 1); + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_send"; + mix.nchan = 1; + mix.update[0] = 1; + snprintf(mix.desc, sizeof(mix.desc), + "Effect Send AIn%d Volume", chy + 1); + + uaudio_mixer_add_ctl(sc, &mix); + + mix.wValue[0] = MAKE_WORD(9, chy + 1); + mix.type = MIX_SIGNED_16; + mix.ctl = SOUND_MIXER_NRDEVICES; + mix.name = "effect_send"; + mix.nchan = 1; + mix.update[0] = 1; + snprintf(mix.desc, sizeof(mix.desc), + "Effect Send DIn%d Volume", chy + 1 + 8); + + uaudio_mixer_add_ctl(sc, &mix); + } +} + static void uaudio_mixer_reload_all(struct uaudio_softc *sc) { @@ -2209,6 +2364,9 @@ uaudio_mixer_reload_all(struct uaudio_so mtx_lock(sc->sc_mixer_lock); for (pmc = sc->sc_mixer_root; pmc != NULL; pmc = pmc->next) { + /* use reset defaults for non-oss controlled settings */ + if (pmc->ctl == SOUND_MIXER_NRDEVICES) + continue; for (chan = 0; chan < pmc->nchan; chan++) pmc->update[chan / 8] |= (1 << (chan % 8)); } @@ -2221,12 +2379,28 @@ uaudio_mixer_add_ctl_sub(struct uaudio_s { struct uaudio_mixer_node *p_mc_new = malloc(sizeof(*p_mc_new), M_USBDEV, M_WAITOK); + int ch; if (p_mc_new != NULL) { memcpy(p_mc_new, mc, sizeof(*p_mc_new)); p_mc_new->next = sc->sc_mixer_root; sc->sc_mixer_root = p_mc_new; sc->sc_mixer_count++; + + /* set default value for all channels */ + for (ch = 0; ch < p_mc_new->nchan; ch++) { + switch (p_mc_new->val_default) { + case 1: + p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2; + break; + case 2: + p_mc_new->wData[ch] = p_mc_new->maxval; + break; + default: + p_mc_new->wData[ch] = p_mc_new->minval; + break; + } + } } else { DPRINTF("out of memory\n"); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 20:31:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DD73C3A8; Thu, 1 Nov 2012 20:31:23 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 89B7E8FC08; Thu, 1 Nov 2012 20:31:22 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so2706402lag.13 for ; Thu, 01 Nov 2012 13:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=vE+eIL9RyJ+KDZ3CngnIHmSOg5Faq1qA/DVHBImzFgQ=; b=t6LRj7rBv7i2vCE/wWUJr+MW2e4aOYzelVXupj1GzzXcEM0O7qG66R8H9NXyWhMrx7 2j4tLjcouCEWL2J2pp3DNv3YnEYIZCCJGVv+97DixRvez9DL9Ou2ho4Kbq+3giC3vA1H +ERDtmgvxmSkymftoZyyzXkl1Gc3XXXA7RTdWudtbWbrTxkiBr1EkdjP76+CCVCXj+KI uyIQ74SojwsqnHlJfdUQBX7RrH8OWPeOit7yMM6qNm8RoI3FIPEZ/bbhpdh6FXW0m2Ul FW0fLjJ3okCknGAZIr1YRDvQCYD135bn2woT4LNCsaHEN7NFxvHfdLOFFRh1qHQ4UpQx svXg== MIME-Version: 1.0 Received: by 10.152.129.197 with SMTP id ny5mr35929718lab.43.1351801881206; Thu, 01 Nov 2012 13:31:21 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Thu, 1 Nov 2012 13:31:21 -0700 (PDT) In-Reply-To: <50928755.6070401@freebsd.org> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <50918FEC.3070602@freebsd.org> <50928755.6070401@freebsd.org> Date: Thu, 1 Nov 2012 20:31:21 +0000 X-Google-Sender-Auth: TREdQCsd3hok_p3TVX_VSMk7_cY Message-ID: Subject: Re: svn commit: r242402 - in head/sys: kern vm From: Attilio Rao To: Andre Oppermann , Jeff Roberson Content-Type: text/plain; charset=UTF-8 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 20:31:23 -0000 On 11/1/12, Andre Oppermann wrote: > On 01.11.2012 12:53, Attilio Rao wrote: >> On 10/31/12, Andre Oppermann wrote: >>> On 31.10.2012 19:10, Attilio Rao wrote: >>>> On Wed, Oct 31, 2012 at 6:07 PM, Attilio Rao >>>> wrote: >>>>> Author: attilio >>>>> Date: Wed Oct 31 18:07:18 2012 >>>>> New Revision: 242402 >>>>> URL: http://svn.freebsd.org/changeset/base/242402 >>>>> >>>>> Log: >>>>> Rework the known mutexes to benefit about staying on their own >>>>> cache line in order to avoid manual frobbing but using >>>>> struct mtx_padalign. >>>> >>>> Interested developers can now dig and look for other mutexes to >>>> convert and just do it. >>>> Please, however, try to enclose a description about the benchmark >>>> which lead you believe the necessity to pad the mutex and possibly >>>> some numbers, in particular when the lock belongs to structures or the >>>> ABI itself. >>>> >>>> Next steps involve porting the same mtx(9) changes to rwlock(9) and >>>> port pvh global pmap lock to rwlock_padalign. >>> >>> I'd say for an rwlock you can make it unconditional. The very purpose >>> of it is to be aquired by multiple CPU's causing cache line dirtying >>> for every concurrent reader. Rwlocks are only ever used because >>> multiple >>> concurrent readers are expected. >> >> I thought about it, but I think the same arguments as for mutexes >> remains. >> The real problem is that having default rwlocks pad-aligned will put >> showstoppers for their usage in sensitive structures. For example, I >> have plans to use them in vm_object at some point to replace >> VM_OBJECT_LOCK and I do want to avoid the extra-bloat for such >> structures. >> >> Also, please keep in mind that there is no direct relation between >> "read acquisition" and "high contention" with the latter being the >> real reason for having pad-aligned locks. > > I do not agree. If there is no contention then there is no need for > a rwlock, a normal mutex would be sufficient. A rwlock is used when > multiple concurrent readers are expected. Each read lock and unlock > dirties the cache line for all other CPU's. > > Please note that I don't want to prevent you from doing the work all > over for rwlocks. It's just that the use case for a non-padded rwlock > is very narrow. So here is the patch for adding the decoupling infrastructure to rwlock and add the padalign type: http://www.freebsd.org/~attilio/rwlock_decoupled_padalign.patch I've tested by converting some rwlocks in the system and everything looks good to me. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 20:39:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F59753A; Thu, 1 Nov 2012 20:39:40 +0000 (UTC) (envelope-from jmallett@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5706C8FC14; Thu, 1 Nov 2012 20:39:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1KdeSd072055; Thu, 1 Nov 2012 20:39:40 GMT (envelope-from jmallett@svn.freebsd.org) Received: (from jmallett@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1KdeLH072053; Thu, 1 Nov 2012 20:39:40 GMT (envelope-from jmallett@svn.freebsd.org) Message-Id: <201211012039.qA1KdeLH072053@svn.freebsd.org> From: Juli Mallett Date: Thu, 1 Nov 2012 20:39:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242454 - head/sys/mips/cavium X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 20:39:40 -0000 Author: jmallett Date: Thu Nov 1 20:39:39 2012 New Revision: 242454 URL: http://svn.freebsd.org/changeset/base/242454 Log: Don't disable PCIe just because the host is not a PCI host; the latter flag only applies to non-PCIe systems. If PCIe is in target mode, it will simply and gracefully fail to attach of its own accord. Modified: head/sys/mips/cavium/octopci.c Modified: head/sys/mips/cavium/octopci.c ============================================================================== --- head/sys/mips/cavium/octopci.c Thu Nov 1 20:09:48 2012 (r242453) +++ head/sys/mips/cavium/octopci.c Thu Nov 1 20:39:39 2012 (r242454) @@ -104,10 +104,6 @@ static uint64_t octopci_cs_addr(unsigned static void octopci_identify(driver_t *drv, device_t parent) { - /* Check whether we are a PCI host. */ - if ((cvmx_sysinfo_get()->bootloader_config_flags & CVMX_BOOTINFO_CFG_FLAG_PCI_HOST) == 0) - return; - BUS_ADD_CHILD(parent, 0, "pcib", 0); if (octeon_has_feature(OCTEON_FEATURE_PCIE)) BUS_ADD_CHILD(parent, 0, "pcib", 1); @@ -121,6 +117,10 @@ octopci_probe(device_t dev) return (0); } + /* Check whether we are a PCI host. */ + if ((cvmx_sysinfo_get()->bootloader_config_flags & CVMX_BOOTINFO_CFG_FLAG_PCI_HOST) == 0) + return (ENXIO); + if (device_get_unit(dev) != 0) return (ENXIO); From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 20:43:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93556692; Thu, 1 Nov 2012 20:43:24 +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 7AD058FC14; Thu, 1 Nov 2012 20:43:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1KhOXL072662; Thu, 1 Nov 2012 20:43:24 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1KhOKn072660; Thu, 1 Nov 2012 20:43:24 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211012043.qA1KhOKn072660@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 1 Nov 2012 20:43:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242455 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 20:43:24 -0000 Author: hselasky Date: Thu Nov 1 20:43:23 2012 New Revision: 242455 URL: http://svn.freebsd.org/changeset/base/242455 Log: Increase default volume for FastTracker playback channels. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Nov 1 20:39:39 2012 (r242454) +++ head/sys/dev/sound/usb/uaudio.c Thu Nov 1 20:43:23 2012 (r242455) @@ -2250,7 +2250,7 @@ uaudio_mixer_controls_create_ftu(struct mix.name = "mix_play"; mix.nchan = 1; mix.update[0] = 1; - mix.val_default = (chx == chy) ? 1 : 0; + mix.val_default = (chx == chy) ? 2 : 0; snprintf(mix.desc, sizeof(mix.desc), "DIn%d - Out%d Playback Volume", chy + 1, chx + 1); @@ -2391,12 +2391,15 @@ uaudio_mixer_add_ctl_sub(struct uaudio_s for (ch = 0; ch < p_mc_new->nchan; ch++) { switch (p_mc_new->val_default) { case 1: + /* 50% */ p_mc_new->wData[ch] = (p_mc_new->maxval + p_mc_new->minval) / 2; break; case 2: + /* 100% */ p_mc_new->wData[ch] = p_mc_new->maxval; break; default: + /* 0% */ p_mc_new->wData[ch] = p_mc_new->minval; break; } From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 20:58:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 46523ABF; Thu, 1 Nov 2012 20:58:56 +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 2C8338FC12; Thu, 1 Nov 2012 20:58:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1KwuBh075005; Thu, 1 Nov 2012 20:58:56 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1KwtLO075003; Thu, 1 Nov 2012 20:58:55 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201211012058.qA1KwtLO075003@svn.freebsd.org> From: Hans Petter Selasky Date: Thu, 1 Nov 2012 20:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242458 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 20:58:56 -0000 Author: hselasky Date: Thu Nov 1 20:58:55 2012 New Revision: 242458 URL: http://svn.freebsd.org/changeset/base/242458 Log: Correct buffer size printout. MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Thu Nov 1 20:47:18 2012 (r242457) +++ head/sys/dev/sound/usb/uaudio.c Thu Nov 1 20:58:55 2012 (r242458) @@ -745,26 +745,20 @@ uaudio_attach(device_t dev) if (sc->sc_play_chan.valid) { device_printf(dev, "Play: %d Hz, %d ch, %s format, " - "2x%d samples buffer.\n", + "2x8ms buffer.\n", sc->sc_play_chan.sample_rate, sc->sc_play_chan.channels, - sc->sc_play_chan.p_fmt->description, - (sc->sc_play_chan.bytes_per_frame[0] * - sc->sc_play_chan.intr_frames) / - sc->sc_play_chan.sample_size); + sc->sc_play_chan.p_fmt->description); } else { device_printf(dev, "No playback.\n"); } if (sc->sc_rec_chan.valid) { device_printf(dev, "Record: %d Hz, %d ch, %s format, " - "2x%d samples buffer.\n", + "2x8ms buffer.\n", sc->sc_rec_chan.sample_rate, sc->sc_rec_chan.channels, - sc->sc_rec_chan.p_fmt->description, - (sc->sc_rec_chan.bytes_per_frame[0] * - sc->sc_rec_chan.intr_frames) / - sc->sc_rec_chan.sample_size); + sc->sc_rec_chan.p_fmt->description); } else { device_printf(dev, "No recording.\n"); } From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 21:00:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B3D95BE0; Thu, 1 Nov 2012 21:00:14 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 82F7F8FC08; Thu, 1 Nov 2012 21:00:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1L0Eqm075301; Thu, 1 Nov 2012 21:00:14 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1L0ESp075299; Thu, 1 Nov 2012 21:00:14 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201211012100.qA1L0ESp075299@svn.freebsd.org> From: Jim Harris Date: Thu, 1 Nov 2012 21:00:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242459 - head/share/man/man9 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 21:00:14 -0000 Author: jimharris Date: Thu Nov 1 21:00:13 2012 New Revision: 242459 URL: http://svn.freebsd.org/changeset/base/242459 Log: Add descriptions for callout_reset_on and callout_schedule_on and their curcpu variants. Discussed with: mav, davide MFC after: 1 week Modified: head/share/man/man9/timeout.9 Modified: head/share/man/man9/timeout.9 ============================================================================== --- head/share/man/man9/timeout.9 Thu Nov 1 20:58:55 2012 (r242458) +++ head/share/man/man9/timeout.9 Thu Nov 1 21:00:13 2012 (r242459) @@ -29,7 +29,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 2, 2008 +.Dd November 1, 2012 .Dt TIMEOUT 9 .Os .Sh NAME @@ -42,7 +42,11 @@ .Nm callout_stop , .Nm callout_drain , .Nm callout_reset , +.Nm callout_reset_on , +.Nm callout_reset_curcpu , .Nm callout_schedule , +.Nm callout_schedule_on , +.Nm callout_schedule_curcpu , .Nm callout_pending , .Nm callout_active , .Nm callout_deactivate @@ -75,8 +79,18 @@ struct callout_handle handle = CALLOUT_H .Ft int .Fn callout_reset "struct callout *c" "int ticks" "timeout_t *func" "void *arg" .Ft int +.Fn callout_reset_on "struct callout *c" "int ticks" "timeout_t *func" \ +"void *arg" "int cpu" +.Ft int +.Fn callout_reset_curcpu "struct callout *c" "int ticks" "timeout_t *func" \ +"void *arg" +.Ft int .Fn callout_schedule "struct callout *c" "int ticks" .Ft int +.Fn callout_schedule_on "struct callout *c" "int ticks" "int cpu" +.Ft int +.Fn callout_schedule_curcpu "struct callout *c" "int ticks" +.Ft int .Fn callout_pending "struct callout *c" .Ft int .Fn callout_active "struct callout *c" @@ -302,6 +316,26 @@ and parameters extracted from the callout structure (though possibly with lower overhead). .Pp +The functions +.Fn callout_reset_on +and +.Fn callout_schedule_on +are equivalent to +.Fn callout_reset +and +.Fn callout_schedule +but take an extra parameter specifying the target CPU for the callout. +.Pp +The functions +.Fn callout_reset_curcpu +and +.Fn callout_schedule_curcpu +are wrappers for +.Fn callout_reset_on +and +.Fn callout_schedule_on +using the current CPU as the target CPU. +.Pp The macros .Fn callout_pending , .Fn callout_active From owner-svn-src-head@FreeBSD.ORG Thu Nov 1 22:47:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D44E0921; Thu, 1 Nov 2012 22:47:42 +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 BD1E28FC08; Thu, 1 Nov 2012 22:47:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA1MlgA5091016; Thu, 1 Nov 2012 22:47:42 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA1MlgCd091014; Thu, 1 Nov 2012 22:47:42 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211012247.qA1MlgCd091014@svn.freebsd.org> From: Jilles Tjoelker Date: Thu, 1 Nov 2012 22:47:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242460 - head/lib/libc/stdio X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Nov 2012 22:47:42 -0000 Author: jilles Date: Thu Nov 1 22:47:42 2012 New Revision: 242460 URL: http://svn.freebsd.org/changeset/base/242460 Log: fopen(3): Mention that the "x" mode option is from C11. MFC after: 1 week Modified: head/lib/libc/stdio/fopen.3 Modified: head/lib/libc/stdio/fopen.3 ============================================================================== --- head/lib/libc/stdio/fopen.3 Thu Nov 1 21:00:13 2012 (r242459) +++ head/lib/libc/stdio/fopen.3 Thu Nov 1 22:47:42 2012 (r242460) @@ -267,7 +267,11 @@ and .Fn freopen functions conform to -.St -isoC . +.St -isoC , +with the exception of the +.Dq Li x +mode option which conforms to +.St -isoC-2011 . The .Fn fdopen function From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 00:17:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E13EE51D; Fri, 2 Nov 2012 00:17:30 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C91ED8FC0A; Fri, 2 Nov 2012 00:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA20HUD0005286; Fri, 2 Nov 2012 00:17:30 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA20HU9k005284; Fri, 2 Nov 2012 00:17:30 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211020017.qA20HU9k005284@svn.freebsd.org> From: Eitan Adler Date: Fri, 2 Nov 2012 00:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242462 - head/etc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 00:17:31 -0000 Author: eadler Date: Fri Nov 2 00:17:30 2012 New Revision: 242462 URL: http://svn.freebsd.org/changeset/base/242462 Log: 10 years too late add support for "2.88MB 3.5in Extra High Density" floppies. Its unlikely that anyone actually uses these or cares about these anymore, since we support other floppy types and this change doesn't hurt - just add it. PR: conf/40777 Submitted by: Antti Kantee Arrival-Date: Fri Jul 19 08:50:02 PDT 2002 Approved by: cperciva (implicit) MFC after: 1 week Modified: head/etc/disktab Modified: head/etc/disktab ============================================================================== --- head/etc/disktab Thu Nov 1 22:51:44 2012 (r242461) +++ head/etc/disktab Fri Nov 2 00:17:30 2012 (r242462) @@ -42,6 +42,12 @@ fd1440|floppy|floppy3|3in|3.5in High Den :pa#2880:oa#0:ba#4096:fa#512:\ :pc#2880:oc#0:bc#4096:fc#512: +fd2880|2.88MB 3.5in Extra High Density Floppy:\ + :ty=floppy:se#512:nt#2:rm#300:ns#36:nc#80:\ + :pa#5760:oa#0:ba#4096:fa#512:\ + :pb#5760:ob#0:bb#4096:fa#512:\ + :pc#5760:oc#0:bb#4096:fa#512: + # # Stressed floppy-formats. No guarantees given. # From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 01:20:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B2540D7B; Fri, 2 Nov 2012 01:20:56 +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 98E238FC12; Fri, 2 Nov 2012 01:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA21KumQ015056; Fri, 2 Nov 2012 01:20:56 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA21Kuwn015037; Fri, 2 Nov 2012 01:20:56 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201211020120.qA21Kuwn015037@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 2 Nov 2012 01:20:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242463 - in head: . sbin/ipfw sys/net sys/netinet sys/netinet6 sys/netpfil/ipfw X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 01:20:56 -0000 Author: ae Date: Fri Nov 2 01:20:55 2012 New Revision: 242463 URL: http://svn.freebsd.org/changeset/base/242463 Log: Remove the recently added sysctl variable net.pfil.forward. Instead, add protocol specific mbuf flags M_IP_NEXTHOP and M_IP6_NEXTHOP. Use them to indicate that the mbuf's chain contains the PACKET_TAG_IPFORWARD tag. And do a tag lookup only when this flag is set. Suggested by: andre Modified: head/UPDATING head/sbin/ipfw/ipfw.8 head/sys/net/pfil.c head/sys/net/pfil.h head/sys/netinet/ip_fastfwd.c head/sys/netinet/ip_input.c head/sys/netinet/ip_output.c head/sys/netinet/ip_var.h head/sys/netinet/tcp_input.c head/sys/netinet/udp_usrreq.c head/sys/netinet6/ip6_forward.c head/sys/netinet6/ip6_input.c head/sys/netinet6/ip6_output.c head/sys/netinet6/ip6_var.h head/sys/netinet6/udp6_usrreq.c head/sys/netpfil/ipfw/ip_fw2.c head/sys/netpfil/ipfw/ip_fw_pfil.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Fri Nov 2 00:17:30 2012 (r242462) +++ head/UPDATING Fri Nov 2 01:20:55 2012 (r242463) @@ -24,10 +24,9 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 disable the most expensive debugging functionality run "ln -s 'abort:false,junk:false' /etc/malloc.conf".) -20121025: +20121102: The IPFIREWALL_FORWARD kernel option has been removed. Its - functionality now can be turned on using the net.pfil.forward - sysctl variable. + functionality now turned on by default. 20121023: The ZERO_COPY_SOCKET kernel option has been removed and Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Fri Nov 2 00:17:30 2012 (r242462) +++ head/sbin/ipfw/ipfw.8 Fri Nov 2 01:20:55 2012 (r242463) @@ -774,14 +774,6 @@ This makes the .Xr netstat 1 entry look rather weird but is intended for use with transparent proxy servers. -.Pp -To enable -.Cm fwd -the -.Xr sysctl 8 -variable -.Va net.pfil.forward -should be set to 1. .It Cm nat Ar nat_nr | tablearg Pass packet to a nat instance Modified: head/sys/net/pfil.c ============================================================================== --- head/sys/net/pfil.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/net/pfil.c Fri Nov 2 01:20:55 2012 (r242463) @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include @@ -65,11 +64,6 @@ VNET_DEFINE(struct pfilheadhead, pfil_he VNET_DEFINE(struct rmlock, pfil_lock); #define V_pfil_lock VNET(pfil_lock) -VNET_DEFINE(int, pfilforward) = 0; -SYSCTL_NODE(_net, OID_AUTO, pfil, CTLFLAG_RW, 0, "Packer filter interface"); -SYSCTL_VNET_INT(_net_pfil, OID_AUTO, forward, CTLFLAG_RW, - &VNET_NAME(pfilforward), 0, - "Enable forwarding performed by packet filters"); /* * pfil_run_hooks() runs the specified packet filter hooks. */ Modified: head/sys/net/pfil.h ============================================================================== --- head/sys/net/pfil.h Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/net/pfil.h Fri Nov 2 01:20:55 2012 (r242463) @@ -38,14 +38,11 @@ #include #include #include -#include struct mbuf; struct ifnet; struct inpcb; -VNET_DECLARE(int, pfilforward); -#define V_pfilforward VNET(pfilforward) /* * The packet filter hooks are designed for anything to call them to * possibly intercept the packet. Modified: head/sys/netinet/ip_fastfwd.c ============================================================================== --- head/sys/netinet/ip_fastfwd.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/ip_fastfwd.c Fri Nov 2 01:20:55 2012 (r242463) @@ -446,7 +446,7 @@ passin: /* * Destination address changed? */ - if (V_pfilforward != 0) + if (m->m_flags & M_IP_NEXTHOP) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); if (odest.s_addr != dest.s_addr || fwd_tag != NULL) { /* @@ -469,6 +469,7 @@ forwardlocal: dest.s_addr = ((struct sockaddr_in *) (fwd_tag + 1))->sin_addr.s_addr; m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } RTFREE(ro.ro_rt); if ((dst = ip_findroute(&ro, dest, m)) == NULL) Modified: head/sys/netinet/ip_input.c ============================================================================== --- head/sys/netinet/ip_input.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/ip_input.c Fri Nov 2 01:20:55 2012 (r242463) @@ -509,23 +509,22 @@ tooshort: dchg = (odst.s_addr != ip->ip_dst.s_addr); ifp = m->m_pkthdr.rcvif; - if (V_pfilforward == 0) - goto passin; - if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; goto ours; } - if ((dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL)) != 0) { - /* - * Directly ship the packet on. This allows forwarding - * packets originally destined to us to some other directly - * connected host. - */ - ip_forward(m, dchg); - return; + if (m->m_flags & M_IP_NEXTHOP) { + dchg = (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL); + if (dchg != 0) { + /* + * Directly ship the packet on. This allows + * forwarding packets originally destined to us + * to some other directly connected host. + */ + ip_forward(m, 1); + return; + } } - passin: /* Modified: head/sys/netinet/ip_output.c ============================================================================== --- head/sys/netinet/ip_output.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/ip_output.c Fri Nov 2 01:20:55 2012 (r242463) @@ -537,9 +537,6 @@ sendit: } } - if (V_pfilforward == 0) - goto passout; - /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -560,11 +557,12 @@ sendit: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP_NEXTHOP; m_tag_delete(m, fwd_tag); if (ia != NULL) ifa_free(&ia->ia_ifa); Modified: head/sys/netinet/ip_var.h ============================================================================== --- head/sys/netinet/ip_var.h Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/ip_var.h Fri Nov 2 01:20:55 2012 (r242463) @@ -163,6 +163,7 @@ void kmod_ipstat_dec(int statnum); * mbuf flag used by ip_fastfwd */ #define M_FASTFWD_OURS M_PROTO1 /* changed dst to local */ +#define M_IP_NEXTHOP M_PROTO2 /* explicit ip nexthop */ #ifdef __NO_STRICT_ALIGNMENT #define IP_HDR_ALIGNED_P(ip) 1 Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/tcp_input.c Fri Nov 2 01:20:55 2012 (r242463) @@ -75,7 +75,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -781,7 +780,7 @@ findpcb: /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - if (V_pfilforward != 0) + if (m->m_flags & M_IP_NEXTHOP) fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); #ifdef INET6 @@ -810,6 +809,7 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else if (isipv6) { inp = in6_pcblookup_mbuf(&V_tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, @@ -846,6 +846,7 @@ findpcb: } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else inp = in_pcblookup_mbuf(&V_tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, Modified: head/sys/netinet/udp_usrreq.c ============================================================================== --- head/sys/netinet/udp_usrreq.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet/udp_usrreq.c Fri Nov 2 01:20:55 2012 (r242463) @@ -65,7 +65,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -549,7 +548,7 @@ udp_input(struct mbuf *m, int off) /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - if (V_pfilforward != 0 && + if ((m->m_flags & M_IP_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in *next_hop; @@ -575,6 +574,7 @@ udp_input(struct mbuf *m, int off) } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP_NEXTHOP; } else inp = in_pcblookup_mbuf(&V_udbinfo, ip->ip_src, uh->uh_sport, ip->ip_dst, uh->uh_dport, INPLOOKUP_WILDCARD | Modified: head/sys/netinet6/ip6_forward.c ============================================================================== --- head/sys/netinet6/ip6_forward.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet6/ip6_forward.c Fri Nov 2 01:20:55 2012 (r242463) @@ -592,8 +592,6 @@ skip_routing: goto again; /* Redo the routing table lookup. */ } - if (V_pfilforward == 0) - goto pass; /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -611,11 +609,12 @@ skip_routing: goto out; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&rin6.ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again2; } Modified: head/sys/netinet6/ip6_input.c ============================================================================== --- head/sys/netinet6/ip6_input.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet6/ip6_input.c Fri Nov 2 01:20:55 2012 (r242463) @@ -628,15 +628,14 @@ ip6_input(struct mbuf *m) ip6 = mtod(m, struct ip6_hdr *); srcrt = !IN6_ARE_ADDR_EQUAL(&odst, &ip6->ip6_dst); - if (V_pfilforward == 0) - goto passin; if (m->m_flags & M_FASTFWD_OURS) { m->m_flags &= ~M_FASTFWD_OURS; ours = 1; deliverifp = m->m_pkthdr.rcvif; goto hbhcheck; } - if (m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { + if ((m->m_flags & M_IP6_NEXTHOP) && + m_tag_find(m, PACKET_TAG_IPFORWARD, NULL) != NULL) { /* * Directly ship the packet on. This allows forwarding * packets originally destined to us to some other directly Modified: head/sys/netinet6/ip6_output.c ============================================================================== --- head/sys/netinet6/ip6_output.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet6/ip6_output.c Fri Nov 2 01:20:55 2012 (r242463) @@ -913,8 +913,6 @@ again: goto again; /* Redo the routing table lookup. */ } - if (V_pfilforward == 0) - goto passout; /* See if local, if yes, send it to netisr. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) @@ -932,11 +930,12 @@ again: goto done; } /* Or forward to some other address? */ - fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL); - if (fwd_tag) { + if ((m->m_flags & M_IP6_NEXTHOP) && + (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { dst = (struct sockaddr_in6 *)&ro->ro_dst; bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in6)); m->m_flags |= M_SKIP_FIREWALL; + m->m_flags &= ~M_IP6_NEXTHOP; m_tag_delete(m, fwd_tag); goto again; } Modified: head/sys/netinet6/ip6_var.h ============================================================================== --- head/sys/netinet6/ip6_var.h Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet6/ip6_var.h Fri Nov 2 01:20:55 2012 (r242463) @@ -285,6 +285,8 @@ struct ip6aux { #define IPV6_FORWARDING 0x02 /* most of IPv6 header exists */ #define IPV6_MINMTU 0x04 /* use minimum MTU (IPV6_USE_MIN_MTU) */ +#define M_IP6_NEXTHOP M_PROTO2 /* explicit ip nexthop */ + #ifdef __NO_STRICT_ALIGNMENT #define IP6_HDR_ALIGNED_P(ip) 1 #else Modified: head/sys/netinet6/udp6_usrreq.c ============================================================================== --- head/sys/netinet6/udp6_usrreq.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netinet6/udp6_usrreq.c Fri Nov 2 01:20:55 2012 (r242463) @@ -92,7 +92,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -396,7 +395,7 @@ udp6_input(struct mbuf **mp, int *offp, /* * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain. */ - if (V_pfilforward != 0 && + if ((m->m_flags & M_IP6_NEXTHOP) && (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) { struct sockaddr_in6 *next_hop6; @@ -423,6 +422,7 @@ udp6_input(struct mbuf **mp, int *offp, } /* Remove the tag from the packet. We don't need it anymore. */ m_tag_delete(m, fwd_tag); + m->m_flags &= ~M_IP6_NEXTHOP; } else inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src, uh->uh_sport, &ip6->ip6_dst, uh->uh_dport, Modified: head/sys/netpfil/ipfw/ip_fw2.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netpfil/ipfw/ip_fw2.c Fri Nov 2 01:20:55 2012 (r242463) @@ -2535,7 +2535,6 @@ ipfw_init(void) "(+ipv6) " #endif "initialized, divert %s, nat %s, " - "rule-based forwarding turned %s, " "default to %s, logging ", #ifdef IPDIVERT "enabled", @@ -2547,7 +2546,6 @@ ipfw_init(void) #else "loadable", #endif - V_pfilforward ? "on": "off", default_to_accept ? "accept" : "deny"); /* Modified: head/sys/netpfil/ipfw/ip_fw_pfil.c ============================================================================== --- head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 2 00:17:30 2012 (r242462) +++ head/sys/netpfil/ipfw/ip_fw_pfil.c Fri Nov 2 01:20:55 2012 (r242463) @@ -159,8 +159,6 @@ again: /* next_hop may be set by ipfw_chk */ if (args.next_hop == NULL && args.next_hop6 == NULL) break; /* pass */ - if (V_pfilforward == 0) - break; #if (!defined(INET6) && !defined(INET)) ret = EACCES; #else @@ -201,6 +199,7 @@ again: bcopy(args.next_hop6, (fwd_tag+1), len); if (in6_localip(&args.next_hop6->sin6_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP6_NEXTHOP; } #endif #ifdef INET @@ -208,6 +207,7 @@ again: bcopy(args.next_hop, (fwd_tag+1), len); if (in_localip(args.next_hop->sin_addr)) (*m0)->m_flags |= M_FASTFWD_OURS; + (*m0)->m_flags |= M_IP_NEXTHOP; } #endif m_tag_prepend(*m0, fwd_tag); From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 03:33:07 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1B10EE57; Fri, 2 Nov 2012 03:33:07 +0000 (UTC) (envelope-from tim@kientzle.com) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id DDD1E8FC0C; Fri, 2 Nov 2012 03:33:06 +0000 (UTC) Received: (from root@localhost) by monday.kientzle.com (8.14.4/8.14.4) id qA23X3BD084513; Fri, 2 Nov 2012 03:33:03 GMT (envelope-from tim@kientzle.com) Received: from [192.168.2.143] (CiscoE3000 [192.168.1.65]) by kientzle.com with SMTP id 76w8jhcpib65dzm954xixj4v3e; Fri, 02 Nov 2012 03:33:03 +0000 (UTC) (envelope-from tim@kientzle.com) Subject: Re: svn commit: r242402 - in head/sys: kern vm Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <1351780635.1120.135.camel@revolution.hippie.lan> Date: Thu, 1 Nov 2012 20:33:03 -0700 Content-Transfer-Encoding: 7bit Message-Id: <3C3AB59A-E74F-4CB8-B129-557598B1B02A@kientzle.com> References: <201210311807.q9VI7IcX000993@svn.freebsd.org> <1351707964.1120.97.camel@revolution.hippie.lan> <20121101100814.GB70741@FreeBSD.org> <1351778472.1120.117.camel@revolution.hippie.lan> <1351780635.1120.135.camel@revolution.hippie.lan> To: Ian Lepore X-Mailer: Apple Mail (2.1283) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 03:33:07 -0000 On Nov 1, 2012, at 7:37 AM, Ian Lepore wrote: > > Back from some quick googling... yep, arm cortex-a8 processors have a > 64-byte cache line size. Maybe we don't support those yet, which is why > the value appears to be constant in arm param.h right now. Beaglebone runs a Cortex-A8. There's a lot of folks playing with those. Tim From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 05:22:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C03D67E; Fri, 2 Nov 2012 05:22:33 +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 E976B8FC12; Fri, 2 Nov 2012 05:22:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA25MW9t051965; Fri, 2 Nov 2012 05:22:32 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA25MWWG051963; Fri, 2 Nov 2012 05:22:32 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211020522.qA25MWWG051963@svn.freebsd.org> From: Adrian Chadd Date: Fri, 2 Nov 2012 05:22:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242465 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 05:22:33 -0000 Author: adrian Date: Fri Nov 2 05:22:32 2012 New Revision: 242465 URL: http://svn.freebsd.org/changeset/base/242465 Log: Free the dma map -after- it's checked, not before. Or you'll be potentially referencing already-freed memory. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Fri Nov 2 01:32:22 2012 (r242464) +++ head/sys/mips/mips/busdma_machdep.c Fri Nov 2 05:22:32 2012 (r242465) @@ -549,7 +549,6 @@ int bus_dmamap_destroy(bus_dma_tag_t dmat, bus_dmamap_t map) { - _busdma_free_dmamap(map); if (STAILQ_FIRST(&map->bpages) != NULL) { CTR3(KTR_BUSDMA, "%s: tag %p error %d", __func__, dmat, EBUSY); @@ -558,6 +557,7 @@ bus_dmamap_destroy(bus_dma_tag_t dmat, b if (dmat->bounce_zone) dmat->bounce_zone->map_count--; dmat->map_count--; + _busdma_free_dmamap(map); CTR2(KTR_BUSDMA, "%s: tag %p error 0", __func__, dmat); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 05:23:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA5017F3; Fri, 2 Nov 2012 05:23:05 +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 D1FC28FC08; Fri, 2 Nov 2012 05:23:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA25N5vU052086; Fri, 2 Nov 2012 05:23:05 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA25N5No052084; Fri, 2 Nov 2012 05:23:05 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211020523.qA25N5No052084@svn.freebsd.org> From: Adrian Chadd Date: Fri, 2 Nov 2012 05:23:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242466 - head/sys/mips/mips X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 05:23:06 -0000 Author: adrian Date: Fri Nov 2 05:23:05 2012 New Revision: 242466 URL: http://svn.freebsd.org/changeset/base/242466 Log: Drop this from 500 to 128, to save a little space on memory constrained platforms. Modified: head/sys/mips/mips/busdma_machdep.c Modified: head/sys/mips/mips/busdma_machdep.c ============================================================================== --- head/sys/mips/mips/busdma_machdep.c Fri Nov 2 05:22:32 2012 (r242465) +++ head/sys/mips/mips/busdma_machdep.c Fri Nov 2 05:23:05 2012 (r242466) @@ -153,7 +153,7 @@ static STAILQ_HEAD(, bus_dmamap) bounce_ static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = TAILQ_HEAD_INITIALIZER(dmamap_freelist); -#define BUSDMA_STATIC_MAPS 500 +#define BUSDMA_STATIC_MAPS 128 static struct bus_dmamap map_pool[BUSDMA_STATIC_MAPS]; static struct mtx busdma_mtx; From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 05:26:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F26C39D1; Fri, 2 Nov 2012 05:26:33 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DAD568FC17; Fri, 2 Nov 2012 05:26:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA25QXt7052676; Fri, 2 Nov 2012 05:26:33 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA25QXpa052673; Fri, 2 Nov 2012 05:26:33 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211020526.qA25QXpa052673@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 2 Nov 2012 05:26:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242467 - head/sys/dev/drm2 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 05:26:34 -0000 Author: glebius Date: Fri Nov 2 05:26:33 2012 New Revision: 242467 URL: http://svn.freebsd.org/changeset/base/242467 Log: - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to all supported debugging bits. - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag to zero. DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM or if kernel config has 'options DEBUG_DRM'. Reviewed by: kib Modified: head/sys/dev/drm2/drm_drv.c Modified: head/sys/dev/drm2/drm_drv.c ============================================================================== --- head/sys/dev/drm2/drm_drv.c Fri Nov 2 05:23:05 2012 (r242466) +++ head/sys/dev/drm2/drm_drv.c Fri Nov 2 05:26:33 2012 (r242467) @@ -44,9 +44,10 @@ __FBSDID("$FreeBSD$"); #include #ifdef DRM_DEBUG_DEFAULT_ON -int drm_debug_flag = 1; +int drm_debug_flag = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS | + DRM_DEBUGBITS_FAILED_IOCTL); #else -int drm_debug_flag = 2; +int drm_debug_flag = 0; #endif int drm_notyet_flag = 0; From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 07:36:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 98332319; Fri, 2 Nov 2012 07:36:17 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 810A78FC12; Fri, 2 Nov 2012 07:36:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA27aHaA074117; Fri, 2 Nov 2012 07:36:17 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA27aHQf074115; Fri, 2 Nov 2012 07:36:17 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201211020736.qA27aHQf074115@svn.freebsd.org> From: Maxim Konovalov Date: Fri, 2 Nov 2012 07:36:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242468 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 07:36:17 -0000 Author: maxim Date: Fri Nov 2 07:36:16 2012 New Revision: 242468 URL: http://svn.freebsd.org/changeset/base/242468 Log: o OpenBSD 5.2 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Fri Nov 2 05:26:33 2012 (r242467) +++ head/share/misc/bsd-family-tree Fri Nov 2 07:36:16 2012 (r242468) @@ -257,6 +257,7 @@ FreeBSD 5.2 | | | Mac OS X | | | | 10.8 | | | | | NetBSD 6.0 | | + | | | OpenBSD 5.2 | | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | @@ -552,6 +553,7 @@ FreeBSD 8.3 2012-04-18 [FBD] OpenBSD 5.1 2012-05-01 [OBD] Mac OS X 10.8 2012-07-25 [APL] NetBSD 6.0 2012-10-17 [NBD] +OpenBSD 5.2 2012-11-01 [OBD] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 07:49:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2BCDB537; Fri, 2 Nov 2012 07:49:34 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 218468FC08; Fri, 2 Nov 2012 07:49:33 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8D6D0408; Fri, 2 Nov 2012 08:47:56 +0100 (CET) Date: Fri, 2 Nov 2012 08:50:16 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r242439 - in head/sys: dev/null geom kern sys Message-ID: <20121102075016.GH1399@garage.freebsd.pl> References: <201211011701.qA1H15fb036810@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="J/zg8ciPNcraoWb6" Content-Disposition: inline In-Reply-To: <201211011701.qA1H15fb036810@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 07:49:34 -0000 --J/zg8ciPNcraoWb6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2012 at 05:01:05PM +0000, Alfred Perlstein wrote: > + strlcpy(dumpdevname, devname, sizeof(dumpdevname)); > + if (strlen(dumpdevname) !=3D strlen(devname)) { > + printf("set_dumper: device name truncated from '%s' -> '%s'\n", > + devname, dumpdevname); > + } More "standard" way to check this is the following: if (strlcpy(dumpdevname, devname, sizeof(dumpdevname)) >=3D sizeof(dumpdevname)) { printf("set_dumper: device name truncated from '%s' -> '%s'\n", devname, dumpdevname); } --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --J/zg8ciPNcraoWb6 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCTezcACgkQForvXbEpPzTx7ACgnrILt6f0uPGzrfl/F8aLpoC7 VbMAoIoeu3hV4f8uAaBflYHLurwJM8vG =49tL -----END PGP SIGNATURE----- --J/zg8ciPNcraoWb6-- From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 07:52:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D23A7C0; Fri, 2 Nov 2012 07:52:44 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (garage.dawidek.net [91.121.88.72]) by mx1.freebsd.org (Postfix) with ESMTP id 2D4E88FC15; Fri, 2 Nov 2012 07:52:44 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 8690040A; Fri, 2 Nov 2012 08:51:14 +0100 (CET) Date: Fri, 2 Nov 2012 08:53:34 +0100 From: Pawel Jakub Dawidek To: Alfred Perlstein Subject: Re: svn commit: r242451 - head/sbin/dumpon Message-ID: <20121102075334.GI1399@garage.freebsd.pl> References: <201211011859.qA1IxJBI057002@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0XMZdl/q8hSSmFeD" Content-Disposition: inline In-Reply-To: <201211011859.qA1IxJBI057002@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 07:52:44 -0000 --0XMZdl/q8hSSmFeD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 01, 2012 at 06:59:19PM +0000, Alfred Perlstein wrote: > Author: alfred > Date: Thu Nov 1 18:59:19 2012 > New Revision: 242451 > URL: http://svn.freebsd.org/changeset/base/242451 >=20 > Log: > Add an option to display the current dump device via dumpon -l. [...] > +.Nm > +.Fl l [...] > + " dumpon -l"); [...] > + if (verbose) { > + printf("kernel dumps on "); > + } [...] Using -v in addition to -l seems to be changing the output, but neither manual page nor usage mentions it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0XMZdl/q8hSSmFeD Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEUEARECAAYFAlCTe/0ACgkQForvXbEpPzQOKgCdHjWNGe9MOr3AEvDc3AOhjb4x 3GMAmNg/Lww0q8Uy+xQYabyUXwH/0ts= =MFBK -----END PGP SIGNATURE----- --0XMZdl/q8hSSmFeD-- From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 11:13:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6903FC07; Fri, 2 Nov 2012 11:13:45 +0000 (UTC) (envelope-from philip@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4FC378FC0C; Fri, 2 Nov 2012 11:13:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2BDjMg008371; Fri, 2 Nov 2012 11:13:45 GMT (envelope-from philip@svn.freebsd.org) Received: (from philip@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2BDjOT008369; Fri, 2 Nov 2012 11:13:45 GMT (envelope-from philip@svn.freebsd.org) Message-Id: <201211021113.qA2BDjOT008369@svn.freebsd.org> From: Philip Paeps Date: Fri, 2 Nov 2012 11:13:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242471 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 11:13:45 -0000 Author: philip Date: Fri Nov 2 11:13:44 2012 New Revision: 242471 URL: http://svn.freebsd.org/changeset/base/242471 Log: MFV pciids-20121024, r242469 Update to use the latest version of the PCI IDs Repository. MFC after: 1 week Modified: head/share/misc/pci_vendors Modified: head/share/misc/pci_vendors ============================================================================== --- head/share/misc/pci_vendors Fri Nov 2 10:53:42 2012 (r242470) +++ head/share/misc/pci_vendors Fri Nov 2 11:13:44 2012 (r242471) @@ -3,11 +3,11 @@ # # List of PCI ID's # -# Version: 2011.07.14 -# Date: 2011-07-14 03:15:06 +# Version: 2012.10.24 +# Date: 2012-10-24 03:15:01 # # Maintained by Martin Mares and other volunteers from the -# PCI ID Project at http://pciids.sf.net/. +# PCI ID Project at http://pci-ids.ucw.cz/. # # New data are always welcome, especially if they are accurate. If you have # anything to contribute, please follow the instructions at the web site. @@ -76,6 +76,7 @@ 02ac SpeedStream 1012 1012 PCMCIA 10/100 Ethernet Card [RTL81xx] 02e0 XFX Pine Group Inc +0303 Hewlett-Packard Company (Wrong ID) 0308 ZyXEL Communications Corporation 0315 SK-Electronics Co., Ltd. 0357 TTTech AG @@ -89,12 +90,11 @@ 04b3 IBM Corp. 4001 Remote System Administration device [RSA2] 050d Belkin -058f Alcor Micro Corporation 05a9 OmniVision 8519 OV519 series 05e3 CyberDoor 0701 CBD516 -066f Sigmatel Inc. +066f SigmaTel 3410 SMTP3410 3500 SMTP3500 0675 Dynalink @@ -123,8 +123,8 @@ 08e6 Gemalto NV 08ff AuthenTec afe4 [Anchor] AF-S2 FingerLoc Sensor Module -0925 First International Computer, Inc. - 1234 VA-502 Mainboard +0925 VIA Technologies, Inc. (Wrong ID) + 1234 VT82C686/A/B USB Controller 093a PixArt Imaging Inc. 010e Innovage Mini Digital Camera 010f SDC-300 Webcam @@ -153,8 +153,6 @@ 0906 RCB24FXX 24-channel modular analog telphony card 0a06 RCB672FXX 672-channel modular analog telphony card 0b3d Brontes Technologies -0b49 ASCII Corporation - 064f Trance Vibrator 0ccd TerraTec Electronic GmbH 0038 Cinergy T^2 DVB-T Receiver 0e11 Compaq Computer Corporation @@ -205,6 +203,7 @@ 7020 USB Controller a0ec Fibre Channel Host Controller a0f0 Advanced System Management Controller + 0e11 b0f3 ProLiant DL360 a0f3 Triflex PCI to ISA Bridge a0f7 PCI Hotplug Controller 8086 002a PCI Hotplug Controller A @@ -328,6 +327,8 @@ 4c53 1080 CT8 mainboard 4c53 1300 P017 mezzanine (32-bit PMC) 4c53 1310 P017 mezzanine (64-bit PMC) + 002f MegaRAID SAS 2208 IOV [Thunderbolt] + 1028 1f3e SPERC 8 0030 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI 0e11 00da ProLiant ML 350 1028 0123 LSI Logic 1020/1030 @@ -378,6 +379,11 @@ 0059 MegaRAID SAS 8208ELP/8208ELP 005a SAS1066E PCI-Express Fusion-MPT SAS 005b MegaRAID SAS 2208 [Thunderbolt] + 1000 9265 MegaRAID SAS 9265-8i + 1000 9266 MegaRAID SAS 9266-8i + 1000 9268 MegaRAID SAS 9265CV-8i / 9270CV-8i + 1014 040b ServeRAID M5110 SAS/SATA Controller + 1014 0412 ServeRAID M5110e SAS/SATA Controller 1028 1f2d PERC H810 Adapter 1028 1f30 PERC H710 Embedded 1028 1f31 PERC H710P Adapter @@ -386,9 +392,11 @@ 1028 1f35 PERC H710 Adapter 1028 1f37 PERC H710 Mini (for blades) 1028 1f38 PERC H710 Mini (for monolithics) + 8086 3513 RMS25CB080 RAID Controller 005c SAS1064A PCI-X Fusion-MPT SAS 005d MegaRAID SAS-3 3108 [Invader] 005e SAS1066 PCI-X Fusion-MPT SAS + 005f MegaRAID SAS-3 3008 [Fury] 0060 MegaRAID SAS 1078 1000 1006 MegaRAID SAS 8888ELP 1000 100a MegaRAID SAS 8708ELP @@ -419,13 +427,14 @@ 8086 1010 RAID Controller SRCSATA28E 8086 34cc Integrated RAID Controller SROMBSAS28E 8086 34cd Integrated RAID Controller SROMBSAS28E + 8086 3505 Integrated RAID Controller SROMBSASMP2 0062 SAS1078 PCI-Express Fusion-MPT SAS 1000 0062 SAS1078 PCI-Express Fusion-MPT SAS 0064 SAS2116 PCI-Express Fusion-MPT SAS-2 [Meteor] 0065 SAS2116 PCI-Express Fusion-MPT SAS-2 [Meteor] 006e SAS2308 PCI-Express Fusion-MPT SAS-2 0070 SAS2004 PCI-Express Fusion-MPT SAS-2 [Spitfire] - 0071 MR SAS HBA + 0071 MR SAS HBA 2004 0072 SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon] 1028 1f1c 6Gbps SAS HBA Adapter 1028 1f1d PERC H200 Adapter @@ -434,9 +443,10 @@ 1028 1f20 PERC H200 Embedded 1028 1f22 Internal Tape Adapter 8086 350f RMS2LL040 RAID Controller - 0073 MegaRAID SAS 9240 + 0073 MegaRAID SAS 2008 [Falcon] 1000 9240 MegaRAID SAS 9240-8i 1000 9241 MegaRAID SAS 9240-4i + 1000 92a0 MegaRAID SAS 9220-8i 1014 03b1 ServeRAID M1015 SAS/SATA Controller 1028 1f4e PERC H310 Adapter 1028 1f4f PERC H310 Integrated @@ -448,6 +458,8 @@ 1054 3035 LSI MegaRAID SAS 9240-8i 1137 0072 2004 iMR ROMB 1137 0073 2008 ROMB + 1137 00b0 UCSC RAID SAS 2008M-8i + 1137 00b1 UCSC RAID SAS 2008M-8i 15d9 0400 Supermicro SMC2008-iMR 1734 1177 RAID Ctrl SAS 6G 0/1 (D2607) 8086 350d RMS2AF040 RAID Controller @@ -464,6 +476,8 @@ 1000 9262 MegaRAID SAS 9262-8i 1000 9263 MegaRAID SAS 9261-8i 1000 9264 MegaRAID SAS 9264-8i + 1000 9267 MegaRAID SAS 9260CV-4i + 1000 9268 MegaRAID SAS 9260CV-8i 1000 9275 MegaRAID SAS 9280-8ex 1000 9276 MR9260-16i 1000 9280 MegaRAID SAS 9280-8e @@ -498,6 +512,7 @@ 0085 SAS2208 PCI-Express Fusion-MPT SAS-2 0086 SAS2308 PCI-Express Fusion-MPT SAS-2 0087 SAS2308 PCI-Express Fusion-MPT SAS-2 + 1590 0044 H220i 008f 53c875J 1092 8000 FirePort 40 SCSI Controller 1092 8760 FirePort 40 Dual SCSI Host Adapter @@ -533,7 +548,7 @@ 8086 3008 MegaRAID RAID Controller SRCS28X 8086 3431 MegaRAID RAID Controller Alief SROMBU42E 8086 3499 MegaRAID RAID Controller Harwich SROMBU42E - 0411 MegaRAID SAS + 0411 MegaRAID SAS 1068 1000 1001 MegaRAID SAS 8408E 1000 1002 MegaRAID SAS 8480E 1000 1003 MegaRAID SAS 8344ELP @@ -552,7 +567,7 @@ 8086 3500 SROMBSAS18E RAID Controller 8086 3501 SROMBSAS18E RAID Controller 8086 3504 SROMBSAS18E RAID Controller - 0413 MegaRAID SAS Verde ZCR + 0413 MegaRAID SAS 1068 [Verde ZCR] 1000 1005 MegaRAID SAS 8300XLP 0621 FC909 Fibre Channel Adapter 0622 FC929 Fibre Channel Adapter @@ -601,19 +616,23 @@ 0016 PCI-MFB Analogue I/O board 0017 PROTO-3 PCI Prototyping board 9100 INI-9100/9100W SCSI Host -1002 ATI Technologies Inc +# nee ATI Technologies Inc. +1002 Advanced Micro Devices [AMD] nee ATI 1314 Wrestler HDMI Audio [Radeon HD 6250/6310] + 174b 1001 Sapphire PURE Fusion Mini + 1714 BeaverCreek HDMI Audio [Radeon HD 6500D and 6400G-6600G series] + 103c 168b ProBook 4535s 3150 M24 1P [Radeon Mobility X600] 103c 0934 nx8220 3151 M24 [FireMV 2400] - 3152 M22 [Radeon Mobility X300] + 3152 RV370 [Mobility Radeon X300] 3154 M24GL [Mobility FireGL V3200] 3171 M24 [FireMV 2400] (Secondary) 3e50 RV380 0x3e50 [Radeon X600] 3e54 RV380 0x3e54 [FireGL V3200] 3e70 RV380 [Radeon X600] (Secondary) - 4136 Radeon IGP 320 M - 4137 Radeon IGP330/340/350 + 4136 RS100 [Radeon IGP320(M)] + 4137 RS200 [Radeon IGP330/340/350] 4144 R300 AD [Radeon 9500 Pro] 4145 R300 AE [Radeon 9700 Pro] 4146 R300 AF [Radeon 9700 Pro] @@ -653,7 +672,7 @@ 4164 R300 AD [Radeon 9500 Pro] (Secondary) 4165 R300 AE [Radeon 9700 Pro] (Secondary) 4166 R300 AF [Radeon 9700 Pro] (Secondary) - 4168 Radeon R350 [Radeon 9800] (Secondary) + 4168 R350 [Radeon 9800] (Secondary) 4170 RV350 AP [Radeon 9600] (Secondary) 1002 0003 R9600 Pro secondary (Asus OEM for HP) 1002 4723 All-in-Wonder 2006 AGP Edition (Secondary) @@ -673,15 +692,15 @@ 1787 4003 Radeon 9600 XT (Secondary) 4173 RV350 AS [Radeon 9550] (Secondary) 1043 010d A9550GE/TD (Secondary) - 4237 Radeon 7000 IGP + 4237 RS250 [Radeon Mobility 7000 IGP] 4242 R200 BB [Radeon All in Wonder 8500DV] 1002 02aa Radeon 8500 AIW DV Edition 4243 R200 BC [Radeon All in Wonder 8500] - 4336 Radeon Mobility U1 + 4336 RS100 [Radeon IGP320M] 1002 4336 Pavilion ze4300 ATI Radeon Mobility U1 (IGP 320 M) 103c 0024 Pavilion ze4400 builtin Video 161f 2029 eMachines M5312 builtin Video - 4337 Radeon IGP 330M/340M/350M + 4337 RS200 [Radeon IGP330M/340M/350M] 1014 053a ThinkPad R40e 103c 0850 Radeon IGP 345M 4341 IXP150 AC'97 Audio Controller @@ -739,7 +758,7 @@ 103c 2a20 Pavilion t3030.de Desktop PC 103c 308b MX6125 1462 7217 Aspire L250 - 4378 SB400 AC'97 Modem Controller + 4378 IXP SB400 AC'97 Modem Controller 1025 0080 Aspire 5024WLMMi 103c 308b MX6125 1462 0131 MS-1013 Notebook @@ -761,7 +780,7 @@ 1458 b005 Gigabyte GA-MA69G-S3H Motherboard 1462 7327 K9AG Neo2 17f2 5999 KI690-AM2 Motherboard - 4381 SB600 Raid-5 SATA + 4381 SB400 SATA Controller (RAID 5 mode) 4382 SB600 AC97 Audio 4383 SBx00 Azalia (Intel HDA) 103c 1611 Pavilion DM1Z-3000 @@ -782,6 +801,8 @@ 1179 ff50 Satellite P305D-S8995E 1458 4385 GA-MA770-DS3rev2.0 Motherboard 1462 7368 K9AG Neo2 + 15d9 a811 H8DGU + 174b 1001 Sapphire PURE Fusion Mini 17f2 5000 KI690-AM2 Motherboard 4386 SB600 USB Controller (EHCI) 103c 280a DC5750 Microtower @@ -834,6 +855,7 @@ 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 174b 1001 Sapphire PURE Fusion Mini 4392 SB7x0/SB8x0/SB9x0 SATA Controller [Non-RAID5 mode] 4393 SB7x0/SB8x0/SB9x0 SATA Controller [RAID5 mode] 4394 SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] @@ -842,24 +864,33 @@ 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 15d9 a811 H8DGU + 174b 1001 Sapphire PURE Fusion Mini 4397 SB7x0/SB8x0/SB9x0 USB OHCI0 Controller 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 15d9 a811 H8DGU + 174b 1001 Sapphire PURE Fusion Mini 4398 SB7x0 USB OHCI1 Controller 1043 82ef M3A78-EH Motherboard + 15d9 a811 H8DGU 4399 SB7x0/SB8x0/SB9x0 USB OHCI2 Controller 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO + 174b 1001 Sapphire PURE Fusion Mini 439c SB7x0/SB8x0/SB9x0 IDE Controller 1043 82ef M3A78-EH Motherboard 439d SB7x0/SB8x0/SB9x0 LPC host controller 103c 1611 Pavilion DM1Z-3000 1043 82ef M3A78-EH Motherboard 1043 8443 M5A88-V EVO - 43a0 SB700/SB800 PCI to PCI bridge (PCIE port 0) - 43a1 SB700/SB800 PCI to PCI bridge (PCIE port 1) - 4437 Radeon Mobility 7000 IGP + 174b 1001 Sapphire PURE Fusion Mini + 43a0 SB700/SB800/SB900 PCI to PCI bridge (PCIE port 0) + 43a1 SB700/SB800/SB900 PCI to PCI bridge (PCIE port 1) + 43a2 SB900 PCI to PCI bridge (PCIE port 2) + 43a3 SB900 PCI to PCI bridge (PCIE port 3) + 4437 RS250 [Radeon Mobility 7000 IGP] 4554 210888ET [Mach64 ET] 4654 Mach64 VT 4742 3D Rage Pro AGP 1X/2X @@ -942,9 +973,9 @@ 1002 0084 Rage 3D Pro AGP 2x XPERT 98 1002 0087 Rage 3D IIC 1002 475a Rage IIC AGP - 4964 Radeon RV250 Id [Radeon 9000] - 4965 Radeon RV250 Ie [Radeon 9000] - 4966 Radeon RV250 If [Radeon 9000] + 4964 RV250 Id [Radeon 9000] + 4965 RV250 Ie [Radeon 9000] + 4966 R250 If [Radeon 9000] 10f1 0002 RV250 If [Tachyon G9000 PRO] 148c 2039 RV250 If [Radeon 9000 Pro "Evil Commando"] 1509 9a00 RV250 If [Radeon 9000 "AT009"] @@ -953,16 +984,16 @@ 174b 7192 RV250 If [Radeon 9000 "Atlantis"] 17af 2005 RV250 If [Excalibur Radeon 9000 Pro] 17af 2006 RV250 If [Excalibur Radeon 9000] - 4967 Radeon RV250 Ig [Radeon 9000] - 496e Radeon RV250 [Radeon 9000] (Secondary) + 4967 RV250 Ig [Radeon 9000] + 496e RV250 [Radeon 9000] (Secondary) 4a48 R420 JH [Radeon X800] 4a49 R420 JI [Radeon X800PRO] 4a4a R420 JJ [Radeon X800SE] 4a4b R420 JK [Radeon X800] 4a4c R420 JL [Radeon X800] 4a4d R420 JM [FireGL X3] - 4a4e M18 JN [Radeon Mobility 9800] - 4a4f Radeon X800 SE (R420) (AGP) + 4a4e R420 JN [Mobility Radeon 9800] + 4a4f R420 [Radeon X800 AGP] 4a50 R420 JP [Radeon X800XT] 4a54 R420 [Radeon X800 VE] 4a69 R420 [Radeon X800 PRO/GTO] (Secondary) @@ -970,9 +1001,9 @@ 4a6b R420 [Radeon X800] (Secondary) 4a70 R420 [X800XT-PE] (Secondary) 4a74 R420 [Radeon X800 VE] (Secondary) - 4b48 Radeon X850 Consumer (R481) + 4b48 R481 [Radeon X850 PCIe] 4b49 R480 [Radeon X850XT] - 4b4a Radeon X850 SE (R480) (AGP) + 4b4a R480 [Radeon X850SE AGP] 4b4b R480 [Radeon X850Pro] 4b4c R481 [Radeon X850XT-PE] 4b69 R480 [Radeon X850XT] (Secondary) @@ -1016,7 +1047,7 @@ 1033 8112 Versa Note VXi 4c53 Rage Mobility L 4c54 264LT [Mach64 LT] - 4c57 Radeon Mobility M7 LW [Radeon Mobility 7500] + 4c57 RV200 [Mobility Radeon 7500] 1014 0517 ThinkPad T30 1014 0530 ThinkPad T42 2373-4WU 1028 00e6 Radeon Mobility M7 LW (Dell Inspiron 8100) @@ -1024,7 +1055,7 @@ 1043 1622 Mobility Radeon M7 (L3C/S) 144d c006 Radeon Mobility M7 LW in vpr Matrix 170B4 4c58 Radeon RV200 LX [Mobility FireGL 7800 M7] - 4c59 Radeon Mobility M6 LY + 4c59 RV100 LY [Mobility Radeon 7000] 0e11 b111 Evo N600c 1014 0235 ThinkPad A30/A30p (2652/2653) 1014 0239 ThinkPad X22/X23/X24 @@ -1032,7 +1063,7 @@ 104d 80e7 VAIO PCG-GR214EP/GR214MP/GR215MP/GR314MP/GR315MP 104d 8140 PCG-Z1SP laptop 1509 1930 Medion MD9703 - 4c5a Radeon Mobility M6 LZ + 4c5a RV100 LZ [Mobility Radeon 7000] 4c64 Radeon RV250 Ld [Radeon Mobility 9000 M9] 4c65 Radeon RV250 Le [Radeon Mobility 9000 M9] 4c66 Radeon RV250 [Mobility FireGL 9000] @@ -1064,10 +1095,10 @@ 144d c00c P35 notebook 1462 0311 MSI M510A 1734 1055 Amilo M1420W - 4e51 M10 NQ [Radeon Mobility 9600] + 4e51 RV350 NQ [Mobility Radeon 9600] 4e52 RV350 [Mobility Radeon 9600 M10] 144d c00c P35 notebook - 4e53 M10 NS [Radeon Mobility 9600] + 4e53 RV350 NS [Mobility Radeon 9600] 4e54 M10 NT [FireGL Mobility T2] 4e56 M11 NV [FireGL Mobility T2e] 4e64 Radeon R300 [Radeon 9700 Pro] (Secondary) @@ -1157,7 +1188,7 @@ 514f Radeon R200 QO [Radeon 8500LE] 5154 R200 QT [Radeon 8500] 5155 R200 QU [Radeon 9100] - 5157 Radeon RV200 QW [Radeon 7500] + 5157 RV200 QW [Radeon 7500] 1002 013a Radeon 7500 1002 0f2b ALL-IN-WONDER VE PCI 1002 103a Dell Optiplex GX260 @@ -1169,8 +1200,8 @@ 174b 7147 RV200 QW [Sapphire Radeon 7500LE] 174b 7161 Radeon RV200 QW [Radeon 7500 LE] 17af 0202 RV200 QW [Excalibur Radeon 7500LE] - 5158 Radeon RV200 QX [Radeon 7500] - 5159 Radeon RV100 QY [Radeon 7000/VE] + 5158 RV200 QX [Radeon 7500] + 5159 RV100 QY [Radeon 7000/VE] 1002 000a Radeon 7000/Radeon VE 1002 000b Radeon 7000 1002 0038 Radeon 7000/Radeon VE @@ -1195,7 +1226,7 @@ 174b 7c28 Sapphire Radeon VE 7000 DDR 1787 0202 RV100 QY [Excalibur Radeon 7000] 17ee 1001 Radeon 7000 64MB DDR + DVI - 515a Radeon RV100 QZ [Radeon 7000/VE] + 515a RV100 QZ [Radeon 7000/VE] 515e ES1000 1028 01bb PowerEdge 1955 Embedded ATI ES1000 1028 01df PowerEdge SC440 @@ -1265,19 +1296,19 @@ 5453 Rage 128 Pro Ultra TS 5454 Rage 128 Pro Ultra TT 5455 Rage 128 Pro Ultra TU - 5460 M22 [Mobility Radeon X300] + 5460 RV370 [Mobility Radeon X300] 1775 1100 CR11/VR11 Single Board Computer - 5461 M22 [Mobility Radeon X300] - 5462 M24 [Radeon Mobility X600] - 5464 M22 [FireGL GL] + 5461 RV370 [Mobility Radeon X300] + 5462 RV380 [Mobility Radeon X600] + 5464 RV370 [Mobility FireGL V3100] 5548 R423 UH [Radeon X800 (PCIE)] 5549 R423 UI [Radeon X800PRO (PCIE)] 554a R423 UJ [Radeon X800LE (PCIE)] 554b R423 UK [Radeon X800SE (PCIE)] - 554c Radeon X800 XTP (R430) (PCIE) + 554c R430 [Radeon X800XTP PCIe] 554d R430 [Radeon X800 XL] (PCIe) 1458 2124 GV-R80L256V-B (AGP) - 554e Radeon X800 SE (R430) (PCIE) + 554e R430 [Radeon X800 SE PCIe] 554f R430 [Radeon X800 (PCIE)] 5550 R423 [FireGL V7100] 5551 R423 [FireGL V5100 (PCIE)] @@ -1306,7 +1337,7 @@ 5831 RS300 Host Bridge 5832 RS300 Host Bridge 5833 Radeon 9100 IGP Host Bridge - 5834 Radeon 9100 IGP + 5834 RS300 [Radeon 9100 IGP] 5835 RS300M AGP [Radeon Mobility 9100IGP] 5838 Radeon 9100 IGP AGP Bridge 5854 Radeon Xpress Series (RS480) @@ -1386,12 +1417,14 @@ 5a10 RD890 Northbridge only dual slot (2x16) PCI-e GFX Hydra part 5a11 RD890 Northbridge only single slot PCI-e GFX Hydra part 5a12 RD890 Northbridge only dual slot (2x8) PCI-e GFX Hydra part + 15d9 a811 H8DGU 5a13 RD890 PCI to PCI bridge (external gfx0 port A) 5a14 RD890 PCI to PCI bridge (external gfx0 port B) 5a15 RD890 PCI to PCI bridge (PCI express gpp port A) 5a16 RD890 PCI to PCI bridge (PCI express gpp port B) 5a17 RD890 PCI to PCI bridge (PCI express gpp port C) 5a18 RD890 PCI to PCI bridge (PCI express gpp port D) + 15d9 a811 H8DGU 5a19 RD890 PCI to PCI bridge (PCI express gpp port E) 5a1a RD890 PCI to PCI bridge (PCI express gpp port F) 5a1b RD890 PCI to PCI bridge (PCI express gpp port G) @@ -1399,6 +1432,9 @@ 5a1d RD890 PCI to PCI bridge (external gfx1 port A) 5a1e RD890 PCI to PCI bridge (external gfx1 port B) 5a1f RD890 PCI to PCI bridge (NB-SB link) + 15d9 a811 H8DGU + 5a20 RD890S PCI Express bridge for GPP2 port 1 + 5a23 RD990 I/O Memory Management Unit (IOMMU) 5a33 Radeon Xpress 200 Host Bridge 5a34 RS480 PCI-X Root Port # Comes in pair with 5a3f @@ -1424,7 +1460,7 @@ 174b 0500 Radeon X300 (PCIE) 196d 1086 X300SE HM 5b62 RV380 [Radeon X600 (PCIE)] - 5b63 RV370 [Sapphire X550 Silent] + 5b63 RV370 [Radeon X550] 5b64 RV370 5B64 [FireGL V3100 (PCIE)] 5b65 RV370 5B65 [FireGL D1100 (PCIE)] 5b66 RV370X @@ -1457,7 +1493,7 @@ 5d4d R480 [Radeon X850XT Platinum (PCIE)] 5d4e Radeon X850 SE (R480) (PCIE) 5d4f R480 [Radeon X800 GTO (PCIE)] - 5d50 FireGL V7200 (R480) (PCIE) + 5d50 R480 [FireGL V7200 (PCIE)] 5d51 R480 GL 12P 5d52 R480 [Radeon X850XT (PCIE)] (Primary) 1002 0b12 PowerColor X850XT PCIe (Primary) @@ -1479,49 +1515,93 @@ 5e6d RV410 [Radeon X700 (PCIE)] (Secondary) 148c 2117 PowerColor Bravo X700 5f57 R423 [Radeon X800XT (PCIE)] - 6718 Cayman XT [AMD Radeon HD 6900 Series] - 6719 Cayman PRO [AMD Radeon 6900 Series] + 6600 Mars [Radeon HD 8600/8700M Series] + 6601 Mars [Radeon HD 8500/8700M Series] + 6606 Mars [Radeon HD 8790M] + 6610 Oland [Radeon HD 8600 Series] + 6611 Oland [Radeon HD 8500 Series] + 6704 Cayman PRO GL [FirePro V7900] + 6707 Cayman LE GL [FirePro V5900] + 6718 Cayman XT [Radeon HD 6970] + 6719 Cayman PRO [Radeon HD 6950] 671d Antilles [AMD Radeon HD 6990] - 671f NI CAYMAN [Radeon HD 6900 Series] - 6720 Blackcomb [AMD Radeon HD 6900M Series] - 6738 Barts XT [ATI Radeon HD 6800 Series] - 6739 Barts PRO [ATI Radeon HD 6800 Series] + 671f Cayman [Radeon HD 6900 Series] + 6720 Blackcomb [Radeon HD 6900M series] + 6738 Barts XT [Radeon HD 6800 Series] + 6739 Barts PRO [Radeon HD 6800 Series] + 1043 03b4 EAH6850 [Radeon HD 6850] 673e Barts LE [AMD Radeon HD 6700 Series] 6740 Whistler XT [AMD Radeon HD 6700M Series] - 6741 NI Whistler [AMD Radeon HD 6600M Series] + 6741 Whistler [AMD Radeon HD 6600M Series] + 106b 00e2 MacBookPro8,2 [Core i7, 15", Late 2011] 6742 Whistler LE [AMD Radeon HD 6625M Graphics] - 6743 NI WHISTLER [Radeon E6760] - 6750 Turks [AMD Radeon HD 6500 series] - 6758 Turks XT [AMD Radeon HD 6600 Series] - 6759 NI Turks [AMD Radeon HD 6500] - 6760 NI Seymour [AMD Radeon HD 6470M] - 6761 NI Seymour [AMD Radeon HD 6430M] - 6763 NI SEYMOUR [Radoen] E6460 - 6770 NI CAICOS [AMD Radeon HD 6400 Series] - 6779 NI Caicos [AMD RADEON HD 6450] + 6743 Whistler [Radeon E6760] + 6749 Turks [FirePro V4900] + 674a Turks [AMD FirePro V3900] + 6750 Turks [AMD Radeon HD 6570] + 6751 Turks [Radeon HD 7600A Series] + 6758 Turks [Radeon HD 6670] + 6759 Turks [Radeon HD 6570] + 675d Turks [Radeon HD 7500 Series] + 6760 Caicos [Radeon HD 6400M/7400M Series] + 1028 04cc Vostro 3350 + 6761 Seymour LP [Radeon HD 6430M] + 6763 Seymour [Radeon E6460] + 6770 Caicos [Radeon HD 6400 Series] + 6772 Caicos [Radeon HD 7400A Series] + 6778 Caicos [Radeon HD 7000 Series] + 6779 Caicos [Radeon HD 6450] 174b e164 Sapphire HD 6450 1GB DDR3 - 6858 SI LOMBOK [Radoen HD 6000 Series] - 6889 EG Cypress [FirePro V7800] + 677b Caicos [Radeon HD 7400 Series] + 6798 Tahiti XT [Radeon HD 7970] + 6799 New Zealand [Radeon HD 7990] + 679a Tahiti PRO [Radeon HD 7950] + 679e Tahiti LE [Radeon HD 7800 Series] + 6800 Wimbledon XT [Radeon HD 7970M] + 6818 Pitcairn [Radeon HD 7800] + 6819 Pitcairn PRO [Radeon HD 7800] + 6820 Radeon HD 8800M Series + 6821 Radeon HD 8800M Series + 6823 Radeon HD 8800M Series + 6825 Cape Verde [Radeon HD 7800M Series] + 682b Radeon HD 8800M Series + 682f Cape Verde [Radeon HD 7700M Series] + 683b Cape Verde [Radeon HD 7700 Series] + 683d Cape Verde [Radeon HD 7700 Series] + 683f Cape Verde PRO [Radeon HD 7700 Series] + 6840 Thames XT/GL [Radeon HD 7600M Series] + 6841 Thames [Radeon 7500M/7600M Series] + 6842 Thames LE [Radeon HD 7000M Series] + 6843 Thames [Radeon HD 7670M] + 6850 Lombok GL AIO [Radeon HD 7570] + 6858 Lombok [Radeon HD 7400 series] + 6888 Cypress [FirePro 3D V8800] + 6889 Cypress [FirePro V7800] + 688a Cypress XT [FirePro 3D V9800] 688c Cypress [AMD FireStream 9370] 688d Cypress [AMD FireStream 9350] - 6898 Radeon HD 5870 (Cypress) + 6898 Cypress XT [Radeon HD 5870] 1462 8032 R5870 PM2D1G - 6899 Cypress [Radeon HD 5800 Series] - 689b EG CYPRESS [Radeon HD 6800 Series] - 689c Hemlock [ATI Radeon HD 5900 Series] - 689e Radeon HD 5800 Series (Cypress LE) + 6899 Cypress PRO [Radeon HD 5800 Series] + 1043 0330 EAH5850 [Radeon HD5850] + 689b Cypress [Radeon HD 6800 Series] + 689c Hemlock [Radeon HD 5900 Series] + 689e Cypress LE [Radeon HD 5800 Series] 68a0 Broadway XT [Mobility Radeon HD 5800 Series] 103c 1520 Broadway XT [FirePro M7820] 68a1 Broadway PRO [Mobility Radeon HD 5800 Series] 68a8 Broadway [ATI Mobility Radeon HD 6800 Series] + 68a9 Juniper XT [FirePro 3D V5800] 68b8 Juniper [Radeon HD 5700 Series] - 68b9 Juniper [ATI Radeon HD 5600/5700] + 106b 00cf MacPro5,1 [Mac Pro 2.8GHz DDR3] + 68b9 Juniper [Radeon HD 5600/5700] 68ba Juniper XT [AMD Radeon HD 6000 Series] - 68be Juniper [Radeon HD 5750 Series] - 68bf Juniper LE [AMD Radeon HD 6700 Series] + 68be Juniper [Radeon HD 5700 Series] + 68bf Juniper LE [Radeon HD 6700 Series] 68c0 Madison [Mobility Radeon HD 5000 Series] 103c 1521 Madison XT [FirePro M5800] - 68c1 Madison [AMD Radeon HD 5000M Series] + 68c1 Madison [Radeon HD 5000M Series] + 1025 033d Mobility Radeon HD 5650 1025 0347 Aspire 7740G 103c 1521 Madison Pro [FirePro M5800] 68c7 Pinewood [Radeon HD 5570] @@ -1534,10 +1614,11 @@ 68e1 Manhattan [Mobility Radeon HD 5430 Series] 68e4 Robson CE [AMD Radeon HD 6300 Series] 68e5 Robson LE [AMD Radeon HD 6300M Series] - 68f1 Cadar [FirePro 2460] + 68f1 Cedar [FirePro 2460] 68f2 Cedar [FirePro 2270] - 68f9 Cedar PRO [Radeon HD 5450] + 68f9 Cedar PRO [Radeon HD 5450/6350] 1028 010e XPS 8300 + 68fa EG Cedar [Radeon HD 7300 Series] 700f PCI Bridge [IGP 320M] 7010 PCI Bridge [IGP 340M] 7100 R520 [Radeon X1800] @@ -1684,14 +1765,16 @@ 17f2 5000 KI690-AM2 Motherboard 791f RS690M [Radeon X1200 Series] 1179 ff50 Satellite P305D-S8995E - 7930 Radeon Xpress 7930 Host Bridge - 7932 RS7932 PCI Bridge - 7933 RS7933 PCI Bridge - 7936 RS7936 PCI Bridge - 793b RS600 audio device [Radeon Xpress 12xx Series] - 793f RS600 [Radeon Xpress 1200 Series] - 7941 RS600 [Radeon Xpress 1200 Series] - 7942 Radeon Xpress 1250 + 7930 RS600 Host Bridge + 7932 RS600 PCI to PCI Bridge (Internal gfx) + 7933 RS600 PCI to PCI Bridge (PCI Express Graphics Port 0) + 7935 RS600 PCI to PCI Bridge (PCI Express Port 1) + 7936 RS600 PCI to PCI Bridge (PCI Express Port 2) + 7937 RS690 PCI to PCI Bridge (PCI Express Port 3) + 793b RS600 HDMI Audio [Radeon Xpress 1250] + 793f RS600 [Radeon Xpress 1250] + 7941 RS600 [Radeon Xpress 1250] + 7942 RS600 [Radeon Xpress 1250] 796e Radeon 2100 7c37 RV350 AQ [Radeon 9600 SE] 9400 R600 [Radeon HD 2900 Series] @@ -1718,6 +1801,7 @@ 9480 M96 [Mobility Radeon HD 4650] 103c 3628 ATI Mobility Radeon HD 4650 [dv6-1190en] 9485 RV740 Pro [Radeon HD 4770] + 9488 RV730 XT [Mobility Radeon HD 4670] 9489 M96 XT [Mobility FireGL V5725] 9490 RV730XT [Radeon HD 4670] 174b e880 Radeon HD 4670 512MB DDR3 @@ -1746,10 +1830,10 @@ 94c9 Mobility Radeon HD 2400 1002 94c9 Radeon HD2400 94cb Radeon E2400 - 94cc RV 610LE PCI [Radeon HD 2400] - 9501 Radeon HD 3870 + 94cc RV610 LE [Radeon HD 2400 Pro PCI] + 9501 RV670 [Radeon HD 3870] 174b e620 Sapphire Radeon HD 3870 PCIe 2.0 - 9504 Mobility Radeon HD 3850 + 9504 RV670 [Mobility Radeon HD 3850] 9505 RV670PRO [Radeon HD 3850] 9507 RV670 [Radeon HD 3850] 9508 M88 XT Mobility Radeon HD 3870] @@ -1760,15 +1844,15 @@ 9540 RV710 [Radeon HD 4550] 954f RV710 [Radeon HD 4350] 1462 1618 R4350 MD512H (MS-V161) - 9552 M92 LP [Mobility Radeon HD 4300 Series] - 9553 M92 [Mobility Radeon HD 4500/5100 Series] + 9552 RV710 [Mobility Radeon HD 4300 Series] + 9553 RV710 [Mobility Radeon HD 4500/5100 Series] 1179 ff82 Satellite L505-13T GPU (Mobility Radeon HD 5145) - 9555 M93 [Mobility Radeon HD 4300/4500 Series] + 9555 RV710 [Mobility Radeon HD 4300/4500 Series] 103c 1411 ProBook 4720s GPU (Mobility Radeon HD 4350) - 9559 Mobility Radeon HD 3600 Series - 955f M92 [Mobility Radeon HD 4330] - 9581 M76 [Radeon Mobility HD 2600 Series] - 9583 M76XT [Mobility Radeon HD 2600 XT] + 9559 RV635 [Mobility Radeon HD 3600 Series] + 955f RV710 [Mobility Radeon HD 4330] + 9581 RV630 [Mobility Radeon HD 2600] + 9583 RV630 [Mobility Radeon HD 2600 XT] 9586 RV 630 XT AGP [Radeon HD 2600 XT AGP] 9587 RV630 PRO AGP [Radeon HD 2600 PRO AGP] 9588 RV630 [Radeon HD 2600XT] @@ -1776,20 +1860,21 @@ 9589 RV630 [Radeon HD 2600 Series] 958c RV630GL [FireGL v5600] 958d RV630 [FireGL V3600] - 9591 Mobility Radeon HD 3650 + 9591 RV635 [Mobility Radeon HD 3650] 1002 9591 Mobility Radeon HD 3650 - 9593 Radeon Mobility HD 3670 + 9593 RV635 [Mobility Radeon HD 3670] 9595 M86GL [Mobility FireGL V5700] 9596 RV635 PRO AGP [Radeon HD 3650] 1043 0028 EAH3650 SILENT/HTDI/512M/A - 9598 Mobility Radeon HD 3600 Series + 9598 RV630 [Radeon HD 3600 Series] 1002 9598 Mobility Radeon HD 3600 1043 01d6 EAH3650 Silent - 95c0 Mobility Radeon HD 3470 + 95c0 RV620 PRO [Radeon HD 3470] 1002 95c0 Mobility Radeon HD 3470 - 95c4 Mobility Radeon HD 3400 Series + 95c4 RV620 [Mobility Radeon HD 3400 Series] 1002 95c4 Mobility Radeon HD 3400 95c5 RV620 LE [Radeon HD 3450] + 1028 0342 OptiPlex 980 95c6 RV620 LE AGP [Radeon HD 3450] 95c7 RV620 CE [Radeon HD 3430] 95c9 RV620 PCI [Radeon HD 3450] @@ -1797,53 +1882,69 @@ 95cd RV620 [FireMV 2450] 95ce RV620 [FirePro 2260] 95cf RV620 [FirePro 2260] - 960f RS780 Azalia controller - 9610 Radeon HD 3200 Graphics + 960f RS780 HDMI Audio [Radeon HD 3000-3300 Series] + 9610 RS780 [Radeon HD 3200] 1458 d000 GA-MA78GM-S2H Motherboard - 9611 Radeon 3100 Graphics - 9612 RS780M/RS780MN [Radeon HD 3200 Graphics] - 9613 RS780MC [Radeon HD 3100 Graphics] - 9614 Radeon HD 3300 Graphics - 9615 RS780E [AMD 780E] - 9616 760G [Radeon 3000] - 970f RS880 Audio Device [Radeon HD 4200] + 9611 RS780C [Radeon HD 3100] + 9612 RS780M/RS780MN [Mobility Radeon HD 3200 Graphics] + 9613 RS780MC [Mobility Radeon HD 3100 Graphics] + 9614 RS780D [Radeon HD 3300] + 9615 RS780E [Radeon HD 3200] + 9616 RS780L [Radeon HD 3000] + 9640 BeaverCreek [Radeon HD 6550D] + 9641 BeaverCreek [Mobility Radeon HD 6620G] + 9647 BeaverCreek [Radeon HD 6520G] + 964a BeaverCreek [Radeon HD 6530D] + 970f RS880 HDMI Audio [Radeon HD 4200 Series] 1043 83a2 M4A785TD Motherboard 1043 843e M5A88-V EVO 9710 RS880 [Radeon HD 4200] 1043 83a2 M4A785TD Motherboard - 9712 M880G [Mobility Radeon HD 4200] - 9713 M860G [Mobility Radeon 4100] + 9712 RS880M [Mobility Radeon HD 4200 Series] + 9713 RS880M [Mobility Radeon HD 4100] 9714 RS880 [Radeon HD 4290] 9715 RS880 [Radeon HD 4250] 1043 843e M5A88-V EVO - 9723 Radeon HD 5450 - 9802 AMD Radeon HD 6310 GraphicsATI +# Radeon HD 6250 too? + 9802 Wrestler [Radeon HD 6310] + 174b 1001 Sapphire PURE Fusion Mini + 9804 Wrestler [Radeon HD 6250] + 9806 Wrestler [Radeon HD 6320] + 9807 Wrestler [Radeon HD 6290] +# AMD A10-5800K CPU + 9901 Trinity [Radeon HD 7660D] + 9990 Trinity [Radeon HD 7520G] aa00 R600 Audio Device [Radeon HD 2900 Series] - aa08 RV630/M76 audio device [Radeon HD 2600 Series] - aa10 RV610 audio device [Radeon HD 2400 PRO] + aa08 RV630 audio device [Radeon HD 2600 Series] + aa10 RV610 HDMI Audio [Radeon HD 2350/2400 Series] 174b aa10 Sapphire HD 2400 PRO audio device 18bc aa10 GeCube Radeon HD 2400 PRO HDCP-capable digital-only audio device - aa18 Radeon HD 3870 Audio device - aa20 RV635 Audio device [Radeon HD 3600 Series] - aa28 RV620 Audio device [Radeon HD 34xx Series] - aa30 HD48x0 audio + aa18 RV670/680 HDMI Audio [Radeon HD 3690/3800 Series] + aa20 RV635 HDMI Audio [Radeon HD 3600 Series] + aa28 RV620 HDMI Audio [Radeon HD 3400 Series] + aa30 RV770 HDMI Audio [Radeon HD 4850/4870] 174b aa30 Sapphire HD 4850 512MB GDDR3 PCI-E Dual Slot Fansink - aa38 RV710/730 + aa38 RV710/730 HDMI Audio [Radeon HD 4000 series] 103c 3628 ATI RV710/730 [dv6-1190en] 174b aa38 R700 Audio Device [Radeon HD 4000 Series] aa50 Cypress HDMI Audio [Radeon HD 5800 Series] aa58 Juniper HDMI Audio [Radeon HD 5700 Series] - aa60 Redwood HDMI Audio [Radeon HD 5600 Series] +# 5500, 5600 and mobile 5700 series + aa60 Redwood HDMI Audio [Radeon HD 5000 Series] + 1025 033d Mobility Radeon HD 5650 1025 0347 Aspire 7740G - aa68 Manhattan HDMI Audio [Mobility Radeon HD 5000 Series] + aa68 Cedar HDMI Audio [Radeon HD 5400/6300 Series] 1028 aa68 XPS 8300 + aa80 Cayman/Antilles HDMI Audio [Radeon HD 6900 Series] aa88 Barts HDMI Audio [Radeon HD 6800 Series] - aa98 NI Caicos HDMI Audio [AMD RADEON HD 6450] + aa90 Turks/Whistler HDMI Audio [Radeon HD 6000 Series] + aa98 Caicos HDMI Audio [Radeon HD 6400 Series] 174b aa98 Sapphire HD 6450 1GB DDR3 + aaa0 Tahiti XT HDMI Audio [Radeon HD 7970 Series] ac00 Theater 600 Pro ac02 TV Wonder HD 600 PCIe ac12 Theater HD T507 (DVB-T) TV tuner/capture device - cab0 AGP Bridge [IGP 320M] + cab0 RS100 AGP Bridge [IGP 320M] cab2 RS200/RS200M AGP Bridge [IGP 340M] cab3 R200 AGP Bridge [Mobility Radeon 7000 IGP] cbb2 RS200/RS200M AGP Bridge [IGP 340M] @@ -1876,8 +1977,11 @@ 1004 0306 QSound ThunderBird PCI Audio Support Registers 122d 1208 DSP368 Audio Support Registers 1483 5022 XWave Thunder 3D Audio Support Registers - 0307 Thunderbird - 0308 Thunderbird + 0307 SAA7785 ThunderBird PCI Audio + 1004 0703 Philips Rhythmic Edge PSC703 + 1004 0705 Philips Seismic Edge PSC705 + 1004 0706 Philips Acoustic Edge PSC706 + 0308 SAA7785 ThunderBird PCI Audio Gameport 0702 VAS96011 [Golden Gate II] 0703 Tollgate 1005 Avance Logic Inc. [ALI] @@ -2231,13 +2335,15 @@ 1014 0360 PCI-E Auxiliary Cache Adapter (57B7) 033d PCI-E IPR SAS Adapter (FPGA) 1014 033c PCIe2 1.8GB Cache 6Gb SAS RAID Adapter Tri-port (57B5) + 1014 0353 PCIe2 3.1GB Cache 6Gb SAS RAID Enclosure (57C3) + 1014 0354 PCIe2 6Gb SAS Adapter Dual-port (57C4) 1014 0356 PCIe2 1.8GB Cache 6Gb SAS RAID & SSD Adapter (574D) 1014 035f PCIe2 6Gb SAS Adapter Quad-port (57B2) 034a PCI-E IPR SAS Adapter (ASIC) 1014 033b PCIe2 6Gb SAS RAID Adapter Quad-port (57B4) 1014 0355 PCIe2 3.6GB Cache 6Gb SAS RAID Adapter Quad-port (57B1) 1014 0357 PCIe2 6Gb SAS Adapter Quad-port (57C6) - 1014 035d PCIe2 3.6GB Cache 6Gb SAS RAID & SSD Adapter (575D) + 1014 035d PCIe3 1.8GB Cache RAID SAS Adapter Quad-port 6GB (57C8) 1014 035e PCIe2 3.6GB Cache 6Gb SAS RAID Adapter Quad-port (57CE) 3022 QLA3022 Network Adapter 4022 QLA3022 Network Adapter @@ -2325,9 +2431,25 @@ 1302 Family 11h Processor DRAM Controller 1303 Family 11h Processor Miscellaneous Control 1304 Family 11h Processor Link Control + 1400 Family 15h (Models 10h-1fh) Processor Function 0 + 1401 Family 15h (Models 10h-1fh) Processor Function 1 + 1402 Family 15h (Models 10h-1fh) Processor Function 2 + 1403 Family 15h (Models 10h-1fh) Processor Function 3 + 1404 Family 15h (Models 10h-1fh) Processor Function 4 + 1405 Family 15h (Models 10h-1fh) Processor Function 5 + 1410 Family 15h (Models 10h-1fh) Processor Root Complex + 1412 Family 15h (Models 10h-1fh) Processor Root Port + 1413 Family 15h (Models 10h-1fh) Processor Root Port + 1414 Family 15h (Models 10h-1fh) Processor Root Port + 1415 Family 15h (Models 10h-1fh) Processor Root Port + 1416 Family 15h (Models 10h-1fh) Processor Root Port + 1417 Family 15h (Models 10h-1fh) Processor Root Port + 1418 Family 15h (Models 10h-1fh) Processor Root Port + 1419 Family 15h (Models 10h-1fh) I/O Memory Management Unit 1510 Family 14h Processor Root Complex - 1022 1510 Pavilion DM1Z-3000 Host bridge + 174b 1001 Sapphire PURE Fusion Mini 1512 Family 14h Processor Root Port + 174b 1001 Sapphire PURE Fusion Mini 1513 Family 14h Processor Root Port 1514 Family 14h Processor Root Port 1515 Family 14h Processor Root Port @@ -2396,6 +2518,10 @@ 2097 CS5536 [Geode companion] UOC 209a CS5536 [Geode companion] IDE 3000 ELanSC520 Microcontroller + 43a0 Hudson PCI to PCI bridge (PCIE port 0) + 43a1 Hudson PCI to PCI bridge (PCIE port 1) + 43a2 Hudson PCI to PCI bridge (PCIE port 2) + 43a3 Hudson PCI to PCI bridge (PCIE port 3) 7006 AMD-751 [Irongate] System Controller 7007 AMD-751 [Irongate] AGP Bridge 700a AMD-IGR4 AGP Host to PCI Bridge @@ -2422,7 +2548,7 @@ 7443 AMD-768 [Opus] ACPI 1043 8044 A7M-D Mainboard 7445 AMD-768 [Opus] Audio - 7446 AMD-768 [Opus] MC97 Modem (Smart Link HAMR5600 compatible) + 7446 AMD-768 [Opus] MC97 Modem 7448 AMD-768 [Opus] PCI 7449 AMD-768 [Opus] USB 7450 AMD-8131 PCI-X Bridge @@ -2472,8 +2598,8 @@ 1043 843e M5A88-V EVO 9602 RS780/RS880 PCI to PCI bridge (int gfx) 9603 RS780 PCI to PCI bridge (ext gfx port 0) - 9604 RS780 PCI to PCI bridge (PCIE port 0) - 9605 RS780 PCI to PCI bridge (PCIE port 1) + 9604 RS780/RS880 PCI to PCI bridge (PCIE port 0) + 9605 RS780/RS880 PCI to PCI bridge (PCIE port 1) 9606 RS780 PCI to PCI bridge (PCIE port 2) 9607 RS780 PCI to PCI bridge (PCIE port 3) 9608 RS780/RS880 PCI to PCI bridge (PCIE port 4) @@ -2595,6 +2721,8 @@ 5453 M5453 PCI AC-Link Controller Modem Device 7101 M7101 PCI PMU Power Management Controller 10b9 7101 M7101 PCI PMU Power Management Controller +# should be 1022:9602 + 9602 AMD RS780/RS880 PCI to PCI bridge (int gfx) 1028 Dell 0001 PowerEdge Expandable RAID Controller 2/Si 1028 0001 PowerEdge 2400 @@ -2649,7 +2777,7 @@ 00cf AIC-7899P U160/m 1028 0106 PowerEdge 4600 1028 0121 PowerEdge 2650 -102b Matrox Graphics, Inc. +102b Matrox Electronics Systems Ltd. # DJ: I've a suspicion that 0010 is a duplicate of 0d10. 0010 MGA-I [Impression?] 0100 MGA 1064SG [Mystique] @@ -2807,6 +2935,7 @@ 1028 028d PowerEdge T410 MGA G200eW WPCM450 1028 029c PowerEdge M710 MGA G200eW WPCM450 1028 02a4 PowerEdge T310 MGA G200eW WPCM450 + 15d9 a811 H8DGU 0533 MGA G200EH 103c 3381 iLO4 0534 G200eR2 @@ -2836,11 +2965,10 @@ 102b ff05 MGA-G100 Productiva AGP Multi-Monitor 110a 001e MGA-G100 AGP 2007 MGA Mistral - 2527 MGA G550 AGP + 2527 Millennium G550 102b 0f83 Millennium G550 102b 0f84 Millennium G550 Dual Head DDR 32Mb 102b 1e41 Millennium G550 -# Clearly the device name should not say AGP anymore... 102b 2300 Millennium G550 LP PCIE 2537 Millenium P650/P750 102b 1820 Millennium P750 64MB @@ -2890,10 +3018,46 @@ 102b 0101 Millenium P690 PCI 102b 0140 Millenium P690 LP PCIe x1 102b 0180 Display Wall IP Decode 128 MB + 4164 Morphis QxT frame grabber + 43b4 Morphis Qxt encoding engine + 4510 Morphis COM port 4536 VIA Framegrabber - 4cdc Morphis Vision System Jpeg2000 - 4fc5 Morphis Vision System - 5e10 Morphis Vision System Aux/IO + 4686 Concord GX (customized Intel 82541) + 475b Solios eCL/XCL-B frame grabber + 475d Vio frame grabber family + 102b 4b90 Vio Duo frame grabber (single channel) + 102b 4b91 Vio Duo frame grabber + 102b 4b92 Vio Analog frame grabber + 102b 4b93 Vio SDI Frame Grabber + 102b 4b94 Vio DVI-A frame grabber + 475f Solios (single-Full) CL frame grabber + 102b 475f Solios eCL/XCL-F frame grabber + 102b 4d5f Solios eV-CL (single-Full) frame grabber + 102b 4e5f Solios eM-CL (single-Full) frame grabber + 47a1 Solios eA/XA frame grabber + 102b 4be0 Solios eA/XA (single) frame grabber + 102b 4be1 Solios eA/XA (dual) frame grabber + 102b 4be2 Solios eA/XA (quad) frame grabber + 47a2 Solios COM port + 47c1 Solios (dual-Base/single-Medium) CL frame grabber + 102b 0000 Solios frame grabber + 102b 4b80 Solios eCL/XCL (single-Medium) frame grabber + 102b 4b81 Solios eCL/XCL (dual-Base) frame grabber + 102b 4d80 Solios eV-CL (single-Medium) frame grabber + 102b 4d81 Solios eV-CL (dual-Base) frame grabber + 102b 4e80 Solios eM-CL (single-Medium) frame grabber + 102b 4e81 Solios eM-CL (dual-Base) frame grabber + 47c2 Solios COM port + 4949 Radient frame grabber family + 102b 0010 Radient eCL (Single-full) frame grabber + 102b 0020 Radient eCL (Dual-base) frame grabber + 102b 0030 Radient eCL (Dual-full) frame grabber + 102b 0040 Radient eCL (Quad-base) frame grabber + 102b 0050 Radient eCL (Golden) frame grabber + 4cdc Morphis JPEG2000 accelerator + 4f54 Morphis (e)Quad frame grabber + 4fc5 Morphis (e)Dual frame grabber + 5e10 Morphis aux I/O 6573 Shark 10/100 Multiport SwitchNIC 102c Chips and Technologies 00b8 F64310 @@ -2982,7 +3146,7 @@ 003e NAPCCARD Cardbus Controller 0046 PowerVR PCX2 [midas] *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 12:18:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07FC6FF9; Fri, 2 Nov 2012 12:18:39 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E3AA88FC12; Fri, 2 Nov 2012 12:18:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2CIcB0018644; Fri, 2 Nov 2012 12:18:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2CIc9d018642; Fri, 2 Nov 2012 12:18:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201211021218.qA2CIc9d018642@svn.freebsd.org> From: Dimitry Andric Date: Fri, 2 Nov 2012 12:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242472 - head/lib/libc++ X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 12:18:39 -0000 Author: dim Date: Fri Nov 2 12:18:38 2012 New Revision: 242472 URL: http://svn.freebsd.org/changeset/base/242472 Log: Fix broken macro checking in the libc++ Makefile, introduced in r241909. This caused -std=c++0x not to be passed to the build by default. Pointy hat to: dim MFC after: 3 days Modified: head/lib/libc++/Makefile Modified: head/lib/libc++/Makefile ============================================================================== --- head/lib/libc++/Makefile Fri Nov 2 11:13:44 2012 (r242471) +++ head/lib/libc++/Makefile Fri Nov 2 12:18:38 2012 (r242472) @@ -53,7 +53,7 @@ cxxrt_${_S}: WARNS= 0 CFLAGS+= -I${HDRDIR} -I${LIBCXXRTDIR} -nostdlib -DLIBCXXRT -.if !defined(CXXFLAGS) || ${CXXFLAGS:M-std=*}" == "" +.if empty(CXXFLAGS:M-std=*) CXXFLAGS+= -std=c++0x .endif From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 13:51:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DBE0826D; Fri, 2 Nov 2012 13:51:47 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B91EA8FC0A; Fri, 2 Nov 2012 13:51:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2DplOH033109; Fri, 2 Nov 2012 13:51:47 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2DplYd033107; Fri, 2 Nov 2012 13:51:47 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211021351.qA2DplYd033107@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 2 Nov 2012 13:51:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242474 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 13:51:47 -0000 Author: glebius Date: Fri Nov 2 13:51:47 2012 New Revision: 242474 URL: http://svn.freebsd.org/changeset/base/242474 Log: Remove separate paragraph on ASCII messages and instead provide this information along with messages documentation, like this done in manual pages for other netgraph nodes. Submitted by: Mamontov Roman Modified: head/share/man/man4/ng_netflow.4 Modified: head/share/man/man4/ng_netflow.4 ============================================================================== --- head/share/man/man4/ng_netflow.4 Fri Nov 2 13:43:17 2012 (r242473) +++ head/share/man/man4/ng_netflow.4 Fri Nov 2 13:51:47 2012 (r242474) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 16, 2012 +.Dd Nov 2, 2012 .Dt NG_NETFLOW 4 .Os .Sh NAME @@ -100,15 +100,15 @@ node. .Sh CONTROL MESSAGES This node type supports the generic control messages, plus the following: .Bl -tag -width indent -.It Dv NGM_NETFLOW_INFO +.It Dv NGM_NETFLOW_INFO Pq Ic info Returns some node statistics and the current timeout values in a .Vt "struct ng_netflow_info" . -.It Dv NGM_NETFLOW_IFINFO +.It Dv NGM_NETFLOW_IFINFO Pq Ic ifinfo Returns information about the .Va iface Ns Ar N hook. The hook number is passed as an argument. -.It Dv NGM_NETFLOW_SETDLT +.It Dv NGM_NETFLOW_SETDLT Pq Ic setdlt Sets data link type on the .Va iface Ns Ar N hook. @@ -129,7 +129,7 @@ This message type uses as an argument: .Bd -literal -offset 4n struct ng_netflow_setdlt { - uint16_t iface; /* which iface to operate on */ + uint16_t iface; /* which iface dlt change */ uint8_t dlt; /* DLT_XXX from bpf.h */ }; .Ed @@ -138,7 +138,7 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise message send operation will return an error. -.It Dv NGM_NETFLOW_SETIFINDEX +.It Dv NGM_NETFLOW_SETIFINDEX Pq Ic setifindex In some cases, .Nm may be unable to determine the input interface index of a packet. @@ -158,7 +158,7 @@ This message requires as an argument: .Bd -literal -offset 4n struct ng_netflow_setifindex { - uint16_t iface; /* which iface to operate on */ + uint16_t iface; /* which iface index change */ uint16_t index; /* new index */ }; .Ed @@ -167,26 +167,26 @@ The requested .Va iface Ns Ar N hook must already be connected, otherwise the message send operation will return an error. -.It Dv NGM_NETFLOW_SETTIMEOUTS +.It Dv NGM_NETFLOW_SETTIMEOUTS Pq Ic settimeouts Sets values in seconds for NetFlow active/inactive timeouts. This message requires .Vt "struct ng_netflow_settimeouts" as an argument: .Bd -literal -offset 4n struct ng_netflow_settimeouts { - uint32_t inactive_timeout; - uint32_t active_timeout; + uint32_t inactive_timeout; /* flow inactive timeout */ + uint32_t active_timeout; /* flow active timeout */ }; .Ed -.It Dv NGM_NETFLOW_SETCONFIG +.It Dv NGM_NETFLOW_SETCONFIG Pq Ic setconfig Sets configuration for the specified interface. This message requires .Vt "struct ng_netflow_setconfig" as an argument: .Bd -literal -offset 4n struct ng_netflow_setconfig { - uint16_t iface; - uint32_t conf; + uint16_t iface; /* which iface config change */ + uint32_t conf; /* new config */ #define NG_NETFLOW_CONF_INGRESS 1 #define NG_NETFLOW_CONF_EGRESS 2 #define NG_NETFLOW_CONF_ONCE 4 @@ -221,29 +221,29 @@ skips radix lookup on destination (which mask and gateway). If one doesn't need data provided by lookups, he/she can disable them, to reduce load on routers. -.It Dv NGM_NETFLOW_SETTEMPLATE +.It Dv NGM_NETFLOW_SETTEMPLATE Pq Ic settemplate Sets various timeouts to announce data flow templates (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_settemplate" as an argument: .Bd -literal -offset 4n struct ng_netflow_settemplate { - uint16_t time; - uint16_t packets; + uint16_t time; /* max time between announce */ + uint16_t packets; /* max packets between announce */ }; .Ed .Pp Value of time field represents time in seconds to re-announce data templates. Value of packets field represents maximum packets count between re-announcing data templates. -.It Dv NGM_NETFLOW_SETMTU +.It Dv NGM_NETFLOW_SETMTU Pq Ic setmtu Sets export interface MTU to build packets of specified size (NetFlow v9-specific). This message requires .Vt "struct ng_netflow_setmtu" as an argument: .Bd -literal -offset 4n -struct ng_netflow_settemtu { - uint16_t mtu; +struct ng_netflow_setemtu { + uint16_t mtu; /* MTU for packet */ }; .Ed .Pp @@ -257,37 +257,15 @@ not directly from See also .Sx BUGS section. -.It Dv NGM_NETFLOW_V9INFO +.It Dv NGM_NETFLOW_V9INFO Pq Ic v9info Returns some NetFlow v9 related values in a -.Vt "struct ng_netflow_v9info" . -.El -.Sh ASCII CONTROL MESSAGES -Most binary control messages have an -.Tn ASCII -equivalent. -The supported -.Tn ASCII -commands are: -.Pp -.Bl -tag -width ".Dv NGM_NETFLOW_SETTIMEOUTS" -compact -.It Dv NGM_NETFLOW_INFO -.Qq Li info -.It Dv NGM_NETFLOW_IFINFO -.Qq Li "ifinfo %u" -.It Dv NGM_NETFLOW_SETDLT -.Qq Li "setdlt { iface = %u dlt = %u }" -.It Dv NGM_NETFLOW_SETIFINDEX -.Qq Li "setifindex { iface = %u index = %u }" -.It Dv NGM_NETFLOW_SETTIMEOUTS -.Qq Li "settimeouts { inactive = %u active = %u }" -.It Dv NGM_NETFLOW_SETCONFIG -.Qq Li "setconfig { iface = %u conf = %u }" -.It Dv NGM_NETFLOW_SETTEMPLATE -.Qq Li "settemplate { time = %u packets = %u }" -.It Dv NGM_NETFLOW_SETMTU -.Qq Li "setmtu { mtu = %u }" -.It Dv NGM_NETFLOW_V9INFO -.Qq Li v9info +.Bd -literal -offset 4n +struct ng_netflow_v9info { + uint16_t templ_packets; /* v9 template packets */ + uint16_t templ_time; /* v9 template time */ + uint16_t mtu; /* v9 MTU */ +}; +.Ed .El .Sh SHUTDOWN This node shuts down upon receipt of a From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 13:54:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7B7163E9; Fri, 2 Nov 2012 13:54:07 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57D108FC15; Fri, 2 Nov 2012 13:54:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2Ds7xa033475; Fri, 2 Nov 2012 13:54:07 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2Ds70r033473; Fri, 2 Nov 2012 13:54:07 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201211021354.qA2Ds70r033473@svn.freebsd.org> From: Gleb Smirnoff Date: Fri, 2 Nov 2012 13:54:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242475 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 13:54:07 -0000 Author: glebius Date: Fri Nov 2 13:54:06 2012 New Revision: 242475 URL: http://svn.freebsd.org/changeset/base/242475 Log: - Fix struct and struct fields names. - Remove NGM_ATM_CARRIER_CHANGE, which was removed in r118175. Submitted by: Mamontov Roman Modified: head/share/man/man4/ng_atm.4 Modified: head/share/man/man4/ng_atm.4 ============================================================================== --- head/share/man/man4/ng_atm.4 Fri Nov 2 13:51:47 2012 (r242474) +++ head/share/man/man4/ng_atm.4 Fri Nov 2 13:54:06 2012 (r242475) @@ -30,7 +30,7 @@ .\" .\" ng_atm(4) man page .\" -.Dd June 24, 2003 +.Dd November 2, 2012 .Dt NG_ATM 4 .Os .Sh NAME @@ -151,23 +151,23 @@ headers. .Sh CONTROL MESSAGES This node type supports the generic messages plus the following: .Bl -tag -width 4n -.It Dv NGM_ATM_GET_IFNAME +.It Dv NGM_ATM_GET_IFNAME Pq Ic getifname Return the name of the interface as a .Dv NUL Ns -terminated string. This is normally the same name as that of the node. -.It Dv NGM_ATM_GET_CONFIG +.It Dv NGM_ATM_GET_CONFIG Pq Ic getconfig Returns a structure defining the configuration of the interface: .Bd -literal -struct ng_atm_config { +struct ngm_atm_config { uint32_t pcr; /* peak cell rate */ - uint32_t maxvpi; /* maximum vpi */ - uint32_t maxvci; /* maximum vci */ + uint32_t vpi_bits; /* number of active VPI bits */ + uint32_t vci_bits; /* number of active VCI bits */ uint32_t max_vpcs; /* maximum number of VPCs */ uint32_t max_vccs; /* maximum number of VCCs */ }; .Ed -.It Dv NGM_ATM_GET_VCCS +.It Dv NGM_ATM_GET_VCCS Pq Ic getvccs Returns the table of open VCCs from the driver. This table consists of a header and a variable sized array of entries, one for each open VCC: @@ -190,7 +190,7 @@ struct atmio_tparam { uint32_t pcr; /* 24bit: Peak Cell Rate */ uint32_t scr; /* 24bit: VBR Sustainable Cell Rate */ uint32_t mbs; /* 24bit: VBR Maximum burst size */ - uint32_t mcr; /* 24bit: MCR */ + uint32_t mcr; /* 24bit: ABR/VBR/UBR+MCR MCR */ uint32_t icr; /* 24bit: ABR ICR */ uint32_t tbe; /* 24bit: ABR TBE (1...2^24-1) */ uint8_t nrm; /* 3bit: ABR Nrm */ @@ -264,23 +264,23 @@ all traffic types however): .It Dv ATMIO_TRAFFIC_ABR .It Dv ATMIO_TRAFFIC_VBR .El -.It Dv NGM_ATM_CPCS_INIT +.It Dv NGM_ATM_CPCS_INIT Pq Ic cpcsinit Initialize a VCC for sending and receiving. The argument is a structure: .Bd -literal -struct ng_atm_cpcs_init { +struct ngm_atm_cpcs_init { char name[NG_HOOKSIZ]; - uint32_t flags; /* flags. (if_natmio.h) */ + uint32_t flags; /* flags. (if_atm.h) */ uint16_t vci; /* VCI to open */ uint16_t vpi; /* VPI to open */ uint16_t rmtu; /* receive maximum PDU */ uint16_t tmtu; /* transmit maximum PDU */ - uint8_t aal; /* AAL type (if_natmio.h) */ - uint8_t traffic; /* traffic type (if_natmio.h) */ + uint8_t aal; /* AAL type (if_atm.h) */ + uint8_t traffic; /* traffic type (if_atm.h) */ uint32_t pcr; /* Peak cell rate */ - uint32_t scr; /* Sustainable cell rate */ - uint32_t mbs; /* Maximum burst size */ - uint32_t mcr; /* Minimum cell rate */ + uint32_t scr; /* VBR: Sustainable cell rate */ + uint32_t mbs; /* VBR: Maximum burst rate */ + uint32_t mcr; /* UBR+: Minimum cell rate */ uint32_t icr; /* ABR: Initial cell rate */ uint32_t tbe; /* ABR: Transmit buffer exposure */ uint8_t nrm; /* ABR: Nrm */ @@ -316,14 +316,25 @@ The field contains the flags (see above) and the other fields describe the type of traffic. -.It Dv NGM_ATM_CPCS_TERM +.It Dv NGM_ATM_CPCS_TERM Pq Ic cpcsterm Stop sending and receiving on the indicated hook. The argument is a .Bd -literal -struct ng_atm_cpcs_term { +struct ngm_atm_cpcs_term { char name[NG_HOOKSIZ]; }; .Ed +.It Dv NGM_ATM_GET_STATS Pq Ic getstats +This command returns a message, containing node statistics. The +structure of the message is: +.Bd -literal +struct ngm_atm_stats { + uint64_t in_packets; + uint64_t in_errors; + uint64_t out_packets; + uint64_t out_errors; +}; +.Ed .El .Sh MANAGEMENT MESSAGES If the @@ -333,35 +344,14 @@ They are received by the peer node with a cookie of .Dv NG_ATM_COOKIE . .Bl -tag -width 4n -.It Dv NGM_ATM_CARRIER_CHANGE -The carrier state of the ATM physical interface has changed. -The message has the following structure: -.Bd -literal -struct ng_atm_carrier_change { - uint32_t node; - uint32_t state; -}; -.Ed -.Pp -The -.Va node -field -is the node ID of the ATM node. -This can be used by the managing entity -(for example -.Xr ilmid 8 ) -to manage several interfaces at the same time through the same node. -The -.Va state -field is 1 if the carrier was detected, and 0 if it was lost. -.It Dv NGM_ATM_VCC_CHANGE +.It Dv NGM_ATM_VCC_CHANGE Pq Ic vcc_change A permanent VCC has been added, deleted or changed. This is used by .Xr ilmid 8 to generate the appropriate ILMI traps. The structure of the message is: .Bd -literal -struct ng_atm_vcc_change { +struct ngm_atm_vcc_change { uint32_t node; uint16_t vci; uint8_t vpi; From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 13:56:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id DE8A0664; Fri, 2 Nov 2012 13:56:36 +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 C3D9B8FC17; Fri, 2 Nov 2012 13:56:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2Dua7d033947; Fri, 2 Nov 2012 13:56:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2DuaiO033936; Fri, 2 Nov 2012 13:56:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201211021356.qA2DuaiO033936@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 2 Nov 2012 13:56:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242476 - in head/sys: compat/linux fs/nullfs fs/unionfs i386/ibcs2 kern ufs/ufs vm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 13:56:37 -0000 Author: kib Date: Fri Nov 2 13:56:36 2012 New Revision: 242476 URL: http://svn.freebsd.org/changeset/base/242476 Log: The r241025 fixed the case when a binary, executed from nullfs mount, was still possible to open for write from the lower filesystem. There is a symmetric situation where the binary could already has file descriptors opened for write, but it can be executed from the nullfs overlay. Handle the issue by passing one v_writecount reference to the lower vnode if nullfs vnode has non-zero v_writecount. Note that only one write reference can be donated, since nullfs only keeps one use reference on the lower vnode. Always use the lower vnode v_writecount for the checks. Introduce the VOP_GET_WRITECOUNT to read v_writecount, which is currently always bypassed to the lower vnode, and VOP_ADD_WRITECOUNT to manipulate the v_writecount value, which manages a single bypass reference to the lower vnode. Caling the VOPs instead of directly accessing v_writecount provide the fix described in the previous paragraph. Tested by: pho MFC after: 3 weeks Modified: head/sys/compat/linux/linux_misc.c head/sys/fs/nullfs/null_vnops.c head/sys/fs/unionfs/union_subr.c head/sys/i386/ibcs2/imgact_coff.c head/sys/kern/kern_exec.c head/sys/kern/vfs_default.c head/sys/kern/vfs_vnops.c head/sys/kern/vnode_if.src head/sys/ufs/ufs/ufs_extattr.c head/sys/vm/vnode_pager.c Modified: head/sys/compat/linux/linux_misc.c ============================================================================== --- head/sys/compat/linux/linux_misc.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/compat/linux/linux_misc.c Fri Nov 2 13:56:36 2012 (r242476) @@ -246,8 +246,7 @@ linux_uselib(struct thread *td, struct l unsigned long bss_size; char *library; ssize_t aresid; - int error; - int locked; + int error, locked, writecount; LCONVPATHEXIST(td, args->library, &library); @@ -277,7 +276,10 @@ linux_uselib(struct thread *td, struct l locked = 1; /* Writable? */ - if (vp->v_writecount) { + error = VOP_GET_WRITECOUNT(vp, &writecount); + if (error != 0) + goto cleanup; + if (writecount != 0) { error = ETXTBSY; goto cleanup; } Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/fs/nullfs/null_vnops.c Fri Nov 2 13:56:36 2012 (r242476) @@ -329,6 +329,26 @@ null_bypass(struct vop_generic_args *ap) return (error); } +static int +null_add_writecount(struct vop_add_writecount_args *ap) +{ + struct vnode *lvp, *vp; + int error; + + vp = ap->a_vp; + lvp = NULLVPTOLOWERVP(vp); + KASSERT(vp->v_writecount + ap->a_inc >= 0, ("wrong writecount inc")); + if (vp->v_writecount > 0 && vp->v_writecount + ap->a_inc == 0) + error = VOP_ADD_WRITECOUNT(lvp, -1); + else if (vp->v_writecount == 0 && vp->v_writecount + ap->a_inc > 0) + error = VOP_ADD_WRITECOUNT(lvp, 1); + else + error = 0; + if (error == 0) + vp->v_writecount += ap->a_inc; + return (error); +} + /* * We have to carry on the locking protocol on the null layer vnodes * as we progress through the tree. We also have to enforce read-only @@ -826,4 +846,5 @@ struct vop_vector null_vnodeops = { .vop_unlock = null_unlock, .vop_vptocnp = null_vptocnp, .vop_vptofh = null_vptofh, + .vop_add_writecount = null_add_writecount, }; Modified: head/sys/fs/unionfs/union_subr.c ============================================================================== --- head/sys/fs/unionfs/union_subr.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/fs/unionfs/union_subr.c Fri Nov 2 13:56:36 2012 (r242476) @@ -945,7 +945,7 @@ unionfs_vn_create_on_upper(struct vnode vput(vp); goto unionfs_vn_create_on_upper_free_out1; } - vp->v_writecount++; + VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); *vpp = vp; @@ -1082,7 +1082,7 @@ unionfs_copyfile(struct unionfs_node *un } } VOP_CLOSE(uvp, FWRITE, cred, td); - uvp->v_writecount--; + VOP_ADD_WRITECOUNT(uvp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, uvp, uvp->v_writecount); Modified: head/sys/i386/ibcs2/imgact_coff.c ============================================================================== --- head/sys/i386/ibcs2/imgact_coff.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/i386/ibcs2/imgact_coff.c Fri Nov 2 13:56:36 2012 (r242476) @@ -168,7 +168,7 @@ coff_load_file(struct thread *td, char * unsigned long text_offset = 0, text_address = 0, text_size = 0; unsigned long data_offset = 0, data_address = 0, data_size = 0; unsigned long bss_size = 0; - int i; + int i, writecount; NDINIT(&nd, LOOKUP, ISOPEN | LOCKLEAF | FOLLOW | SAVENAME, UIO_SYSSPACE, name, td); @@ -181,7 +181,10 @@ coff_load_file(struct thread *td, char * if (vp == NULL) return ENOEXEC; - if (vp->v_writecount) { + error = VOP_GET_WRITECOUNT(vp, &writecount); + if (error != 0) + goto fail; + if (writecount != 0) { error = ETXTBSY; goto fail; } Modified: head/sys/kern/kern_exec.c ============================================================================== --- head/sys/kern/kern_exec.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/kern/kern_exec.c Fri Nov 2 13:56:36 2012 (r242476) @@ -1376,7 +1376,7 @@ exec_check_permissions(imgp) struct vnode *vp = imgp->vp; struct vattr *attr = imgp->attr; struct thread *td; - int error; + int error, writecount; td = curthread; @@ -1421,7 +1421,10 @@ exec_check_permissions(imgp) * Check number of open-for-writes on the file and deny execution * if there are any. */ - if (vp->v_writecount) + error = VOP_GET_WRITECOUNT(vp, &writecount); + if (error != 0) + return (error); + if (writecount != 0) return (ETXTBSY); /* Modified: head/sys/kern/vfs_default.c ============================================================================== --- head/sys/kern/vfs_default.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/kern/vfs_default.c Fri Nov 2 13:56:36 2012 (r242476) @@ -81,6 +81,8 @@ static int dirent_exists(struct vnode *v static int vop_stdis_text(struct vop_is_text_args *ap); static int vop_stdset_text(struct vop_set_text_args *ap); static int vop_stdunset_text(struct vop_unset_text_args *ap); +static int vop_stdget_writecount(struct vop_get_writecount_args *ap); +static int vop_stdadd_writecount(struct vop_add_writecount_args *ap); /* * This vnode table stores what we want to do if the filesystem doesn't @@ -133,6 +135,8 @@ struct vop_vector default_vnodeops = { .vop_is_text = vop_stdis_text, .vop_set_text = vop_stdset_text, .vop_unset_text = vop_stdunset_text, + .vop_get_writecount = vop_stdget_writecount, + .vop_add_writecount = vop_stdadd_writecount, }; /* @@ -1100,6 +1104,22 @@ vop_stdunset_text(struct vop_unset_text_ return (0); } +static int +vop_stdget_writecount(struct vop_get_writecount_args *ap) +{ + + *ap->a_writecount = ap->a_vp->v_writecount; + return (0); +} + +static int +vop_stdadd_writecount(struct vop_add_writecount_args *ap) +{ + + ap->a_vp->v_writecount += ap->a_inc; + return (0); +} + /* * vfs default ops * used to fill the vfs function table to get reasonable default return values. Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/kern/vfs_vnops.c Fri Nov 2 13:56:36 2012 (r242476) @@ -302,7 +302,7 @@ vn_open_vnode(struct vnode *vp, int fmod fp->f_flag |= FHASLOCK; } if (fmode & FWRITE) { - vp->v_writecount++; + VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); } @@ -355,7 +355,7 @@ vn_close(vp, flags, file_cred, td) if (flags & FWRITE) { VNASSERT(vp->v_writecount > 0, vp, ("vn_close: negative writecount")); - vp->v_writecount--; + VOP_ADD_WRITECOUNT(vp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, vp, vp->v_writecount); } Modified: head/sys/kern/vnode_if.src ============================================================================== --- head/sys/kern/vnode_if.src Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/kern/vnode_if.src Fri Nov 2 13:56:36 2012 (r242476) @@ -678,6 +678,20 @@ vop_unset_text { IN struct vnode *vp; }; +%% get_writecount vp L L L + +vop_get_writecount { + IN struct vnode *vp; + OUT int *writecount; +}; + +%% add_writecount vp E E E + +vop_add_writecount { + IN struct vnode *vp; + IN int inc; +}; + # The VOPs below are spares at the end of the table to allow new VOPs to be # added in stable branches without breaking the KBI. New VOPs in HEAD should # be added above these spares. When merging a new VOP to a stable branch, Modified: head/sys/ufs/ufs/ufs_extattr.c ============================================================================== --- head/sys/ufs/ufs/ufs_extattr.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/ufs/ufs/ufs_extattr.c Fri Nov 2 13:56:36 2012 (r242476) @@ -334,7 +334,7 @@ ufs_extattr_enable_with_open(struct ufsm return (error); } - vp->v_writecount++; + VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); Modified: head/sys/vm/vnode_pager.c ============================================================================== --- head/sys/vm/vnode_pager.c Fri Nov 2 13:54:06 2012 (r242475) +++ head/sys/vm/vnode_pager.c Fri Nov 2 13:56:36 2012 (r242476) @@ -272,7 +272,7 @@ vnode_pager_dealloc(object) ASSERT_VOP_ELOCKED(vp, "vnode_pager_dealloc"); if (object->un_pager.vnp.writemappings > 0) { object->un_pager.vnp.writemappings = 0; - vp->v_writecount--; + VOP_ADD_WRITECOUNT(vp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, vp, vp->v_writecount); } @@ -1212,12 +1212,12 @@ vnode_pager_update_writecount(vm_object_ vp = object->handle; if (old_wm == 0 && object->un_pager.vnp.writemappings != 0) { ASSERT_VOP_ELOCKED(vp, "v_writecount inc"); - vp->v_writecount++; + VOP_ADD_WRITECOUNT(vp, 1); CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp, vp->v_writecount); } else if (old_wm != 0 && object->un_pager.vnp.writemappings == 0) { ASSERT_VOP_ELOCKED(vp, "v_writecount dec"); - vp->v_writecount--; + VOP_ADD_WRITECOUNT(vp, -1); CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, vp, vp->v_writecount); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 14:37:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4270D4D; Fri, 2 Nov 2012 14:37:21 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA6B48FC08; Fri, 2 Nov 2012 14:37:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2EbLfX040740; Fri, 2 Nov 2012 14:37:21 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2EbL6m040738; Fri, 2 Nov 2012 14:37:21 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201211021437.qA2EbL6m040738@svn.freebsd.org> From: Matt Jacob Date: Fri, 2 Nov 2012 14:37:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242479 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 14:37:21 -0000 Author: mjacob Date: Fri Nov 2 14:37:21 2012 New Revision: 242479 URL: http://svn.freebsd.org/changeset/base/242479 Log: Don't allow for more than one segment for the control space since we're not set up to deal with that. MFC after: 1 week Modified: head/sys/dev/isp/isp_pci.c Modified: head/sys/dev/isp/isp_pci.c ============================================================================== --- head/sys/dev/isp/isp_pci.c Fri Nov 2 14:18:30 2012 (r242478) +++ head/sys/dev/isp/isp_pci.c Fri Nov 2 14:37:21 2012 (r242479) @@ -1524,7 +1524,7 @@ isp_pci_mbxdma(ispsoftc_t *isp) { caddr_t base; uint32_t len, nsegs; - int i, error, ns, cmap = 0; + int i, error, cmap = 0; bus_size_t slim; /* segment size */ bus_addr_t llim; /* low limit of unavailable dma */ bus_addr_t hlim; /* high limit of unavailable dma */ @@ -1633,13 +1633,12 @@ isp_pci_mbxdma(ispsoftc_t *isp) if (isp->isp_type >= ISP_HA_FC_2300) { len += (N_XCMDS * XCMD_SIZE); } - ns = (len / PAGE_SIZE) + 1; /* * Create a tag for the control spaces. We don't always need this * to be 32 bits, but we do this for simplicity and speed's sake. */ - if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, ns, slim, 0, &isp->isp_osinfo.cdmat)) { + if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, slim, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, len, 1, slim, 0, &isp->isp_osinfo.cdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); free(isp->isp_osinfo.pcmd_pool, M_DEVBUF); free(isp->isp_xflist, M_DEVBUF); From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 14:38:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85760ED1; Fri, 2 Nov 2012 14:38:58 +0000 (UTC) (envelope-from mjacob@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6D8CD8FC16; Fri, 2 Nov 2012 14:38:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2EcwRf041010; Fri, 2 Nov 2012 14:38:58 GMT (envelope-from mjacob@svn.freebsd.org) Received: (from mjacob@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2Ecw51041008; Fri, 2 Nov 2012 14:38:58 GMT (envelope-from mjacob@svn.freebsd.org) Message-Id: <201211021438.qA2Ecw51041008@svn.freebsd.org> From: Matt Jacob Date: Fri, 2 Nov 2012 14:38:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242480 - head/sys/dev/isp X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 14:38:58 -0000 Author: mjacob Date: Fri Nov 2 14:38:57 2012 New Revision: 242480 URL: http://svn.freebsd.org/changeset/base/242480 Log: Don't allow for more than one segment for the control space since we're not set up to deal with that. X-MFC: 242479 MFC after: 1 week Modified: head/sys/dev/isp/isp_sbus.c Modified: head/sys/dev/isp/isp_sbus.c ============================================================================== --- head/sys/dev/isp/isp_sbus.c Fri Nov 2 14:37:21 2012 (r242479) +++ head/sys/dev/isp/isp_sbus.c Fri Nov 2 14:38:57 2012 (r242480) @@ -460,7 +460,7 @@ isp_sbus_mbxdma(ispsoftc_t *isp) { caddr_t base; uint32_t len; - int i, error, ns; + int i, error; struct imush im; /* @@ -511,10 +511,9 @@ isp_sbus_mbxdma(ispsoftc_t *isp) len = ISP_QUEUE_SIZE(RQUEST_QUEUE_LEN(isp)); len += ISP_QUEUE_SIZE(RESULT_QUEUE_LEN(isp)); - ns = (len / PAGE_SIZE) + 1; if (isp_dma_tag_create(isp->isp_osinfo.dmat, QENTRY_LEN, BUS_SPACE_MAXADDR_24BIT+1, BUS_SPACE_MAXADDR_32BIT, - BUS_SPACE_MAXADDR_32BIT, NULL, NULL, len, ns, + BUS_SPACE_MAXADDR_32BIT, NULL, NULL, len, 1, BUS_SPACE_MAXADDR_24BIT, 0, &isp->isp_osinfo.cdmat)) { isp_prt(isp, ISP_LOGERR, "cannot create a dma tag for control spaces"); From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 15:06:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C13617CF; Fri, 2 Nov 2012 15:06:01 +0000 (UTC) (envelope-from antoine@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A81A18FC08; Fri, 2 Nov 2012 15:06:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2F61rN045133; Fri, 2 Nov 2012 15:06:01 GMT (envelope-from antoine@svn.freebsd.org) Received: (from antoine@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2F61QR045131; Fri, 2 Nov 2012 15:06:01 GMT (envelope-from antoine@svn.freebsd.org) Message-Id: <201211021506.qA2F61QR045131@svn.freebsd.org> From: Antoine Brodin Date: Fri, 2 Nov 2012 15:06:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242481 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 15:06:01 -0000 Author: antoine Date: Fri Nov 2 15:06:01 2012 New Revision: 242481 URL: http://svn.freebsd.org/changeset/base/242481 Log: Add more obsolete files. Modified: head/ObsoleteFiles.inc Modified: head/ObsoleteFiles.inc ============================================================================== --- head/ObsoleteFiles.inc Fri Nov 2 14:38:57 2012 (r242480) +++ head/ObsoleteFiles.inc Fri Nov 2 15:06:01 2012 (r242481) @@ -43,6 +43,9 @@ OLD_FILES+=usr/share/man/man9/VFS_LOCK_G OLD_FILES+=usr/share/man/man9/VFS_UNLOCK_GIANT.9.gz # 20121004: remove incomplete unwind.h OLD_FILES+=usr/include/clang/3.2/unwind.h +# 20120910: NetBSD compat shims removed +OLD_FILES+=usr/include/cam/scsi/scsi_low_pisa.h +OLD_FILES+=usr/include/sys/device_port.h # 20120908: pf cleanup OLD_FILES+=usr/include/net/if_pflow.h # 20120816: new clang import which bumps version from 3.1 to 3.2 @@ -91,13 +94,19 @@ OLD_FILES+=usr/include/openssl/ui_locl.h OLD_FILES+=usr/share/openssl/man/man3/CRYPTO_set_id_callback.3.gz # 20120621: remove old man page OLD_FILES+=usr/share/man/man8/vnconfig.8.gz +# 20120619: TOE support updated +OLD_FILES+=usr/include/netinet/toedev.h # 20120613: auth.conf removed OLD_FILES+=etc/auth.conf OLD_FILES+=usr/share/examples/etc/auth.conf OLD_FILES+=usr/share/man/man3/auth.3.gz +OLD_FILES+=usr/share/man/man3/auth_getval.3.gz OLD_FILES+=usr/share/man/man5/auth.conf.5.gz # 20120530: kde pam lives now in ports OLD_FILES+=etc/pam.d/kde +# 20120521: byacc import +OLD_FILES+=usr/bin/yyfix +OLD_FILES+=usr/share/man/man1/yyfix.1.gz # 20120505: new clang import installed a redundant internal header OLD_FILES+=usr/include/clang/3.1/stdalign.h # 20120428: MD2 removed from libmd From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 15:09:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C3B3A9D0; Fri, 2 Nov 2012 15:09:34 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 8EAC18FC14; Fri, 2 Nov 2012 15:09:34 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA2F9Xwx089192; Fri, 2 Nov 2012 09:09:33 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA2F9VJN008991; Fri, 2 Nov 2012 09:09:31 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242466 - head/sys/mips/mips From: Ian Lepore To: Adrian Chadd In-Reply-To: <201211020523.qA25N5No052084@svn.freebsd.org> References: <201211020523.qA25N5No052084@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Fri, 02 Nov 2012 09:09:30 -0600 Message-ID: <1351868970.1120.25.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 15:09:34 -0000 On Fri, 2012-11-02 at 05:23 +0000, Adrian Chadd wrote: > Author: adrian > Date: Fri Nov 2 05:23:05 2012 > New Revision: 242466 > URL: http://svn.freebsd.org/changeset/base/242466 > > Log: > Drop this from 500 to 128, to save a little space on memory constrained > platforms. > > Modified: > head/sys/mips/mips/busdma_machdep.c > > Modified: head/sys/mips/mips/busdma_machdep.c > ============================================================================== > --- head/sys/mips/mips/busdma_machdep.c Fri Nov 2 05:22:32 2012 (r242465) > +++ head/sys/mips/mips/busdma_machdep.c Fri Nov 2 05:23:05 2012 (r242466) > @@ -153,7 +153,7 @@ static STAILQ_HEAD(, bus_dmamap) bounce_ > static TAILQ_HEAD(,bus_dmamap) dmamap_freelist = > TAILQ_HEAD_INITIALIZER(dmamap_freelist); > > -#define BUSDMA_STATIC_MAPS 500 > +#define BUSDMA_STATIC_MAPS 128 > static struct bus_dmamap map_pool[BUSDMA_STATIC_MAPS]; > > static struct mtx busdma_mtx; Of course, it doesn't save anything if the system is using more than 128 maps, did you check? When I checked on an arm dreamplug system, there were roughly 1850 maps allocated by time it got to the login prompt (making that local cache of 500 maps completely useless). The patches I posted in arch@ a while back addressed this problem by setting up an uma(9) pool for maps (and pools for busdma buffers). The patches were designed to be easy to incorporate for both arm and mips busdma implementations. -- Ian From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 16:07:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1E862C7A; Fri, 2 Nov 2012 16:07:22 +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 075A98FC12; Fri, 2 Nov 2012 16:07:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2G7LQG054903; Fri, 2 Nov 2012 16:07:21 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2G7L0Y054901; Fri, 2 Nov 2012 16:07:21 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211021607.qA2G7L0Y054901@svn.freebsd.org> From: Jilles Tjoelker Date: Fri, 2 Nov 2012 16:07:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242482 - head/usr.bin/kdump X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 16:07:22 -0000 Author: jilles Date: Fri Nov 2 16:07:21 2012 New Revision: 242482 URL: http://svn.freebsd.org/changeset/base/242482 Log: kdump: Also decode fcntl commands containing underscores and digits. The commands F_SETLK_REMOTE, F_DUPFD_CLOEXEC and F_DUP2FD_CLOEXEC were not decoded. Modified: head/usr.bin/kdump/mksubr Modified: head/usr.bin/kdump/mksubr ============================================================================== --- head/usr.bin/kdump/mksubr Fri Nov 2 15:06:01 2012 (r242481) +++ head/usr.bin/kdump/mksubr Fri Nov 2 16:07:21 2012 (r242482) @@ -416,7 +416,7 @@ fcntlcmdname(int cmd, int arg, int decim { switch (cmd) { _EOF_ -egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z]+[[:space:]]+[0-9]+[[:space:]]*" \ +egrep "^#[[:space:]]*define[[:space:]]+F_[A-Z0-9_]+[[:space:]]+[0-9]+[[:space:]]*" \ $include_dir/sys/fcntl.h | \ awk 'BEGIN { o=0 } { for (i = 1; i <= NF; i++) \ if ($i ~ /define/) \ From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 16:31:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 11C61601; Fri, 2 Nov 2012 16:31:02 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED9448FC17; Fri, 2 Nov 2012 16:31:01 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2GV14U059043; Fri, 2 Nov 2012 16:31:01 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2GV1Fr059041; Fri, 2 Nov 2012 16:31:01 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211021631.qA2GV1Fr059041@svn.freebsd.org> From: Attilio Rao Date: Fri, 2 Nov 2012 16:31:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242483 - head/sys/sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 16:31:02 -0000 Author: attilio Date: Fri Nov 2 16:31:01 2012 New Revision: 242483 URL: http://svn.freebsd.org/changeset/base/242483 Log: Tweak comment to make more clear why it will fail. Submitted by: jimharris Modified: head/sys/sys/mutex.h Modified: head/sys/sys/mutex.h ============================================================================== --- head/sys/sys/mutex.h Fri Nov 2 16:07:21 2012 (r242482) +++ head/sys/sys/mutex.h Fri Nov 2 16:31:01 2012 (r242483) @@ -129,7 +129,7 @@ void thread_lock_flags_(struct thread *, /* * Top-level macros to provide lock cookie once the actual mtx is passed. * They will also prevent passing a malformed object to the mtx KPI by - * failing compilation. + * failing compilation as the mtx_lock reserved member will not be found. */ #define mtx_init(m, n, t, o) \ _mtx_init(&(m)->mtx_lock, n, t, o) From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 17:30:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 25B35F89; Fri, 2 Nov 2012 17:30:09 +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 0D1D88FC0C; Fri, 2 Nov 2012 17:30:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2HU80b068937; Fri, 2 Nov 2012 17:30:08 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2HU8Bg068934; Fri, 2 Nov 2012 17:30:08 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211021730.qA2HU8Bg068934@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 2 Nov 2012 17:30:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242486 - head/sbin/dumpon X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 17:30:09 -0000 Author: alfred Date: Fri Nov 2 17:30:08 2012 New Revision: 242486 URL: http://svn.freebsd.org/changeset/base/242486 Log: Document that you can use -v along with -l. Noticed by: pjd Modified: head/sbin/dumpon/dumpon.8 head/sbin/dumpon/dumpon.c Modified: head/sbin/dumpon/dumpon.8 ============================================================================== --- head/sbin/dumpon/dumpon.8 Fri Nov 2 16:57:51 2012 (r242485) +++ head/sbin/dumpon/dumpon.8 Fri Nov 2 17:30:08 2012 (r242486) @@ -42,6 +42,7 @@ .Op Fl v .Cm off .Nm +.Op Fl v .Fl l .Sh DESCRIPTION The Modified: head/sbin/dumpon/dumpon.c ============================================================================== --- head/sbin/dumpon/dumpon.c Fri Nov 2 16:57:51 2012 (r242485) +++ head/sbin/dumpon/dumpon.c Fri Nov 2 17:30:08 2012 (r242486) @@ -64,7 +64,7 @@ usage(void) fprintf(stderr, "%s\n%s\n%s\n", "usage: dumpon [-v] special_file", " dumpon [-v] off", - " dumpon -l"); + " dumpon [-v] -l"); exit(EX_USAGE); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 18:57:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E9F89685; Fri, 2 Nov 2012 18:57:38 +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 D2B778FC0C; Fri, 2 Nov 2012 18:57:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2Ivcih082691; Fri, 2 Nov 2012 18:57:38 GMT (envelope-from alfred@svn.freebsd.org) Received: (from alfred@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2Ivc2O082689; Fri, 2 Nov 2012 18:57:38 GMT (envelope-from alfred@svn.freebsd.org) Message-Id: <201211021857.qA2Ivc2O082689@svn.freebsd.org> From: Alfred Perlstein Date: Fri, 2 Nov 2012 18:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242489 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 18:57:39 -0000 Author: alfred Date: Fri Nov 2 18:57:38 2012 New Revision: 242489 URL: http://svn.freebsd.org/changeset/base/242489 Log: Merge 242488, better use of strlcpy. Submitted by: Eric van Gyzen Modified: head/sys/kern/kern_shutdown.c Directory Properties: head/sys/ (props changed) Modified: head/sys/kern/kern_shutdown.c ============================================================================== --- head/sys/kern/kern_shutdown.c Fri Nov 2 18:54:10 2012 (r242488) +++ head/sys/kern/kern_shutdown.c Fri Nov 2 18:57:38 2012 (r242489) @@ -720,6 +720,7 @@ SYSCTL_STRING(_kern_shutdown, OID_AUTO, int set_dumper(struct dumperinfo *di, const char *devname) { + size_t wantcopy; if (di == NULL) { bzero(&dumper, sizeof dumper); @@ -729,8 +730,8 @@ set_dumper(struct dumperinfo *di, const if (dumper.dumper != NULL) return (EBUSY); dumper = *di; - strlcpy(dumpdevname, devname, sizeof(dumpdevname)); - if (strlen(dumpdevname) != strlen(devname)) { + wantcopy = strlcpy(dumpdevname, devname, sizeof(dumpdevname)); + if (wantcopy >= sizeof(dumpdevname)) { printf("set_dumper: device name truncated from '%s' -> '%s'\n", devname, dumpdevname); } From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 21:04:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA18E92D; Fri, 2 Nov 2012 21:04:06 +0000 (UTC) (envelope-from jeff@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1E818FC0A; Fri, 2 Nov 2012 21:04:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2L46ts001280; Fri, 2 Nov 2012 21:04:06 GMT (envelope-from jeff@svn.freebsd.org) Received: (from jeff@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2L469N001278; Fri, 2 Nov 2012 21:04:06 GMT (envelope-from jeff@svn.freebsd.org) Message-Id: <201211022104.qA2L469N001278@svn.freebsd.org> From: Jeff Roberson Date: Fri, 2 Nov 2012 21:04:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242492 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 21:04:07 -0000 Author: jeff Date: Fri Nov 2 21:04:06 2012 New Revision: 242492 URL: http://svn.freebsd.org/changeset/base/242492 Log: - In cancel_mkdir_dotdot don't panic if the inodedep is not available. If the previous diradd had already finished it could have been reclaimed already. This would only happen under heavy dependency pressure. Reported by: Andrey Zonov Discussed with: mckusick MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Fri Nov 2 20:36:41 2012 (r242491) +++ head/sys/ufs/ffs/ffs_softdep.c Fri Nov 2 21:04:06 2012 (r242492) @@ -8579,7 +8579,7 @@ cancel_mkdir_dotdot(ip, dirrem, jremref) if (inodedep_lookup(UFSTOVFS(ip->i_ump), ip->i_number, 0, &inodedep) == 0) - panic("cancel_mkdir_dotdot: Lost inodedep"); + return (jremref); dap = inodedep->id_mkdiradd; if (dap == NULL || (dap->da_state & MKDIR_PARENT) == 0) return (jremref); From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 21:26:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8BE91D3; Fri, 2 Nov 2012 21:26:14 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4E7DE8FC0A; Fri, 2 Nov 2012 21:26:14 +0000 (UTC) Received: by mail-pa0-f54.google.com with SMTP id bi1so2899797pad.13 for ; Fri, 02 Nov 2012 14:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=eRvBKYAea/7sVan8x5ZgWduoui0OP/H3K8OO4gJsp2Y=; b=Dbs7IsUps8cDnSQEU6B0PF80HzEsTmKI73Gftqfk/LbmoxkVnPuCxL8ofH/9SlKZUd mL76HP/bp0VCDIW0uiekr4QUixCIVSsJP/w2223UH765UrdDxpDSKRJCSkJOsxYQqNz9 TB7Ud5BfVtttVnVRLRKj/fMks2je1c1sj/7pjWAMeNmOT/DQpUj3vrdllhnQqRRfRO+2 VKWqQvSb5QI4NYTnGPQm9bY1R9bipkhXVoRuOdGf9s/WLfwOFTJCpIiIAG1obG0lSAth wap6pNtiRolU1OdIcoayJO7Rx+BaCUWSSoWfBtATJHv5n45HQRnetG//otlubkZudHZL K5Fg== MIME-Version: 1.0 Received: by 10.66.73.230 with SMTP id o6mr8670547pav.45.1351891573946; Fri, 02 Nov 2012 14:26:13 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Fri, 2 Nov 2012 14:26:13 -0700 (PDT) In-Reply-To: <1351868970.1120.25.camel@revolution.hippie.lan> References: <201211020523.qA25N5No052084@svn.freebsd.org> <1351868970.1120.25.camel@revolution.hippie.lan> Date: Fri, 2 Nov 2012 14:26:13 -0700 X-Google-Sender-Auth: a4WQgi9qqepyiOs5RvNqyJtbpTo Message-ID: Subject: Re: svn commit: r242466 - head/sys/mips/mips From: Adrian Chadd To: Ian Lepore Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 21:26:14 -0000 On 2 November 2012 08:09, Ian Lepore wrote: > Of course, it doesn't save anything if the system is using more than 128 > maps, did you check? When I checked on an arm dreamplug system, there > were roughly 1850 maps allocated by time it got to the login prompt > (making that local cache of 500 maps completely useless). I don't reach that during boot on my 16MB RAM APs. There just aren't that many devices. > The patches I posted in arch@ a while back addressed this problem by > setting up an uma(9) pool for maps (and pools for busdma buffers). The > patches were designed to be easy to incorporate for both arm and mips > busdma implementations. My problem is memory overhead at boot time. :/ Adrian From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 21:28:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C8910255; Fri, 2 Nov 2012 21:28:57 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5400A8FC0A; Fri, 2 Nov 2012 21:28:57 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so5137332oag.13 for ; Fri, 02 Nov 2012 14:28:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=YECwSqmYci7wFjiD1dm4+XBJ21UCOdHtmoEYPIq6qI4=; b=IQc9s4Nw7z/KfxPLvQySl3bfacO88hTPJXrYBzsekdBQwDsqwPXU6jFgYTkJNrMltI QIsvSFxNcvOCAd9PfFpOukEhwjCXFlJgPmnhsPLQEzvfnQ6El3FizSreLJEytBAFPaF7 nlqMtPgTSItAph9UYdPbeeb9bbYcONmbXSBIOx97M8Xyo60KZ8CTnrxNGl7BJkIIjL1C Ty5taeOmWbGqv0jwpvLA+A0DfTYbXU6P5249Ye/+QHJ4GsZ/nGbjqgB4k8WWlcBYGDpu MFzSX0ibWr9LLIiFMVdPpH4OTezHlLjRQmqvexpaASfH8xYaPiUtXElqyyMYgY/gUqAE kKXA== MIME-Version: 1.0 Received: by 10.60.13.198 with SMTP id j6mr2453424oec.51.1351891736536; Fri, 02 Nov 2012 14:28:56 -0700 (PDT) Received: by 10.76.143.33 with HTTP; Fri, 2 Nov 2012 14:28:56 -0700 (PDT) In-Reply-To: References: <201211020523.qA25N5No052084@svn.freebsd.org> <1351868970.1120.25.camel@revolution.hippie.lan> Date: Fri, 2 Nov 2012 14:28:56 -0700 Message-ID: Subject: Re: svn commit: r242466 - head/sys/mips/mips From: Garrett Cooper To: Adrian Chadd Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, Ian Lepore , svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 21:28:57 -0000 On Fri, Nov 2, 2012 at 2:26 PM, Adrian Chadd wrote: > On 2 November 2012 08:09, Ian Lepore > wrote: > > > Of course, it doesn't save anything if the system is using more than 128 > > maps, did you check? When I checked on an arm dreamplug system, there > > were roughly 1850 maps allocated by time it got to the login prompt > > (making that local cache of 500 maps completely useless). > > I don't reach that during boot on my 16MB RAM APs. There just aren't > that many devices. > > > The patches I posted in arch@ a while back addressed this problem by > > setting up an uma(9) pool for maps (and pools for busdma buffers). The > > patches were designed to be easy to incorporate for both arm and mips > > busdma implementations. > > My problem is memory overhead at boot time. :/ > Maybe this should be a compile time constant that one can specify in their KERNCONF? Cheers, -Garrett From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 21:47:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D336631; Fri, 2 Nov 2012 21:47:22 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 542448FC08; Fri, 2 Nov 2012 21:47:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2LlMsq008718; Fri, 2 Nov 2012 21:47:22 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2LlMJL008716; Fri, 2 Nov 2012 21:47:22 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211022147.qA2LlMJL008716@svn.freebsd.org> From: Joel Dahl Date: Fri, 2 Nov 2012 21:47:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242495 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 21:47:22 -0000 Author: joel (doc committer) Date: Fri Nov 2 21:47:21 2012 New Revision: 242495 URL: http://svn.freebsd.org/changeset/base/242495 Log: A few minor adjustments after r242424: - Sort entries in SYNOPSIS. - Start sentence on a new line. - Remove redundant textdump dump description. Submitted by: bde Modified: head/share/man/man4/textdump.4 Modified: head/share/man/man4/textdump.4 ============================================================================== --- head/share/man/man4/textdump.4 Fri Nov 2 21:11:56 2012 (r242494) +++ head/share/man/man4/textdump.4 Fri Nov 2 21:47:21 2012 (r242495) @@ -34,11 +34,11 @@ .Nm textdump .Nd textdump kernel dumping facility .Sh SYNOPSIS -.Cd options KDB .Cd options DDB +.Cd options KDB .Pp -.Cd options TEXTDUMP_VERBOSE .Cd options TEXTDUMP_PREFERRED +.Cd options TEXTDUMP_VERBOSE .Sh DESCRIPTION The .Nm @@ -118,8 +118,8 @@ or by setting the .Dv debug.ddb.textdump.pending sysctl to 1 using .Xr sysctl 8 , -it is possible to request that the next dump be a textdump. One can -also directly trigger a textdump in +it is possible to request that the next dump be a textdump. +One may also directly trigger a textdump in .Xr ddb 4 by running the command .Ic textdump dump . @@ -132,9 +132,6 @@ command line, the commands and .Ic textdump unset may be used to set, query, and clear the textdump pending flag. -The command -.Ic textdump dump -can be used to immediately trigger a textdump. .Pp As with regular kernel dumps, a dump partition must be automatically or manually configured using @@ -145,8 +142,8 @@ Additional kernel options: .Bl -tag -width TEXTDUMP_PREFERRED .It Cd TEXTDUMP_PREFERRED -sets textdumps to be the default manner of doing dumps. This means there -will be no need to +sets textdumps to be the default manner of doing dumps. +This means there will be no need to .Xr sysctl 8 or use the .Ic textdump set From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 22:03:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E96ACA86; Fri, 2 Nov 2012 22:03:39 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFC9B8FC0A; Fri, 2 Nov 2012 22:03:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2M3diH011400; Fri, 2 Nov 2012 22:03:39 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2M3dVr011397; Fri, 2 Nov 2012 22:03:39 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201211022203.qA2M3dVr011397@svn.freebsd.org> From: Jim Harris Date: Fri, 2 Nov 2012 22:03:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242496 - head/share/man/man4 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 22:03:40 -0000 Author: jimharris Date: Fri Nov 2 22:03:39 2012 New Revision: 242496 URL: http://svn.freebsd.org/changeset/base/242496 Log: Update nsamples and nbuffers defaults to match reality. Modified: head/share/man/man4/hwpmc.4 Modified: head/share/man/man4/hwpmc.4 ============================================================================== --- head/share/man/man4/hwpmc.4 Fri Nov 2 21:47:21 2012 (r242495) +++ head/share/man/man4/hwpmc.4 Fri Nov 2 22:03:39 2012 (r242496) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 22, 2008 +.Dd November 2, 2012 .Dt HWPMC 4 .Os .Sh NAME @@ -430,10 +430,10 @@ The default is 32. The number of log buffers used by .Nm for logging. -The default is 16. +The default is 64. .It Va kern.hwpmc.nsamples Pq integer, read-only The number of entries in the per-CPU ring buffer used during sampling. -The default is 16. +The default is 512. .It Va security.bsd.unprivileged_syspmcs Pq boolean, read-write If set to non-zero, allow unprivileged processes to allocate system-wide PMCs. From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 22:07:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E2E6CC3E; Fri, 2 Nov 2012 22:07:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CA05F8FC0A; Fri, 2 Nov 2012 22:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2M7j8N012026; Fri, 2 Nov 2012 22:07:45 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2M7jU2012024; Fri, 2 Nov 2012 22:07:45 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211022207.qA2M7jU2012024@svn.freebsd.org> From: Xin LI Date: Fri, 2 Nov 2012 22:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242497 - head/sys/dev/mfi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 22:07:46 -0000 Author: delphij Date: Fri Nov 2 22:07:45 2012 New Revision: 242497 URL: http://svn.freebsd.org/changeset/base/242497 Log: Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI command properly. Without this change, mfi(4) always sends 10 byte READ and WRITE commands, which will cause data corruption when device is larger than 2^32 sectors. PR: kern/173291 Submitted by: Steven Hartland Reviewed by: mav MFC after: 2 weeks Modified: head/sys/dev/mfi/mfi.c Modified: head/sys/dev/mfi/mfi.c ============================================================================== --- head/sys/dev/mfi/mfi.c Fri Nov 2 22:03:39 2012 (r242496) +++ head/sys/dev/mfi/mfi.c Fri Nov 2 22:07:45 2012 (r242497) @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru static struct mfi_command * mfi_bio_command(struct mfi_softc *); static void mfi_bio_complete(struct mfi_command *); static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, + uint64_t lba, uint8_t byte2, int readop); static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); static int mfi_abort(struct mfi_softc *, struct mfi_command *); @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) mfi_enqueue_bio(sc, bio); return cm; } + +static int +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, + uint64_t lba, uint8_t byte2, int readop) +{ + int cdb_len; + + if (((lba & 0x1fffff) == lba) + && ((block_count & 0xff) == block_count) + && (byte2 == 0)) { + /* We can fit in a 6 byte cdb */ + struct scsi_rw_6 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; + scsi_ulto3b(lba, scsi_cmd->addr); + scsi_cmd->length = block_count & 0xff; + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffff) == block_count) && ((lba & 0xffffffff) == lba)) { + /* Need a 10 byte CDB */ + struct scsi_rw_10 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto2b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else if (((block_count & 0xffffffff) == block_count) && + ((lba & 0xffffffff) == lba)) { + /* Block count is too big for 10 byte CDB use a 12 byte CDB */ + struct scsi_rw_12 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; + scsi_cmd->byte2 = byte2; + scsi_ulto4b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } else { + /* + * 16 byte CDB. We'll only get here if the LBA is larger + * than 2^32 + */ + struct scsi_rw_16 *scsi_cmd; + + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; + scsi_cmd->byte2 = byte2; + scsi_u64to8b(lba, scsi_cmd->addr); + scsi_cmd->reserved = 0; + scsi_ulto4b(block_count, scsi_cmd->length); + scsi_cmd->control = 0; + cdb_len = sizeof(*scsi_cmd); + } + + return cdb_len; +} + static struct mfi_command * mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) { struct mfi_command *cm; struct mfi_pass_frame *pass; - int flags = 0, blkcount = 0; - uint32_t context = 0; + int flags = 0; + uint8_t cdb_len; + uint32_t block_count, context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) return (NULL); @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, pass->header.cmd = MFI_CMD_PD_SCSI_IO; switch (bio->bio_cmd & 0x03) { case BIO_READ: -#define SCSI_READ 0x28 - pass->cdb[0] = SCSI_READ; flags = MFI_CMD_DATAIN; break; case BIO_WRITE: -#define SCSI_WRITE 0x2a - pass->cdb[0] = SCSI_WRITE; flags = MFI_CMD_DATAOUT; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command"); } /* Cheat with the sector length to avoid a non-constant division */ - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; + block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; /* Fill the LBA and Transfer length in CDB */ - pass->cdb[2] = (bio->bio_pblkno & 0xff000000) >> 24; - pass->cdb[3] = (bio->bio_pblkno & 0x00ff0000) >> 16; - pass->cdb[4] = (bio->bio_pblkno & 0x0000ff00) >> 8; - pass->cdb[5] = bio->bio_pblkno & 0x000000ff; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); + cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, 0, + flags == MFI_CMD_DATAIN); + pass->header.target_id = (uintptr_t)bio->bio_driver1; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = bio->bio_bcount; - pass->header.cdb_len = 10; + pass->header.cdb_len = cdb_len; pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_complete = mfi_bio_complete; @@ -2048,7 +2109,8 @@ mfi_build_ldio(struct mfi_softc *sc, str { struct mfi_io_frame *io; struct mfi_command *cm; - int flags, blkcount; + int flags; + uint32_t blkcount; uint32_t context = 0; if ((cm = mfi_dequeue_free(sc)) == NULL) @@ -2069,7 +2131,8 @@ mfi_build_ldio(struct mfi_softc *sc, str flags = MFI_CMD_DATAOUT; break; default: - panic("Invalid bio command"); + /* TODO: what about BIO_DELETE??? */ + panic("Unsupported bio command"); } /* Cheat with the sector length to avoid a non-constant division */ @@ -2460,7 +2523,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * struct mfi_command *cm; struct mfi_pass_frame *pass; int error; - int blkcount = 0; + uint32_t blkcount; if ((cm = mfi_dequeue_free(sc)) == NULL) return (EBUSY); @@ -2468,21 +2531,14 @@ mfi_dump_syspd_blocks(struct mfi_softc * pass = &cm->cm_frame->pass; bzero(pass->cdb, 16); pass->header.cmd = MFI_CMD_PD_SCSI_IO; - pass->cdb[0] = SCSI_WRITE; - pass->cdb[2] = (lba & 0xff000000) >> 24; - pass->cdb[3] = (lba & 0x00ff0000) >> 16; - pass->cdb[4] = (lba & 0x0000ff00) >> 8; - pass->cdb[5] = (lba & 0x000000ff); blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; - pass->cdb[7] = (blkcount & 0xff00) >> 8; - pass->cdb[8] = (blkcount & 0x00ff); pass->header.target_id = id; pass->header.timeout = 0; pass->header.flags = 0; pass->header.scsi_status = 0; pass->header.sense_len = MFI_SENSE_LEN; pass->header.data_len = len; - pass->header.cdb_len = 10; + pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, 0); pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); cm->cm_data = virt; From owner-svn-src-head@FreeBSD.ORG Fri Nov 2 22:32:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0C6C1B50; Fri, 2 Nov 2012 22:32:48 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CEF8C8FC0A; Fri, 2 Nov 2012 22:32:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA2MWlcH016210; Fri, 2 Nov 2012 22:32:47 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA2MWlAU016208; Fri, 2 Nov 2012 22:32:47 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201211022232.qA2MWlAU016208@svn.freebsd.org> From: Joel Dahl Date: Fri, 2 Nov 2012 22:32:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242499 - head/bin/ln X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Nov 2012 22:32:48 -0000 Author: joel (doc committer) Date: Fri Nov 2 22:32:47 2012 New Revision: 242499 URL: http://svn.freebsd.org/changeset/base/242499 Log: Add a couple of examples. Obtained from: OpenBSD Modified: head/bin/ln/ln.1 Modified: head/bin/ln/ln.1 ============================================================================== --- head/bin/ln/ln.1 Fri Nov 2 22:17:10 2012 (r242498) +++ head/bin/ln/ln.1 Fri Nov 2 22:32:47 2012 (r242499) @@ -32,7 +32,7 @@ .\" @(#)ln.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd July 17, 2009 +.Dd November 2, 2012 .Dt LN 1 .Os .Sh NAME @@ -212,6 +212,70 @@ No options may be supplied in this simpl which performs a .Xr link 2 operation using the two passed arguments. +.Sh EXAMPLES +Create a symbolic link named +.Pa /home/src +and point it to +.Pa /usr/src : +.Pp +.Dl # ln -s /usr/src /home/src +.Pp +Hard link +.Pa /usr/local/bin/fooprog +to file +.Pa /usr/local/bin/fooprog-1.0 : +.Pp +.Dl # ln /usr/local/bin/fooprog-1.0 /usr/local/bin/fooprog +.Pp +As an exercise, try the following commands: +.Bd -literal -offset indent +# ls -i /bin/[ +11553 /bin/[ +# ls -i /bin/test +11553 /bin/test +.Ed +.Pp +Note that both files have the same inode; that is, +.Pa /bin/[ +is essentially an alias for the +.Xr test 1 +command. +This hard link exists so +.Xr test 1 +may be invoked from shell scripts, for example, using the +.Li "if [ ]" +construct. +.Pp +In the next example, the second call to +.Nm +removes the original +.Pa foo +and creates a replacement pointing to +.Pa baz : +.Bd -literal -offset indent +# mkdir bar baz +# ln -s bar foo +# ln -shf baz foo +.Ed +.Pp +Without the +.Fl h +option, this would instead leave +.Pa foo +pointing to +.Pa bar +and inside +.Pa foo +create a new symlink +.Pa baz +pointing to itself. +This results from directory-walking. +.Pp +An easy rule to remember is that the argument order for +.Nm +is the same as for +.Xr cp 1 : +The first argument needs to exist, the second one is created. .Sh COMPATIBILITY The .Fl h , From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 00:10:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6FFB3111; Sat, 3 Nov 2012 00:10:31 +0000 (UTC) (envelope-from sjg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 570438FC08; Sat, 3 Nov 2012 00:10:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA30AVxg032229; Sat, 3 Nov 2012 00:10:31 GMT (envelope-from sjg@svn.freebsd.org) Received: (from sjg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA30AUSE032225; Sat, 3 Nov 2012 00:10:30 GMT (envelope-from sjg@svn.freebsd.org) Message-Id: <201211030010.qA30AUSE032225@svn.freebsd.org> From: "Simon J. Gerraty" Date: Sat, 3 Nov 2012 00:10:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242501 - head/usr.sbin/makefs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 00:10:31 -0000 Author: sjg Date: Sat Nov 3 00:10:30 2012 New Revision: 242501 URL: http://svn.freebsd.org/changeset/base/242501 Log: If no contents keyword is specified, the default for files is the named file. Approved by: marcel (mentor) Modified: head/usr.sbin/makefs/mtree.c Modified: head/usr.sbin/makefs/mtree.c ============================================================================== --- head/usr.sbin/makefs/mtree.c Fri Nov 2 23:25:52 2012 (r242500) +++ head/usr.sbin/makefs/mtree.c Sat Nov 3 00:10:30 2012 (r242501) @@ -135,6 +135,47 @@ mtree_warning(const char *fmt, ...) fputc('\n', stderr); } +#ifndef MAKEFS_MAX_TREE_DEPTH +# define MAKEFS_MAX_TREE_DEPTH (MAXPATHLEN/2) +#endif + +/* construct path to node->name */ +static char * +mtree_file_path(fsnode *node) +{ + fsnode *pnode; + struct sbuf *sb; + char *res, *rp[MAKEFS_MAX_TREE_DEPTH]; + int depth; + + depth = 0; + rp[depth] = node->name; + for (pnode = node->parent; pnode && depth < MAKEFS_MAX_TREE_DEPTH; + pnode = pnode->parent) { + if (strcmp(pnode->name, ".") == 0) + break; + rp[++depth] = pnode->name; + } + + sb = sbuf_new(NULL, NULL, 0, SBUF_AUTOEXTEND); + if (sb == NULL) { + errno = ENOMEM; + return (NULL); + } + while (depth > 0) { + sbuf_cat(sb, rp[depth--]); + sbuf_putc(sb, '/'); + } + sbuf_cat(sb, rp[depth]); + sbuf_finish(sb); + res = strdup(sbuf_data(sb)); + sbuf_delete(sb); + if (res == NULL) + errno = ENOMEM; + return res; + +} + /* mtree_resolve() sets errno to indicate why NULL was returned. */ static char * mtree_resolve(const char *spec, int *istemp) @@ -706,6 +747,12 @@ read_mtree_keywords(FILE *fp, fsnode *no return (0); } type = S_IFREG; + } else if (node->type != 0) { + type = node->type; + if (type == S_IFREG) { + /* the named path is the default contents */ + node->contents = mtree_file_path(node); + } } else type = (node->symlink != NULL) ? S_IFLNK : S_IFDIR; From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 00:30:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E6E5A558; Sat, 3 Nov 2012 00:30:22 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CE9688FC08; Sat, 3 Nov 2012 00:30:22 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA30UMpF035621; Sat, 3 Nov 2012 00:30:22 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA30UM5U035619; Sat, 3 Nov 2012 00:30:22 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201211030030.qA30UM5U035619@svn.freebsd.org> From: Baptiste Daroussin Date: Sat, 3 Nov 2012 00:30:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242503 - head/lib/libutil X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 00:30:23 -0000 Author: bapt Date: Sat Nov 3 00:30:22 2012 New Revision: 242503 URL: http://svn.freebsd.org/changeset/base/242503 Log: Fix typo Modified: head/lib/libutil/pw_util.3 Modified: head/lib/libutil/pw_util.3 ============================================================================== --- head/lib/libutil/pw_util.3 Sat Nov 3 00:14:17 2012 (r242502) +++ head/lib/libutil/pw_util.3 Sat Nov 3 00:30:22 2012 (r242503) @@ -48,7 +48,7 @@ .In pwd.h .In libutil.h .Ft int -.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct paddwd *oldpw" +.Fn pw_copy "int ffd" "int tfd" "const struct passwd *pw" "const struct passwd *oldpw" .Ft "struct passwd *" .Fn pw_dup "const struct passwd *pw" .Ft int From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 04:28:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6594929; Sat, 3 Nov 2012 04:28:53 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ADFE88FC08; Sat, 3 Nov 2012 04:28:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA34SrbJ083386; Sat, 3 Nov 2012 04:28:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA34Srx2083384; Sat, 3 Nov 2012 04:28:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211030428.qA34Srx2083384@svn.freebsd.org> From: Xin LI Date: Sat, 3 Nov 2012 04:28:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242506 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 04:28:53 -0000 Author: delphij Date: Sat Nov 3 04:28:53 2012 New Revision: 242506 URL: http://svn.freebsd.org/changeset/base/242506 Log: Sync strlen with userland implementation. MFC after: 1 month Modified: head/sys/libkern/strlen.c Modified: head/sys/libkern/strlen.c ============================================================================== --- head/sys/libkern/strlen.c Sat Nov 3 01:40:05 2012 (r242505) +++ head/sys/libkern/strlen.c Sat Nov 3 04:28:53 2012 (r242506) @@ -1,6 +1,6 @@ /*- - * Copyright (c) 1990, 1993 - * The Regents of the University of California. All rights reserved. + * Copyright (c) 2009, 2010 Xin LI + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,14 +10,11 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors - * 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 + * 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 REGENTS OR CONTRIBUTORS BE LIABLE + * 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) @@ -31,14 +28,102 @@ __FBSDID("$FreeBSD$"); #include +#include + +/* + * Portable strlen() for 32-bit and 64-bit systems. + * + * Rationale: it is generally much more efficient to do word length + * operations and avoid branches on modern computer systems, as + * compared to byte-length operations with a lot of branches. + * + * The expression: + * + * ((x - 0x01....01) & ~x & 0x80....80) + * + * would evaluate to a non-zero value iff any of the bytes in the + * original word is zero. + * + * On multi-issue processors, we can divide the above expression into: + * a) (x - 0x01....01) + * b) (~x & 0x80....80) + * c) a & b + * + * Where, a) and b) can be partially computed in parallel. + * + * The algorithm above is found on "Hacker's Delight" by + * Henry S. Warren, Jr. + */ + +/* Magic numbers for the algorithm */ +#if LONG_BIT == 32 +static const unsigned long mask01 = 0x01010101; +static const unsigned long mask80 = 0x80808080; +#elif LONG_BIT == 64 +static const unsigned long mask01 = 0x0101010101010101; +static const unsigned long mask80 = 0x8080808080808080; +#else +#error Unsupported word size +#endif + +#define LONGPTR_MASK (sizeof(long) - 1) + +/* + * Helper macro to return string length if we caught the zero + * byte. + */ +#define testbyte(x) \ + do { \ + if (p[x] == '\0') \ + return (p - str + x); \ + } while (0) size_t -strlen(str) - const char *str; +strlen(const char *str) { - register const char *s; + const char *p; + const unsigned long *lp; + long va, vb; - for (s = str; *s; ++s); - return(s - str); -} + /* + * Before trying the hard (unaligned byte-by-byte access) way + * to figure out whether there is a nul character, try to see + * if there is a nul character is within this accessible word + * first. + * + * p and (p & ~LONGPTR_MASK) must be equally accessible since + * they always fall in the same memory page, as long as page + * boundaries is integral multiple of word size. + */ + lp = (const unsigned long *)((uintptr_t)str & ~LONGPTR_MASK); + va = (*lp - mask01); + vb = ((~*lp) & mask80); + lp++; + if (va & vb) + /* Check if we have \0 in the first part */ + for (p = str; p < (const char *)lp; p++) + if (*p == '\0') + return (p - str); + /* Scan the rest of the string using word sized operation */ + for (; ; lp++) { + va = (*lp - mask01); + vb = ((~*lp) & mask80); + if (va & vb) { + p = (const char *)(lp); + testbyte(0); + testbyte(1); + testbyte(2); + testbyte(3); +#if (LONG_BIT >= 64) + testbyte(4); + testbyte(5); + testbyte(6); + testbyte(7); +#endif + } + } + + /* NOTREACHED */ + return (0); +} From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 04:29:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93044AA0; Sat, 3 Nov 2012 04:29:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7ABCC8FC08; Sat, 3 Nov 2012 04:29:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA34TP1F083612; Sat, 3 Nov 2012 04:29:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA34TP09083610; Sat, 3 Nov 2012 04:29:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211030429.qA34TP09083610@svn.freebsd.org> From: Xin LI Date: Sat, 3 Nov 2012 04:29:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242507 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 04:29:25 -0000 Author: delphij Date: Sat Nov 3 04:29:24 2012 New Revision: 242507 URL: http://svn.freebsd.org/changeset/base/242507 Log: Sync strlcpy with userland version. MFC after: 1 month Modified: head/sys/libkern/strlcpy.c Modified: head/sys/libkern/strlcpy.c ============================================================================== --- head/sys/libkern/strlcpy.c Sat Nov 3 04:28:53 2012 (r242506) +++ head/sys/libkern/strlcpy.c Sat Nov 3 04:29:24 2012 (r242507) @@ -1,35 +1,21 @@ -/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ +/* $OpenBSD: strlcpy.c,v 1.11 2006/05/05 15:27:38 millert Exp $ */ /*- * Copyright (c) 1998 Todd C. Miller - * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * 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 ``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. + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; -#endif /* LIBC_SCCS and not lint */ #include __FBSDID("$FreeBSD$"); @@ -41,21 +27,19 @@ __FBSDID("$FreeBSD$"); * will be copied. Always NUL terminates (unless siz == 0). * Returns strlen(src); if retval >= siz, truncation occurred. */ -size_t strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; +size_t +strlcpy(char * __restrict dst, const char * __restrict src, size_t siz) { char *d = dst; const char *s = src; size_t n = siz; /* Copy as many bytes as will fit */ - if (n != 0 && --n != 0) { - do { - if ((*d++ = *s++) == 0) + if (n != 0) { + while (--n != 0) { + if ((*d++ = *s++) == '\0') break; - } while (--n != 0); + } } /* Not enough room in dst, add NUL and traverse rest of src */ From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 04:53:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6F758D58; Sat, 3 Nov 2012 04:53:45 +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 54B918FC0C; Sat, 3 Nov 2012 04:53:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA34rjpd088693; Sat, 3 Nov 2012 04:53:45 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA34rjA3088690; Sat, 3 Nov 2012 04:53:45 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211030453.qA34rjA3088690@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 04:53:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242508 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 04:53:45 -0000 Author: adrian Date: Sat Nov 3 04:53:44 2012 New Revision: 242508 URL: http://svn.freebsd.org/changeset/base/242508 Log: Add a debug method to dump the EDMA TX status descriptor contents out. This requires some HAL API changes to be useful, as there's no way right now to pull out the TX status descriptor contents. Modified: head/sys/dev/ath/if_ath_debug.c head/sys/dev/ath/if_ath_debug.h Modified: head/sys/dev/ath/if_ath_debug.c ============================================================================== --- head/sys/dev/ath/if_ath_debug.c Sat Nov 3 04:29:24 2012 (r242507) +++ head/sys/dev/ath/if_ath_debug.c Sat Nov 3 04:53:44 2012 (r242508) @@ -247,4 +247,16 @@ ath_printtxbuf(struct ath_softc *sc, con ath_printtxbuf_legacy(sc, first_bf, qnum, ix, done); } +void +ath_printtxstatbuf(struct ath_softc *sc, const struct ath_buf *first_bf, + const uint32_t *ds, u_int qnum, u_int ix, int done) +{ + + printf("Q%u[%3u] ", qnum, ix); + printf(" %08x %08x %08x %08x %08x %08x\n", + ds[0], ds[1], ds[2], ds[3], ds[4], ds[5]); + printf(" %08x %08x %08x %08x %08x\n", + ds[6], ds[7], ds[8], ds[9], ds[10]); +} + #endif /* ATH_DEBUG */ Modified: head/sys/dev/ath/if_ath_debug.h ============================================================================== --- head/sys/dev/ath/if_ath_debug.h Sat Nov 3 04:29:24 2012 (r242507) +++ head/sys/dev/ath/if_ath_debug.h Sat Nov 3 04:53:44 2012 (r242508) @@ -105,6 +105,8 @@ extern void ath_printrxbuf(struct ath_so u_int ix, int); extern void ath_printtxbuf(struct ath_softc *, const struct ath_buf *bf, u_int qnum, u_int ix, int done); +extern void ath_printtxstatbuf(struct ath_softc *sc, const struct ath_buf *bf, + const uint32_t *ds, u_int qnum, u_int ix, int done); #else /* ATH_DEBUG */ #define ATH_KTR(_sc, _km, _kf, ...) do { } while (0) From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 04:55:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 36E91ECF; Sat, 3 Nov 2012 04:55: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 13FFD8FC08; Sat, 3 Nov 2012 04:55:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA34th0Y089155; Sat, 3 Nov 2012 04:55:43 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA34thnV089151; Sat, 3 Nov 2012 04:55:43 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211030455.qA34thnV089151@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 04:55:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242509 - in head/sys/dev/ath/ath_hal: . ar5416 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 04:55:44 -0000 Author: adrian Date: Sat Nov 3 04:55:43 2012 New Revision: 242509 URL: http://svn.freebsd.org/changeset/base/242509 Log: HAL API changes! * introduce a new HAL API method to pull out the TX status descriptor contents. * Add num_delims to the 11n first aggr method. This isn't used by the driver at the moment so it won't affect anything. 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_xmit.c Modified: head/sys/dev/ath/ath_hal/ah.h ============================================================================== --- head/sys/dev/ath/ath_hal/ah.h Sat Nov 3 04:53:44 2012 (r242508) +++ head/sys/dev/ath/ath_hal/ah.h Sat Nov 3 04:55:43 2012 (r242509) @@ -570,6 +570,15 @@ typedef enum { HAL_GPIO_INTR_DISABLE = 2 } HAL_GPIO_INTR_TYPE; +typedef struct halCounters { + u_int32_t tx_frame_count; + u_int32_t rx_frame_count; + u_int32_t rx_clear_count; + u_int32_t cycle_count; + u_int8_t is_rx_active; // true (1) or false (0) + u_int8_t is_tx_active; // true (1) or false (0) +} HAL_COUNTERS; + typedef enum { HAL_RFGAIN_INACTIVE = 0, HAL_RFGAIN_READ_REQUESTED = 1, @@ -1314,6 +1323,7 @@ struct ath_hal { void __ahdecl(*ah_setupTxStatusRing)(struct ath_hal *, void *ts_start, uint32_t ts_paddr_start, uint16_t size); + void __ahdecl(*ah_getTxRawTxDesc)(struct ath_hal *, u_int32_t *); /* Receive Functions */ uint32_t __ahdecl(*ah_getRxDP)(struct ath_hal*, HAL_RX_QUEUE); @@ -1469,7 +1479,7 @@ struct ath_hal { void *, u_int, HAL_PKT_TYPE, u_int, u_int, u_int); void __ahdecl(*ah_set11nAggrFirst)(struct ath_hal *, - struct ath_desc *, u_int); + struct ath_desc *, u_int, u_int); void __ahdecl(*ah_set11nAggrMiddle)(struct ath_hal *, struct ath_desc *, u_int); void __ahdecl(*ah_set11nAggrLast)(struct ath_hal *, Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Nov 3 04:53:44 2012 (r242508) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Sat Nov 3 04:55:43 2012 (r242509) @@ -391,7 +391,7 @@ extern void ar5416Set11nRateScenario(str u_int nseries, u_int flags); extern void ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, - u_int aggrLen); + u_int aggrLen, u_int numDelims); extern void ar5416Set11nAggrMiddle(struct ath_hal *ah, struct ath_desc *ds, u_int numDelims); extern void ar5416Set11nAggrLast(struct ath_hal *ah, struct ath_desc *ds); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Nov 3 04:53:44 2012 (r242508) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_xmit.c Sat Nov 3 04:55:43 2012 (r242509) @@ -735,7 +735,8 @@ ar5416Set11nRateScenario(struct ath_hal } void -ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, u_int aggrLen) +ar5416Set11nAggrFirst(struct ath_hal *ah, struct ath_desc *ds, u_int aggrLen, + u_int numDelims) { struct ar5416_desc *ads = AR5416DESC(ds); @@ -743,6 +744,7 @@ ar5416Set11nAggrFirst(struct ath_hal *ah ads->ds_ctl6 &= ~(AR_AggrLen | AR_PadDelim); ads->ds_ctl6 |= SM(aggrLen, AR_AggrLen); + ads->ds_ctl6 |= SM(numDelims, AR_PadDelim); } void From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 04:56:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C6D4FAF; Sat, 3 Nov 2012 04:56:08 +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 AC23C8FC12; Sat, 3 Nov 2012 04:56:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA34u8oK089289; Sat, 3 Nov 2012 04:56:08 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA34u8XF089287; Sat, 3 Nov 2012 04:56:08 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211030456.qA34u8XF089287@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 04:56:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242510 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 04:56:08 -0000 Author: adrian Date: Sat Nov 3 04:56:08 2012 New Revision: 242510 URL: http://svn.freebsd.org/changeset/base/242510 Log: HAL API updates, from the previous couple of HAL commits. Modified: head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Nov 3 04:55:43 2012 (r242509) +++ head/sys/dev/ath/if_athvar.h Sat Nov 3 04:56:08 2012 (r242510) @@ -1225,6 +1225,8 @@ void ath_intr(void *); #define ath_hal_setuptxstatusring(_ah, _tsstart, _tspstart, _size) \ ((*(_ah)->ah_setupTxStatusRing)((_ah), (_tsstart), (_tspstart), \ (_size))) +#define ath_hal_gettxrawtxdesc(_ah, _txstatus) \ + ((*(_ah)->ah_getTxRawTxDesc)((_ah), (_txstatus))) #define ath_hal_setupfirsttxdesc(_ah, _ds, _aggrlen, _flags, _txpower, \ _txr0, _txtr0, _antm, _rcr, _rcd) \ @@ -1243,8 +1245,8 @@ void ath_intr(void *); (_series), (_ns), (_flags))) #define ath_hal_set11n_aggr_first(_ah, _ds, _len, _num) \ - ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len))) -#define ath_hal_set11naggrmiddle(_ah, _ds, _num) \ + ((*(_ah)->ah_set11nAggrFirst)((_ah), (_ds), (_len), (_num))) +#define ath_hal_set11n_aggr_middle(_ah, _ds, _num) \ ((*(_ah)->ah_set11nAggrMiddle)((_ah), (_ds), (_num))) #define ath_hal_set11n_aggr_last(_ah, _ds) \ ((*(_ah)->ah_set11nAggrLast)((_ah), (_ds))) From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 05:46:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9474062D; Sat, 3 Nov 2012 05:46:11 +0000 (UTC) (envelope-from cvs-src@yandex.ru) Received: from forward1h.mail.yandex.net (forward1h.mail.yandex.net [IPv6:2a02:6b8:0:f05::10]) by mx1.freebsd.org (Postfix) with ESMTP id 08AF98FC08; Sat, 3 Nov 2012 05:46:10 +0000 (UTC) Received: from smtp2h.mail.yandex.net (smtp2h.mail.yandex.net [84.201.187.145]) by forward1h.mail.yandex.net (Yandex) with ESMTP id 639639E224A; Sat, 3 Nov 2012 09:46:06 +0400 (MSK) Received: from smtp2h.mail.yandex.net (localhost [127.0.0.1]) by smtp2h.mail.yandex.net (Yandex) with ESMTP id D843B170010E; Sat, 3 Nov 2012 09:46:05 +0400 (MSK) Received: from unknown (unknown [178.76.224.133]) by smtp2h.mail.yandex.net (nwsmtp/Yandex) with ESMTP id k5Aieq44-k5AiUQ4E; Sat, 3 Nov 2012 09:46:05 +0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1351921565; bh=57HyKCeFgQhyaXDqv4tx08YDlIB747HX33JZrIDq1bs=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=epuDyixbYNTa5HxkNXHFRbLacsF1s0CLpnwV65pnkiLK0X6ecIp/H5b9SkiislviW rZGjGIY8Dk07WQFan/Mcc+COjSNUFi6vT9/PpXyqaN6rpxFFkkKasEq3MXsHAV38aX /wkTK5OxZaT28Zu1gjaP/wiHroyEmjHguDFWlOL8= Message-ID: <5094AF6A.3000304@yandex.ru> Date: Sat, 03 Nov 2012 09:45:14 +0400 From: Ruslan Mahmatkhanov User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121024 Thunderbird/16.0.1 MIME-Version: 1.0 To: Gleb Smirnoff Subject: Re: svn commit: r242467 - head/sys/dev/drm2 References: <201211020526.qA25QXpa052673@svn.freebsd.org> In-Reply-To: <201211020526.qA25QXpa052673@svn.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 05:46:11 -0000 Gleb Smirnoff wrote on 02.11.2012 09:26: > Author: glebius > Date: Fri Nov 2 05:26:33 2012 > New Revision: 242467 > URL: http://svn.freebsd.org/changeset/base/242467 > > Log: > - If DRM_DEBUG_DEFAULT_ON is defined, then initialize drm_debug_flagi to > all supported debugging bits. > - If DRM_DEBUG_DEFAULT_ON isn't defined, then initialize drm_debug_flag > to zero. > > DRM_DEBUG_DEFAULT_ON is defined when module is build with -DDEBUG_DRM > or if kernel config has 'options DEBUG_DRM'. Thanks a lot for this! My /var/log/messages is now clean again. > > Reviewed by: kib > > Modified: > head/sys/dev/drm2/drm_drv.c > > Modified: head/sys/dev/drm2/drm_drv.c > ============================================================================== > --- head/sys/dev/drm2/drm_drv.c Fri Nov 2 05:23:05 2012 (r242466) > +++ head/sys/dev/drm2/drm_drv.c Fri Nov 2 05:26:33 2012 (r242467) > @@ -44,9 +44,10 @@ __FBSDID("$FreeBSD$"); > #include > > #ifdef DRM_DEBUG_DEFAULT_ON > -int drm_debug_flag = 1; > +int drm_debug_flag = (DRM_DEBUGBITS_DEBUG | DRM_DEBUGBITS_KMS | > + DRM_DEBUGBITS_FAILED_IOCTL); > #else > -int drm_debug_flag = 2; > +int drm_debug_flag = 0; > #endif > int drm_notyet_flag = 0; -- Regards, Ruslan Tinderboxing kills... the drives. From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 09:18:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9CA75269; Sat, 3 Nov 2012 09:18:38 +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 84D888FC0A; Sat, 3 Nov 2012 09:18:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA39IcLV030405; Sat, 3 Nov 2012 09:18:38 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA39IcH6030403; Sat, 3 Nov 2012 09:18:38 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201211030918.qA39IcH6030403@svn.freebsd.org> From: Jaakko Heinonen Date: Sat, 3 Nov 2012 09:18:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242511 - head/sbin/fsck_msdosfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 09:18:38 -0000 Author: jh Date: Sat Nov 3 09:18:37 2012 New Revision: 242511 URL: http://svn.freebsd.org/changeset/base/242511 Log: Print a newline after the error message. PR: bin/168447 Submitted by: Boris Kochergin Modified: head/sbin/fsck_msdosfs/check.c Modified: head/sbin/fsck_msdosfs/check.c ============================================================================== --- head/sbin/fsck_msdosfs/check.c Sat Nov 3 04:56:08 2012 (r242510) +++ head/sbin/fsck_msdosfs/check.c Sat Nov 3 09:18:37 2012 (r242511) @@ -68,6 +68,7 @@ checkfilesys(const char *fname) if (dosfs < 0) { perr("Can't open `%s'", fname); + printf("\n"); return 8; } From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 13:22:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7A0833DF; Sat, 3 Nov 2012 13:22:26 +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 613BB8FC0C; Sat, 3 Nov 2012 13:22:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3DMQsE072357; Sat, 3 Nov 2012 13:22:26 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3DMQPg072355; Sat, 3 Nov 2012 13:22:26 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201211031322.qA3DMQPg072355@svn.freebsd.org> From: Michael Tuexen Date: Sat, 3 Nov 2012 13:22:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242512 - head/lib/libc/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 13:22:26 -0000 Author: tuexen Date: Sat Nov 3 13:22:25 2012 New Revision: 242512 URL: http://svn.freebsd.org/changeset/base/242512 Log: Fix errno in a couple of error cases. MFC after: 3 days Modified: head/lib/libc/net/sctp_sys_calls.c Modified: head/lib/libc/net/sctp_sys_calls.c ============================================================================== --- head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 09:18:37 2012 (r242511) +++ head/lib/libc/net/sctp_sys_calls.c Sat Nov 3 13:22:25 2012 (r242512) @@ -449,6 +449,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { + errno = ENOMEM; return (-1); } addrs->sget_assoc_id = id; @@ -777,6 +778,7 @@ sctp_sendx(int sd, const void *msg, size } buf = malloc(len); if (buf == NULL) { + errno = ENOMEM; return (-1); } aa = (int *)buf; @@ -1052,7 +1054,7 @@ sctp_sendv(int sd, CMSG_SPACE(sizeof(struct sctp_authinfo)) + (size_t)addrcnt * CMSG_SPACE(sizeof(struct in6_addr))); if (cmsgbuf == NULL) { - errno = ENOBUFS; + errno = ENOMEM; return (-1); } msg.msg_control = cmsgbuf; From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 14:46:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 51E779BA; Sat, 3 Nov 2012 14:46:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3933B8FC0C; Sat, 3 Nov 2012 14:46:16 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3EkGJC084572; Sat, 3 Nov 2012 14:46:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3EkGxG084569; Sat, 3 Nov 2012 14:46:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201211031446.qA3EkGxG084569@svn.freebsd.org> From: Eitan Adler Date: Sat, 3 Nov 2012 14:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242514 - in head: etc/root share/skel X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 14:46:16 -0000 Author: eadler Date: Sat Nov 3 14:46:15 2012 New Revision: 242514 URL: http://svn.freebsd.org/changeset/base/242514 Log: Revert the change that makes less default. Since I've committed this I've receieved roughly an equal amount of email thanking me for making this change and asking me to revert it. I've resisted making this change because new users tend to prefer less over more and these users are the least likely to know how to change the PAGER on their own. Requested by: many Objected to: just as many Decision made by: core Approved by: cperciva MFC after: 3 days Modified: head/etc/root/dot.cshrc head/share/skel/dot.cshrc Modified: head/etc/root/dot.cshrc ============================================================================== --- head/etc/root/dot.cshrc Sat Nov 3 13:29:18 2012 (r242513) +++ head/etc/root/dot.cshrc Sat Nov 3 14:46:15 2012 (r242514) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then Modified: head/share/skel/dot.cshrc ============================================================================== --- head/share/skel/dot.cshrc Sat Nov 3 13:29:18 2012 (r242513) +++ head/share/skel/dot.cshrc Sat Nov 3 14:46:15 2012 (r242514) @@ -18,7 +18,7 @@ umask 22 set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin) setenv EDITOR vi -setenv PAGER less +setenv PAGER more setenv BLOCKSIZE K if ($?prompt) then From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 15:57:37 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B20E5B88; Sat, 3 Nov 2012 15:57:37 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 940318FC08; Sat, 3 Nov 2012 15:57:37 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3FvbXZ095168; Sat, 3 Nov 2012 15:57:37 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3FvbE9095164; Sat, 3 Nov 2012 15:57:37 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211031557.qA3FvbE9095164@svn.freebsd.org> From: Attilio Rao Date: Sat, 3 Nov 2012 15:57:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242515 - in head/sys: kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 15:57:37 -0000 Author: attilio Date: Sat Nov 3 15:57:37 2012 New Revision: 242515 URL: http://svn.freebsd.org/changeset/base/242515 Log: Merge r242395,242483 from mutex implementation: give rwlock(9) the ability to crunch different type of structures, with the only constraint that they have a lock cookie named rw_lock. This name, then, becames reserved from the struct that wants to use the rwlock(9) KPI and other locking primitives cannot reuse it for their members. Namely such structs are the current struct rwlock and the new struct rwlock_padalign. The new structure will define an object which has the same layout of a struct rwlock but will be allocated in areas aligned to the cache line size and will be as big as a cache line. For further details check comments on above mentioned revisions. Reviewed by: jimharris, jeff Modified: head/sys/kern/kern_rwlock.c head/sys/sys/_rwlock.h head/sys/sys/rwlock.h Modified: head/sys/kern/kern_rwlock.c ============================================================================== --- head/sys/kern/kern_rwlock.c Sat Nov 3 14:46:15 2012 (r242514) +++ head/sys/kern/kern_rwlock.c Sat Nov 3 15:57:37 2012 (r242515) @@ -61,6 +61,12 @@ __FBSDID("$FreeBSD$"); PMC_SOFT_DECLARE( , , lock, failed); #endif +/* + * Return the rwlock address when the lock cookie address is provided. + * This functionality assumes that struct rwlock* have a member named rw_lock. + */ +#define rwlock2rw(c) (__containerof(c, struct rwlock, rw_lock)) + #ifdef ADAPTIVE_RWLOCKS static int rowner_retries = 10; static int rowner_loops = 10000; @@ -123,7 +129,7 @@ struct lock_class lock_class_rw = { #define rw_owner(rw) rw_wowner(rw) #ifndef INVARIANTS -#define _rw_assert(rw, what, file, line) +#define __rw_assert(c, what, file, line) #endif void @@ -175,10 +181,13 @@ owner_rw(const struct lock_object *lock, #endif void -rw_init_flags(struct rwlock *rw, const char *name, int opts) +_rw_init_flags(volatile uintptr_t *c, const char *name, int opts) { + struct rwlock *rw; int flags; + rw = rwlock2rw(c); + MPASS((opts & ~(RW_DUPOK | RW_NOPROFILE | RW_NOWITNESS | RW_QUIET | RW_RECURSE)) == 0); ASSERT_ATOMIC_LOAD_PTR(rw->rw_lock, @@ -203,8 +212,11 @@ rw_init_flags(struct rwlock *rw, const c } void -rw_destroy(struct rwlock *rw) +_rw_destroy(volatile uintptr_t *c) { + struct rwlock *rw; + + rw = rwlock2rw(c); KASSERT(rw->rw_lock == RW_UNLOCKED, ("rw lock %p not unlocked", rw)); KASSERT(rw->rw_recurse == 0, ("rw lock %p still recursed", rw)); @@ -217,7 +229,7 @@ rw_sysinit(void *arg) { struct rw_args *args = arg; - rw_init(args->ra_rw, args->ra_desc); + rw_init((struct rwlock *)args->ra_rw, args->ra_desc); } void @@ -225,22 +237,27 @@ rw_sysinit_flags(void *arg) { struct rw_args_flags *args = arg; - rw_init_flags(args->ra_rw, args->ra_desc, args->ra_flags); + rw_init_flags((struct rwlock *)args->ra_rw, args->ra_desc, + args->ra_flags); } int -rw_wowned(const struct rwlock *rw) +_rw_wowned(const volatile uintptr_t *c) { - return (rw_wowner(rw) == curthread); + return (rw_wowner(rwlock2rw(c)) == curthread); } void -_rw_wlock(struct rwlock *rw, const char *file, int line) +_rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; if (SCHEDULER_STOPPED()) return; + + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_wlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -255,13 +272,16 @@ _rw_wlock(struct rwlock *rw, const char } int -_rw_try_wlock(struct rwlock *rw, const char *file, int line) +__rw_try_wlock(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; int rval; if (SCHEDULER_STOPPED()) return (1); + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_try_wlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -286,14 +306,18 @@ _rw_try_wlock(struct rwlock *rw, const c } void -_rw_wunlock(struct rwlock *rw, const char *file, int line) +_rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; if (SCHEDULER_STOPPED()) return; + + rw = rwlock2rw(c); + KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_wunlock() of destroyed rwlock @ %s:%d", file, line)); - _rw_assert(rw, RA_WLOCKED, file, line); + __rw_assert(c, RA_WLOCKED, file, line); curthread->td_locks--; WITNESS_UNLOCK(&rw->lock_object, LOP_EXCLUSIVE, file, line); LOCK_LOG_LOCK("WUNLOCK", &rw->lock_object, 0, rw->rw_recurse, file, @@ -315,8 +339,9 @@ _rw_wunlock(struct rwlock *rw, const cha RW_LOCK_READ) void -_rw_rlock(struct rwlock *rw, const char *file, int line) +__rw_rlock(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; struct turnstile *ts; #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; @@ -337,6 +362,8 @@ _rw_rlock(struct rwlock *rw, const char if (SCHEDULER_STOPPED()) return; + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_rlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -521,13 +548,16 @@ _rw_rlock(struct rwlock *rw, const char } int -_rw_try_rlock(struct rwlock *rw, const char *file, int line) +__rw_try_rlock(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; uintptr_t x; if (SCHEDULER_STOPPED()) return (1); + rw = rwlock2rw(c); + KASSERT(!TD_IS_IDLETHREAD(curthread), ("rw_try_rlock() by idle thread %p on rwlock %s @ %s:%d", curthread, rw->lock_object.lo_name, file, line)); @@ -553,17 +583,20 @@ _rw_try_rlock(struct rwlock *rw, const c } void -_rw_runlock(struct rwlock *rw, const char *file, int line) +_rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; struct turnstile *ts; uintptr_t x, v, queue; if (SCHEDULER_STOPPED()) return; + rw = rwlock2rw(c); + KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_runlock() of destroyed rwlock @ %s:%d", file, line)); - _rw_assert(rw, RA_RLOCKED, file, line); + __rw_assert(c, RA_RLOCKED, file, line); curthread->td_locks--; curthread->td_rw_rlocks--; WITNESS_UNLOCK(&rw->lock_object, 0, file, line); @@ -667,8 +700,10 @@ _rw_runlock(struct rwlock *rw, const cha * read or write lock. */ void -_rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line) +__rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, + int line) { + struct rwlock *rw; struct turnstile *ts; #ifdef ADAPTIVE_RWLOCKS volatile struct thread *owner; @@ -689,6 +724,8 @@ _rw_wlock_hard(struct rwlock *rw, uintpt if (SCHEDULER_STOPPED()) return; + rw = rwlock2rw(c); + if (rw_wlocked(rw)) { KASSERT(rw->lock_object.lo_flags & LO_RECURSABLE, ("%s: recursing but non-recursive rw %s @ %s:%d\n", @@ -850,8 +887,10 @@ _rw_wlock_hard(struct rwlock *rw, uintpt * least one thread is waiting on this lock. */ void -_rw_wunlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, int line) +__rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, + int line) { + struct rwlock *rw; struct turnstile *ts; uintptr_t v; int queue; @@ -859,6 +898,8 @@ _rw_wunlock_hard(struct rwlock *rw, uint if (SCHEDULER_STOPPED()) return; + rw = rwlock2rw(c); + if (rw_wlocked(rw) && rw_recursed(rw)) { rw->rw_recurse--; if (LOCK_LOG_TEST(&rw->lock_object, 0)) @@ -915,8 +956,9 @@ _rw_wunlock_hard(struct rwlock *rw, uint * lock. Returns true if the upgrade succeeded and false otherwise. */ int -_rw_try_upgrade(struct rwlock *rw, const char *file, int line) +__rw_try_upgrade(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; uintptr_t v, x, tid; struct turnstile *ts; int success; @@ -924,9 +966,11 @@ _rw_try_upgrade(struct rwlock *rw, const if (SCHEDULER_STOPPED()) return (1); + rw = rwlock2rw(c); + KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_try_upgrade() of destroyed rwlock @ %s:%d", file, line)); - _rw_assert(rw, RA_RLOCKED, file, line); + __rw_assert(c, RA_RLOCKED, file, line); /* * Attempt to switch from one reader to a writer. If there @@ -988,8 +1032,9 @@ _rw_try_upgrade(struct rwlock *rw, const * Downgrade a write lock into a single read lock. */ void -_rw_downgrade(struct rwlock *rw, const char *file, int line) +__rw_downgrade(volatile uintptr_t *c, const char *file, int line) { + struct rwlock *rw; struct turnstile *ts; uintptr_t tid, v; int rwait, wwait; @@ -997,9 +1042,11 @@ _rw_downgrade(struct rwlock *rw, const c if (SCHEDULER_STOPPED()) return; + rw = rwlock2rw(c); + KASSERT(rw->rw_lock != RW_DESTROYED, ("rw_downgrade() of destroyed rwlock @ %s:%d", file, line)); - _rw_assert(rw, RA_WLOCKED | RA_NOTRECURSED, file, line); + __rw_assert(c, RA_WLOCKED | RA_NOTRECURSED, file, line); #ifndef INVARIANTS if (rw_recursed(rw)) panic("downgrade of a recursed lock"); @@ -1053,7 +1100,7 @@ out: #ifdef INVARIANT_SUPPORT #ifndef INVARIANTS -#undef _rw_assert +#undef __rw_assert #endif /* @@ -1062,11 +1109,15 @@ out: * thread owns an rlock. */ void -_rw_assert(const struct rwlock *rw, int what, const char *file, int line) +__rw_assert(const volatile uintptr_t *c, int what, const char *file, int line) { + const struct rwlock *rw; if (panicstr != NULL) return; + + rw = rwlock2rw(c); + switch (what) { case RA_LOCKED: case RA_LOCKED | RA_RECURSED: Modified: head/sys/sys/_rwlock.h ============================================================================== --- head/sys/sys/_rwlock.h Sat Nov 3 14:46:15 2012 (r242514) +++ head/sys/sys/_rwlock.h Sat Nov 3 15:57:37 2012 (r242515) @@ -32,12 +32,35 @@ #ifndef _SYS__RWLOCK_H_ #define _SYS__RWLOCK_H_ +#include + /* * Reader/writer lock. + * + * The layout of the first 2 members of struct rwlock* is considered fixed. + * More specifically, it is assumed that there is a member called rw_lock + * for every struct rwlock* and that other locking primitive structures are + * not allowed to use such name for their members. + * If this needs to change, the bits in the rwlock implementation might be + * modified appropriately. */ struct rwlock { struct lock_object lock_object; volatile uintptr_t rw_lock; }; +/* + * Members of struct rwlock_padalign must mirror members of struct rwlock. + * rwlock_padalign rwlocks can use rwlock(9) KPI transparently, without + * modifies. + * When using pad-aligned rwlocks within structures, they should generally + * stay as the first member of the struct. This is because otherwise the + * compiler can generate ever more padding for the struct to keep a correct + * alignment for the rwlock. + */ +struct rwlock_padalign { + struct lock_object lock_object; + volatile uintptr_t rw_lock; +} __aligned(CACHE_LINE_SIZE); + #endif /* !_SYS__RWLOCK_H_ */ Modified: head/sys/sys/rwlock.h ============================================================================== --- head/sys/sys/rwlock.h Sat Nov 3 14:46:15 2012 (r242514) +++ head/sys/sys/rwlock.h Sat Nov 3 15:57:37 2012 (r242515) @@ -121,29 +121,67 @@ * external API and should not be called directly. Wrapper macros should * be used instead. */ - -#define rw_init(rw, name) rw_init_flags((rw), (name), 0) -void rw_init_flags(struct rwlock *rw, const char *name, int opts); -void rw_destroy(struct rwlock *rw); +void _rw_init_flags(volatile uintptr_t *c, const char *name, int opts); +void _rw_destroy(volatile uintptr_t *c); void rw_sysinit(void *arg); void rw_sysinit_flags(void *arg); -int rw_wowned(const struct rwlock *rw); -void _rw_wlock(struct rwlock *rw, const char *file, int line); -int _rw_try_wlock(struct rwlock *rw, const char *file, int line); -void _rw_wunlock(struct rwlock *rw, const char *file, int line); -void _rw_rlock(struct rwlock *rw, const char *file, int line); -int _rw_try_rlock(struct rwlock *rw, const char *file, int line); -void _rw_runlock(struct rwlock *rw, const char *file, int line); -void _rw_wlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, +int _rw_wowned(const volatile uintptr_t *c); +void _rw_wlock_cookie(volatile uintptr_t *c, const char *file, int line); +int __rw_try_wlock(volatile uintptr_t *c, const char *file, int line); +void _rw_wunlock_cookie(volatile uintptr_t *c, const char *file, int line); +void __rw_rlock(volatile uintptr_t *c, const char *file, int line); +int __rw_try_rlock(volatile uintptr_t *c, const char *file, int line); +void _rw_runlock_cookie(volatile uintptr_t *c, const char *file, int line); +void __rw_wlock_hard(volatile uintptr_t *c, uintptr_t tid, const char *file, int line); -void _rw_wunlock_hard(struct rwlock *rw, uintptr_t tid, const char *file, +void __rw_wunlock_hard(volatile uintptr_t *c, uintptr_t tid, + const char *file, int line); +int __rw_try_upgrade(volatile uintptr_t *c, const char *file, int line); +void __rw_downgrade(volatile uintptr_t *c, const char *file, int line); +#if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) +void __rw_assert(const volatile uintptr_t *c, int what, const char *file, int line); -int _rw_try_upgrade(struct rwlock *rw, const char *file, int line); -void _rw_downgrade(struct rwlock *rw, const char *file, int line); +#endif + +/* + * Top-level macros to provide lock cookie once the actual rwlock is passed. + * They will also prevent passing a malformed object to the rwlock KPI by + * failing compilation as the rw_lock reserved member will not be found. + */ +#define rw_init(rw, n) \ + _rw_init_flags(&(rw)->rw_lock, n, 0) +#define rw_init_flags(rw, n, o) \ + _rw_init_flags(&(rw)->rw_lock, n, o) +#define rw_destroy(rw) \ + _rw_destroy(&(rw)->rw_lock) +#define rw_wowned(rw) \ + _rw_wowned(&(rw)->rw_lock) +#define _rw_wlock(rw, f, l) \ + _rw_wlock_cookie(&(rw)->rw_lock, f, l) +#define _rw_try_wlock(rw, f, l) \ + __rw_try_wlock(&(rw)->rw_lock, f, l) +#define _rw_wunlock(rw, f, l) \ + _rw_wunlock_cookie(&(rw)->rw_lock, f, l) +#define _rw_rlock(rw, f, l) \ + __rw_rlock(&(rw)->rw_lock, f, l) +#define _rw_try_rlock(rw, f, l) \ + __rw_try_rlock(&(rw)->rw_lock, f, l) +#define _rw_runlock(rw, f, l) \ + _rw_runlock_cookie(&(rw)->rw_lock, f, l) +#define _rw_wlock_hard(rw, t, f, l) \ + __rw_wlock_hard(&(rw)->rw_lock, t, f, l) +#define _rw_wunlock_hard(rw, t, f, l) \ + __rw_wunlock_hard(&(rw)->rw_lock, t, f, l) +#define _rw_try_upgrade(rw, f, l) \ + __rw_try_upgrade(&(rw)->rw_lock, f, l) +#define _rw_downgrade(rw, f, l) \ + __rw_downgrade(&(rw)->rw_lock, f, l) #if defined(INVARIANTS) || defined(INVARIANT_SUPPORT) -void _rw_assert(const struct rwlock *rw, int what, const char *file, int line); +#define _rw_assert(rw, w, f, l) \ + __rw_assert(&(rw)->rw_lock, w, f, l) #endif + /* * Public interface for lock operations. */ @@ -178,12 +216,12 @@ void _rw_assert(const struct rwlock *rw, #define rw_initialized(rw) lock_initalized(&(rw)->lock_object) struct rw_args { - struct rwlock *ra_rw; + void *ra_rw; const char *ra_desc; }; struct rw_args_flags { - struct rwlock *ra_rw; + void *ra_rw; const char *ra_desc; int ra_flags; }; @@ -196,7 +234,7 @@ struct rw_args_flags { SYSINIT(name##_rw_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rw_sysinit, &name##_args); \ SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - rw_destroy, (rw)) + _rw_destroy, __DEVOLATILE(void *, &(rw)->rw_lock)) #define RW_SYSINIT_FLAGS(name, rw, desc, flags) \ @@ -208,7 +246,7 @@ struct rw_args_flags { SYSINIT(name##_rw_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ rw_sysinit_flags, &name##_args); \ SYSUNINIT(name##_rw_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, \ - rw_destroy, (rw)) + _rw_destroy, __DEVOLATILE(void *, &(rw)->rw_lock)) /* * Options passed to rw_init_flags(). From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:12:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id BEDFAA0E; Sat, 3 Nov 2012 18:12:55 +0000 (UTC) (envelope-from ambrisko@ambrisko.com) Received: from mail.ambrisko.com (mail.ambrisko.com [70.91.206.90]) by mx1.freebsd.org (Postfix) with ESMTP id BDDA78FC0C; Sat, 3 Nov 2012 18:12:54 +0000 (UTC) X-Ambrisko-Me: Yes Received: from server2.ambrisko.com (HELO internal.ambrisko.com) ([192.168.1.2]) by ironport.ambrisko.com with ESMTP; 03 Nov 2012 11:13:02 -0700 Received: from ambrisko.com (localhost [127.0.0.1]) by internal.ambrisko.com (8.14.4/8.14.4) with ESMTP id qA3IBick061932; Sat, 3 Nov 2012 11:11:44 -0700 (PDT) (envelope-from ambrisko@ambrisko.com) Received: (from ambrisko@localhost) by ambrisko.com (8.14.4/8.14.4/Submit) id qA3IBiF2061931; Sat, 3 Nov 2012 11:11:44 -0700 (PDT) (envelope-from ambrisko) Date: Sat, 3 Nov 2012 11:11:44 -0700 From: Doug Ambrisko To: Xin LI Subject: Re: svn commit: r242497 - head/sys/dev/mfi Message-ID: <20121103181144.GA60979@ambrisko.com> References: <201211022207.qA2M7jU2012024@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201211022207.qA2M7jU2012024@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:12:55 -0000 FWIW, I also have a fix for this and use the same function for mfi_tbolt.c. It also has a bunch of other fixes. However, I need to merge up to this code. It could use some testing on various cards etc. Thanks, Doug A. On Fri, Nov 02, 2012 at 10:07:45PM +0000, Xin LI wrote: | Author: delphij | Date: Fri Nov 2 22:07:45 2012 | New Revision: 242497 | URL: http://svn.freebsd.org/changeset/base/242497 | | Log: | Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI | command properly. Without this change, mfi(4) always sends 10 byte READ | and WRITE commands, which will cause data corruption when device is | larger than 2^32 sectors. | | PR: kern/173291 | Submitted by: Steven Hartland | Reviewed by: mav | MFC after: 2 weeks | | Modified: | head/sys/dev/mfi/mfi.c | | Modified: head/sys/dev/mfi/mfi.c | ============================================================================== | --- head/sys/dev/mfi/mfi.c Fri Nov 2 22:03:39 2012 (r242496) | +++ head/sys/dev/mfi/mfi.c Fri Nov 2 22:07:45 2012 (r242497) | @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru | static struct mfi_command * mfi_bio_command(struct mfi_softc *); | static void mfi_bio_complete(struct mfi_command *); | static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); | +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, | + uint64_t lba, uint8_t byte2, int readop); | static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct bio*); | static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); | static int mfi_abort(struct mfi_softc *, struct mfi_command *); | @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) | mfi_enqueue_bio(sc, bio); | return cm; | } | + | +static int | +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, | + uint64_t lba, uint8_t byte2, int readop) | +{ | + int cdb_len; | + | + if (((lba & 0x1fffff) == lba) | + && ((block_count & 0xff) == block_count) | + && (byte2 == 0)) { | + /* We can fit in a 6 byte cdb */ | + struct scsi_rw_6 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; | + scsi_ulto3b(lba, scsi_cmd->addr); | + scsi_cmd->length = block_count & 0xff; | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else if (((block_count & 0xffff) == block_count) && ((lba & 0xffffffff) == lba)) { | + /* Need a 10 byte CDB */ | + struct scsi_rw_10 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; | + scsi_cmd->byte2 = byte2; | + scsi_ulto4b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto2b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else if (((block_count & 0xffffffff) == block_count) && | + ((lba & 0xffffffff) == lba)) { | + /* Block count is too big for 10 byte CDB use a 12 byte CDB */ | + struct scsi_rw_12 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; | + scsi_cmd->byte2 = byte2; | + scsi_ulto4b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto4b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } else { | + /* | + * 16 byte CDB. We'll only get here if the LBA is larger | + * than 2^32 | + */ | + struct scsi_rw_16 *scsi_cmd; | + | + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; | + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; | + scsi_cmd->byte2 = byte2; | + scsi_u64to8b(lba, scsi_cmd->addr); | + scsi_cmd->reserved = 0; | + scsi_ulto4b(block_count, scsi_cmd->length); | + scsi_cmd->control = 0; | + cdb_len = sizeof(*scsi_cmd); | + } | + | + return cdb_len; | +} | + | static struct mfi_command * | mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) | { | struct mfi_command *cm; | struct mfi_pass_frame *pass; | - int flags = 0, blkcount = 0; | - uint32_t context = 0; | + int flags = 0; | + uint8_t cdb_len; | + uint32_t block_count, context = 0; | | if ((cm = mfi_dequeue_free(sc)) == NULL) | return (NULL); | @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, | pass->header.cmd = MFI_CMD_PD_SCSI_IO; | switch (bio->bio_cmd & 0x03) { | case BIO_READ: | -#define SCSI_READ 0x28 | - pass->cdb[0] = SCSI_READ; | flags = MFI_CMD_DATAIN; | break; | case BIO_WRITE: | -#define SCSI_WRITE 0x2a | - pass->cdb[0] = SCSI_WRITE; | flags = MFI_CMD_DATAOUT; | break; | default: | - panic("Invalid bio command"); | + /* TODO: what about BIO_DELETE??? */ | + panic("Unsupported bio command"); | } | | /* Cheat with the sector length to avoid a non-constant division */ | - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; | + block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; | /* Fill the LBA and Transfer length in CDB */ | - pass->cdb[2] = (bio->bio_pblkno & 0xff000000) >> 24; | - pass->cdb[3] = (bio->bio_pblkno & 0x00ff0000) >> 16; | - pass->cdb[4] = (bio->bio_pblkno & 0x0000ff00) >> 8; | - pass->cdb[5] = bio->bio_pblkno & 0x000000ff; | - pass->cdb[7] = (blkcount & 0xff00) >> 8; | - pass->cdb[8] = (blkcount & 0x00ff); | + cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, 0, | + flags == MFI_CMD_DATAIN); | + | pass->header.target_id = (uintptr_t)bio->bio_driver1; | pass->header.timeout = 0; | pass->header.flags = 0; | pass->header.scsi_status = 0; | pass->header.sense_len = MFI_SENSE_LEN; | pass->header.data_len = bio->bio_bcount; | - pass->header.cdb_len = 10; | + pass->header.cdb_len = cdb_len; | pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; | pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); | cm->cm_complete = mfi_bio_complete; | @@ -2048,7 +2109,8 @@ mfi_build_ldio(struct mfi_softc *sc, str | { | struct mfi_io_frame *io; | struct mfi_command *cm; | - int flags, blkcount; | + int flags; | + uint32_t blkcount; | uint32_t context = 0; | | if ((cm = mfi_dequeue_free(sc)) == NULL) | @@ -2069,7 +2131,8 @@ mfi_build_ldio(struct mfi_softc *sc, str | flags = MFI_CMD_DATAOUT; | break; | default: | - panic("Invalid bio command"); | + /* TODO: what about BIO_DELETE??? */ | + panic("Unsupported bio command"); | } | | /* Cheat with the sector length to avoid a non-constant division */ | @@ -2460,7 +2523,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * | struct mfi_command *cm; | struct mfi_pass_frame *pass; | int error; | - int blkcount = 0; | + uint32_t blkcount; | | if ((cm = mfi_dequeue_free(sc)) == NULL) | return (EBUSY); | @@ -2468,21 +2531,14 @@ mfi_dump_syspd_blocks(struct mfi_softc * | pass = &cm->cm_frame->pass; | bzero(pass->cdb, 16); | pass->header.cmd = MFI_CMD_PD_SCSI_IO; | - pass->cdb[0] = SCSI_WRITE; | - pass->cdb[2] = (lba & 0xff000000) >> 24; | - pass->cdb[3] = (lba & 0x00ff0000) >> 16; | - pass->cdb[4] = (lba & 0x0000ff00) >> 8; | - pass->cdb[5] = (lba & 0x000000ff); | blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; | - pass->cdb[7] = (blkcount & 0xff00) >> 8; | - pass->cdb[8] = (blkcount & 0x00ff); | pass->header.target_id = id; | pass->header.timeout = 0; | pass->header.flags = 0; | pass->header.scsi_status = 0; | pass->header.sense_len = MFI_SENSE_LEN; | pass->header.data_len = len; | - pass->header.cdb_len = 10; | + pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, 0); | pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; | pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> 32); | cm->cm_data = virt; From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:23:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F3638E16; Sat, 3 Nov 2012 18:23:43 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 68E658FC08; Sat, 3 Nov 2012 18:23:43 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fw7so6244493vcb.13 for ; Sat, 03 Nov 2012 11:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=nerh7rUrJXYQ+b3CUMzk3aVv/lwxzfXHFgj0Wvt79NA=; b=PAra1f8urjKpB71F7Wmapdy//134oP64qwT6bdQ6SmYYSas/Q6r3Xk2BiDAJAjY2rP yTV5Lv7FzmzobPvbHfWkiujWGoYx6GcK8enAk/o9WUboXmEKqYY7kQeO+BHpocNAfESn lrhTJwtKMFaePxGqbmGCBax4+fSjN+PcR4p/omUbqaf9CD+Mui+cOEfap7WsIpOjcMsX lRC5Mu0OrG6ERyGFZknEKZoqVP0nLw78lMrKKMoioqwCP53nq88HCndeUY8WLR/UCpod UYQ5+AW2eAqw9tvg99AQx+DE6VCGOefC+ZHrysLvxM+h8VS+nQkhJC0PkUWK4KKWV8u/ cmww== MIME-Version: 1.0 Received: by 10.220.148.134 with SMTP id p6mr5054858vcv.3.1351967022469; Sat, 03 Nov 2012 11:23:42 -0700 (PDT) Received: by 10.58.207.114 with HTTP; Sat, 3 Nov 2012 11:23:42 -0700 (PDT) In-Reply-To: <201211022207.qA2M7jU2012024@svn.freebsd.org> References: <201211022207.qA2M7jU2012024@svn.freebsd.org> Date: Sat, 3 Nov 2012 14:23:42 -0400 Message-ID: Subject: Re: svn commit: r242497 - head/sys/dev/mfi From: Ryan Stone To: Xin LI Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:23:44 -0000 Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? On Fri, Nov 2, 2012 at 6:07 PM, Xin LI wrote: > Author: delphij > Date: Fri Nov 2 22:07:45 2012 > New Revision: 242497 > URL: http://svn.freebsd.org/changeset/base/242497 > > Log: > Copy code from scsi_read_write() as mfi_build_syspd_cdb() to build SCSI > command properly. Without this change, mfi(4) always sends 10 byte READ > and WRITE commands, which will cause data corruption when device is > larger than 2^32 sectors. > > PR: kern/173291 > Submitted by: Steven Hartland > Reviewed by: mav > MFC after: 2 weeks > > Modified: > head/sys/dev/mfi/mfi.c > > Modified: head/sys/dev/mfi/mfi.c > > ============================================================================== > --- head/sys/dev/mfi/mfi.c Fri Nov 2 22:03:39 2012 (r242496) > +++ head/sys/dev/mfi/mfi.c Fri Nov 2 22:07:45 2012 (r242497) > @@ -106,6 +106,8 @@ static void mfi_add_sys_pd_complete(stru > static struct mfi_command * mfi_bio_command(struct mfi_softc *); > static void mfi_bio_complete(struct mfi_command *); > static struct mfi_command *mfi_build_ldio(struct mfi_softc *,struct bio*); > +static int mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t > block_count, > + uint64_t lba, uint8_t byte2, int readop); > static struct mfi_command *mfi_build_syspdio(struct mfi_softc *,struct > bio*); > static int mfi_send_frame(struct mfi_softc *, struct mfi_command *); > static int mfi_abort(struct mfi_softc *, struct mfi_command *); > @@ -1982,13 +1984,78 @@ mfi_bio_command(struct mfi_softc *sc) > mfi_enqueue_bio(sc, bio); > return cm; > } > + > +static int > +mfi_build_syspd_cdb(struct mfi_pass_frame *pass, uint32_t block_count, > + uint64_t lba, uint8_t byte2, int readop) > +{ > + int cdb_len; > + > + if (((lba & 0x1fffff) == lba) > + && ((block_count & 0xff) == block_count) > + && (byte2 == 0)) { > + /* We can fit in a 6 byte cdb */ > + struct scsi_rw_6 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_6 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_6 : WRITE_6; > + scsi_ulto3b(lba, scsi_cmd->addr); > + scsi_cmd->length = block_count & 0xff; > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else if (((block_count & 0xffff) == block_count) && ((lba & > 0xffffffff) == lba)) { > + /* Need a 10 byte CDB */ > + struct scsi_rw_10 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_10 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_10 : WRITE_10; > + scsi_cmd->byte2 = byte2; > + scsi_ulto4b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto2b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else if (((block_count & 0xffffffff) == block_count) && > + ((lba & 0xffffffff) == lba)) { > + /* Block count is too big for 10 byte CDB use a 12 byte > CDB */ > + struct scsi_rw_12 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_12 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_12 : WRITE_12; > + scsi_cmd->byte2 = byte2; > + scsi_ulto4b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto4b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } else { > + /* > + * 16 byte CDB. We'll only get here if the LBA is larger > + * than 2^32 > + */ > + struct scsi_rw_16 *scsi_cmd; > + > + scsi_cmd = (struct scsi_rw_16 *)&pass->cdb; > + scsi_cmd->opcode = readop ? READ_16 : WRITE_16; > + scsi_cmd->byte2 = byte2; > + scsi_u64to8b(lba, scsi_cmd->addr); > + scsi_cmd->reserved = 0; > + scsi_ulto4b(block_count, scsi_cmd->length); > + scsi_cmd->control = 0; > + cdb_len = sizeof(*scsi_cmd); > + } > + > + return cdb_len; > +} > + > static struct mfi_command * > mfi_build_syspdio(struct mfi_softc *sc, struct bio *bio) > { > struct mfi_command *cm; > struct mfi_pass_frame *pass; > - int flags = 0, blkcount = 0; > - uint32_t context = 0; > + int flags = 0; > + uint8_t cdb_len; > + uint32_t block_count, context = 0; > > if ((cm = mfi_dequeue_free(sc)) == NULL) > return (NULL); > @@ -2002,35 +2069,29 @@ mfi_build_syspdio(struct mfi_softc *sc, > pass->header.cmd = MFI_CMD_PD_SCSI_IO; > switch (bio->bio_cmd & 0x03) { > case BIO_READ: > -#define SCSI_READ 0x28 > - pass->cdb[0] = SCSI_READ; > flags = MFI_CMD_DATAIN; > break; > case BIO_WRITE: > -#define SCSI_WRITE 0x2a > - pass->cdb[0] = SCSI_WRITE; > flags = MFI_CMD_DATAOUT; > break; > default: > - panic("Invalid bio command"); > + /* TODO: what about BIO_DELETE??? */ > + panic("Unsupported bio command"); > } > > /* Cheat with the sector length to avoid a non-constant division */ > - blkcount = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; > + block_count = (bio->bio_bcount + MFI_SECTOR_LEN - 1) / > MFI_SECTOR_LEN; > /* Fill the LBA and Transfer length in CDB */ > - pass->cdb[2] = (bio->bio_pblkno & 0xff000000) >> 24; > - pass->cdb[3] = (bio->bio_pblkno & 0x00ff0000) >> 16; > - pass->cdb[4] = (bio->bio_pblkno & 0x0000ff00) >> 8; > - pass->cdb[5] = bio->bio_pblkno & 0x000000ff; > - pass->cdb[7] = (blkcount & 0xff00) >> 8; > - pass->cdb[8] = (blkcount & 0x00ff); > + cdb_len = mfi_build_syspd_cdb(pass, block_count, bio->bio_pblkno, > 0, > + flags == MFI_CMD_DATAIN); > + > pass->header.target_id = (uintptr_t)bio->bio_driver1; > pass->header.timeout = 0; > pass->header.flags = 0; > pass->header.scsi_status = 0; > pass->header.sense_len = MFI_SENSE_LEN; > pass->header.data_len = bio->bio_bcount; > - pass->header.cdb_len = 10; > + pass->header.cdb_len = cdb_len; > pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; > pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> > 32); > cm->cm_complete = mfi_bio_complete; > @@ -2048,7 +2109,8 @@ mfi_build_ldio(struct mfi_softc *sc, str > { > struct mfi_io_frame *io; > struct mfi_command *cm; > - int flags, blkcount; > + int flags; > + uint32_t blkcount; > uint32_t context = 0; > > if ((cm = mfi_dequeue_free(sc)) == NULL) > @@ -2069,7 +2131,8 @@ mfi_build_ldio(struct mfi_softc *sc, str > flags = MFI_CMD_DATAOUT; > break; > default: > - panic("Invalid bio command"); > + /* TODO: what about BIO_DELETE??? */ > + panic("Unsupported bio command"); > } > > /* Cheat with the sector length to avoid a non-constant division */ > @@ -2460,7 +2523,7 @@ mfi_dump_syspd_blocks(struct mfi_softc * > struct mfi_command *cm; > struct mfi_pass_frame *pass; > int error; > - int blkcount = 0; > + uint32_t blkcount; > > if ((cm = mfi_dequeue_free(sc)) == NULL) > return (EBUSY); > @@ -2468,21 +2531,14 @@ mfi_dump_syspd_blocks(struct mfi_softc * > pass = &cm->cm_frame->pass; > bzero(pass->cdb, 16); > pass->header.cmd = MFI_CMD_PD_SCSI_IO; > - pass->cdb[0] = SCSI_WRITE; > - pass->cdb[2] = (lba & 0xff000000) >> 24; > - pass->cdb[3] = (lba & 0x00ff0000) >> 16; > - pass->cdb[4] = (lba & 0x0000ff00) >> 8; > - pass->cdb[5] = (lba & 0x000000ff); > blkcount = (len + MFI_SECTOR_LEN - 1) / MFI_SECTOR_LEN; > - pass->cdb[7] = (blkcount & 0xff00) >> 8; > - pass->cdb[8] = (blkcount & 0x00ff); > pass->header.target_id = id; > pass->header.timeout = 0; > pass->header.flags = 0; > pass->header.scsi_status = 0; > pass->header.sense_len = MFI_SENSE_LEN; > pass->header.data_len = len; > - pass->header.cdb_len = 10; > + pass->header.cdb_len = mfi_build_syspd_cdb(pass, blkcount, lba, 0, > 0); > pass->sense_addr_lo = (uint32_t)cm->cm_sense_busaddr; > pass->sense_addr_hi = (uint32_t)((uint64_t)cm->cm_sense_busaddr >> > 32); > cm->cm_data = virt; > From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:36:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2558B24F for ; Sat, 3 Nov 2012 18:36:30 +0000 (UTC) (envelope-from peter@wemm.org) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8EB0D8FC08 for ; Sat, 3 Nov 2012 18:36:29 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id e12so4118028lag.13 for ; Sat, 03 Nov 2012 11:36:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wemm.org; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=wu93iaV2diYBNiFBJ/QcV8M5wiPNo2NL/YTjQ/P5Z9E=; b=kJ6F4EhYMxUd9tDkNAyXGNt5SZPX3GPoLAkl/p9zpNAwDOO9+sdYWBuyGpDeWqVCz8 vsARFduLOMTuB+m1kmssSOMAyI3x1FPQvvVxMimldAE7AwFunFIHi7+bkPHMgk0wi6js /+gSssL46h2MNdtFJDqaref3cWNnhwkC+rjt4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:x-gm-message-state; bh=wu93iaV2diYBNiFBJ/QcV8M5wiPNo2NL/YTjQ/P5Z9E=; b=YOs8ZMs+7MiU46spKBASUHSMbz9hwVYiYDpVHMFI1h03tlDFlT10zsolqe/J0R+7Ez gmSrRomSH04ryUWuEQYgi3orOM560ZbUfz7FDKvpVrTTJ5rN6MQZreNjUAydBK9L6CWf Aq9wFEmqo0+9YxuY5JeLZMd64s5ScCEtgPqmmuXrW7YulK1NAOnuvOHR6JeF/NeUh1g7 MJFZlzOKoUChk1Ang174em4ukbhegrofMtYm3kDLGcxnVQMMVWBc6x5LjLL43BGcFDDk p6Sfe1VrmhkEr9+/QK66CQTXW4UPh/uH73RXUJtoTGKVWLhUh3vYuiUdGxoLWM+93lwu T2xA== MIME-Version: 1.0 Received: by 10.152.110.42 with SMTP id hx10mr4904408lab.0.1351967787455; Sat, 03 Nov 2012 11:36:27 -0700 (PDT) Received: by 10.112.100.230 with HTTP; Sat, 3 Nov 2012 11:36:27 -0700 (PDT) In-Reply-To: References: <201211022207.qA2M7jU2012024@svn.freebsd.org> Date: Sat, 3 Nov 2012 11:36:27 -0700 Message-ID: Subject: Re: svn commit: r242497 - head/sys/dev/mfi From: Peter Wemm To: Ryan Stone Content-Type: text/plain; charset=ISO-8859-1 X-Gm-Message-State: ALoCoQlW5h+oOkagS6MkFR+iML0Y5mddsMWrCrD4e80MG/nAZYBa7bZTSgWoIKj/T2HFFgHBIsBm Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:36:30 -0000 On Sat, Nov 3, 2012 at 11:23 AM, Ryan Stone wrote: > Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? The commit message didn't spell it out, but the PR is titled: ">Synopsis: mfi corrupts JBOD disks >2TB due to LBA overflow" -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV "All of this is for nothing if we don't go to the stars" - JMS/B5 "If Java had true garbage collection, most programs would delete themselves upon execution." -- Robert Sewell From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:38:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E4F5B3E4; Sat, 3 Nov 2012 18:38:28 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC5A98FC14; Sat, 3 Nov 2012 18:38:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3IcSDk021857; Sat, 3 Nov 2012 18:38:28 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3IcSUR021854; Sat, 3 Nov 2012 18:38:28 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201211031838.qA3IcSUR021854@svn.freebsd.org> From: Xin LI Date: Sat, 3 Nov 2012 18:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242519 - head/usr.sbin/watchdogd X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:38:29 -0000 Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: 242519 URL: http://svn.freebsd.org/changeset/base/242519 Log: Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. MFC after: 2 weeks Modified: head/usr.sbin/watchdogd/Makefile head/usr.sbin/watchdogd/watchdogd.c Modified: head/usr.sbin/watchdogd/Makefile ============================================================================== --- head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:21:32 2012 (r242518) +++ head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:38:28 2012 (r242519) @@ -4,8 +4,8 @@ PROG= watchdogd LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog MAN= watchdogd.8 watchdog.8 -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil +DPADD= ${LIBUTIL} .include Modified: head/usr.sbin/watchdogd/watchdogd.c ============================================================================== --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 (r242518) +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 (r242519) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) if (a == 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + log(a * 1e9) / log(2.0); + timeout = flsll(a * 1e9); if (debugging) printf("Timeout is 2^%d nanoseconds\n", timeout); From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:46:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 07510800; Sat, 3 Nov 2012 18:46:23 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id AC55D8FC0C; Sat, 3 Nov 2012 18:46:22 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA3IkL1Q037561; Sat, 3 Nov 2012 12:46:22 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA3IjxuD010140; Sat, 3 Nov 2012 12:45:59 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242519 - head/usr.sbin/watchdogd From: Ian Lepore To: Xin LI In-Reply-To: <201211031838.qA3IcSUR021854@svn.freebsd.org> References: <201211031838.qA3IcSUR021854@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sat, 03 Nov 2012 12:45:59 -0600 Message-ID: <1351968359.1120.106.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:46:23 -0000 On Sat, 2012-11-03 at 18:38 +0000, Xin LI wrote: > Author: delphij > Date: Sat Nov 3 18:38:28 2012 > New Revision: 242519 > URL: http://svn.freebsd.org/changeset/base/242519 > > Log: > Replace log(3) with flsll(3) for watchdogd(8) and drop libm dependency. > > MFC after: 2 weeks > > Modified: > head/usr.sbin/watchdogd/Makefile > head/usr.sbin/watchdogd/watchdogd.c > > Modified: head/usr.sbin/watchdogd/Makefile > ============================================================================== > --- head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:21:32 2012 (r242518) > +++ head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:38:28 2012 (r242519) > @@ -4,8 +4,8 @@ PROG= watchdogd > LINKS= ${BINDIR}/watchdogd ${BINDIR}/watchdog > MAN= watchdogd.8 watchdog.8 > > -LDADD= -lm -lutil > -DPADD= ${LIBM} ${LIBUTIL} > +LDADD= -lutil > +DPADD= ${LIBUTIL} > > .include > > > Modified: head/usr.sbin/watchdogd/watchdogd.c > ============================================================================== > --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 (r242518) > +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 (r242519) > @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > > @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) > if (a == 0) > timeout = WD_TO_NEVER; > else > - timeout = 1.0 + log(a * 1e9) / log(2.0); > + timeout = flsll(a * 1e9); > if (debugging) > printf("Timeout is 2^%d nanoseconds\n", > timeout); Shouldn't we also change the type of the variable 'a' from double to int64 (and the strtod() and the 1e9 constant), thus removing all dregs of floating point where it isn't really needed? (Sorry, but 20 years of working on wimpy embedded systems without FP hardware just make me blurt out these things automatically). -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:55:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 99CF3D41; Sat, 3 Nov 2012 18:55:56 +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 816008FC15; Sat, 3 Nov 2012 18:55:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3Itugk024812; Sat, 3 Nov 2012 18:55:56 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3Ituxr024809; Sat, 3 Nov 2012 18:55:56 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201211031855.qA3Ituxr024809@svn.freebsd.org> From: Kirk McKusick Date: Sat, 3 Nov 2012 18:55:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242520 - head/sys/ufs/ffs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:55:56 -0000 Author: mckusick Date: Sat Nov 3 18:55:55 2012 New Revision: 242520 URL: http://svn.freebsd.org/changeset/base/242520 Log: When a file is first being written, the dynamic block reallocation (implemented by ffs_reallocblks_ufs[12]) relocates the file's blocks so as to cluster them together into a contiguous set of blocks on the disk. When the cluster crosses the boundary into the first indirect block, the first indirect block is initially allocated in a position immediately following the last direct block. Block reallocation would usually destroy locality by moving the indirect block out of the way to keep the data blocks contiguous. This change compensates for this problem by noting that the first indirect block should be left immediately following the last direct block. It then tries to start a new cluster of contiguous blocks (referenced by the indirect block) immediately following the indirect block. We should also do this for other indirect block boundaries, but it is only important for the first one. Suggested by: Bruce Evans MFC: 2 weeks Modified: head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/ffs_balloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_alloc.c Sat Nov 3 18:38:28 2012 (r242519) +++ head/sys/ufs/ffs/ffs_alloc.c Sat Nov 3 18:55:55 2012 (r242520) @@ -535,6 +535,18 @@ ffs_reallocblks_ufs1(ap) panic("ffs_reallocblks: non-physical cluster %d", i); #endif /* + * If the cluster crosses the boundary for the first indirect + * block, leave space for the indirect block. Indirect blocks + * are initially laid out in a position after the last direct + * block. Block reallocation would usually destroy locality by + * moving the indirect block out of the way to make room for + * data blocks if we didn't compensate here. We should also do + * this for other indirect block boundaries, but it is only + * important for the first one. + */ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. @@ -744,6 +756,18 @@ ffs_reallocblks_ufs2(ap) panic("ffs_reallocblks: non-physical cluster %d", i); #endif /* + * If the cluster crosses the boundary for the first indirect + * block, do not move anything in it. Indirect blocks are + * usually initially laid out in a position between the data + * blocks. Block reallocation would usually destroy locality by + * moving the indirect block out of the way to make room for + * data blocks if we didn't compensate here. We should also do + * this for other indirect block boundaries, but it is only + * important for the first one. + */ + if (start_lbn < NDADDR && end_lbn >= NDADDR) + return (ENOSPC); + /* * If the latest allocation is in a new cylinder group, assume that * the filesystem has decided to move and do not force it back to * the previous cylinder group. @@ -791,6 +815,15 @@ ffs_reallocblks_ufs2(ap) UFS_LOCK(ump); pref = ffs_blkpref_ufs2(ip, start_lbn, soff, sbap); /* + * Skip a block for the first indirect block. Indirect blocks are + * usually initially laid out in a good position between the data + * blocks, but block reallocation would usually destroy locality by + * moving them out of the way to make room for data blocks if we + * didn't compensate here. + */ + if (start_lbn == NDADDR) + pref += fs->fs_frag; + /* * Search the block map looking for an allocation of the desired size. */ if ((newblk = ffs_hashalloc(ip, dtog(fs, pref), pref, @@ -1185,9 +1218,25 @@ ffs_blkpref_ufs1(ip, lbn, indx, bap) struct fs *fs; u_int cg; u_int avgbfree, startcg; + ufs2_daddr_t pref; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); fs = ip->i_fs; + /* + * If we are allocating the first indirect block, try to place it + * immediately following the last direct block. + * + * If we are allocating the first data block in the first indirect + * block, try to place it immediately following the indirect block. + */ + if (lbn == NDADDR) { + pref = ip->i_din1->di_db[NDADDR - 1]; + if (bap == NULL && pref != 0) + return (pref + fs->fs_frag); + pref = ip->i_din1->di_ib[0]; + if (pref != 0) + return (pref + fs->fs_frag); + } if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { if (lbn < NDADDR + NINDIR(fs)) { cg = ino_to_cg(fs, ip->i_number); @@ -1235,9 +1284,25 @@ ffs_blkpref_ufs2(ip, lbn, indx, bap) struct fs *fs; u_int cg; u_int avgbfree, startcg; + ufs2_daddr_t pref; mtx_assert(UFS_MTX(ip->i_ump), MA_OWNED); fs = ip->i_fs; + /* + * If we are allocating the first indirect block, try to place it + * immediately following the last direct block. + * + * If we are allocating the first data block in the first indirect + * block, try to place it immediately following the indirect block. + */ + if (lbn == NDADDR) { + pref = ip->i_din1->di_db[NDADDR - 1]; + if (bap == NULL && pref != 0) + return (pref + fs->fs_frag); + pref = ip->i_din1->di_ib[0]; + if (pref != 0) + return (pref + fs->fs_frag); + } if (indx % fs->fs_maxbpg == 0 || bap[indx - 1] == 0) { if (lbn < NDADDR + NINDIR(fs)) { cg = ino_to_cg(fs, ip->i_number); Modified: head/sys/ufs/ffs/ffs_balloc.c ============================================================================== --- head/sys/ufs/ffs/ffs_balloc.c Sat Nov 3 18:38:28 2012 (r242519) +++ head/sys/ufs/ffs/ffs_balloc.c Sat Nov 3 18:55:55 2012 (r242520) @@ -251,6 +251,7 @@ ffs_balloc_ufs1(struct vnode *vp, off_t curthread_pflags_restore(saved_inbdflush); return (error); } + pref = newb + fs->fs_frag; nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; @@ -315,6 +316,7 @@ retry: } goto fail; } + pref = newb + fs->fs_frag; nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; @@ -363,7 +365,9 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, &bap[0]); + if (pref == 0) + pref = ffs_blkpref_ufs1(ip, lbn, indirs[i].in_off, + &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb); if (error) { @@ -789,6 +793,7 @@ ffs_balloc_ufs2(struct vnode *vp, off_t curthread_pflags_restore(saved_inbdflush); return (error); } + pref = newb + fs->fs_frag; nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[1].in_lbn; @@ -853,6 +858,7 @@ retry: } goto fail; } + pref = newb + fs->fs_frag; nb = newb; *allocblk++ = nb; *lbns_remfree++ = indirs[i].in_lbn; @@ -901,7 +907,9 @@ retry: */ if (nb == 0) { UFS_LOCK(ump); - pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, &bap[0]); + if (pref == 0) + pref = ffs_blkpref_ufs2(ip, lbn, indirs[i].in_off, + &bap[0]); error = ffs_alloc(ip, lbn, pref, (int)fs->fs_bsize, flags | IO_BUFLOCKED, cred, &newb); if (error) { From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 18:57:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EEFB3133; Sat, 3 Nov 2012 18:57:40 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF008FC08; Sat, 3 Nov 2012 18:57:40 +0000 (UTC) Received: by mail-vc0-f182.google.com with SMTP id fw7so6262784vcb.13 for ; Sat, 03 Nov 2012 11:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=/5a97NjE+71yfvN+jOs6iqp85VzBM9IYIpYi69hquz8=; b=IDHXNVlZ0jMKmXP/NOFn84jdzbgrM/9g8SZLvyoeE28UVF2Tti5QaJ+k4bh/L5b3tR LtXE+128tU8hnhhN++bjfiwaSrq4agRVG0qVWrg2PxAUHu4XeKwRMRQyUHGB+/x2ZJkr g+maw7OAa7VaS88zg/LD76MKqerXUKqt6nznESSU/YU+xaRPItJwt9CXzg1Yc/Tn+VBu kYAjn1DNqR2MVPWxtMRdGmRZDGxyDJLOzsc42DbXVwBqvA6H0FLQ9CjQsLetlWLumxic vii1clqLokG1CPt+/7EiB7muR6ce6exH/xHfP2H3VPjZp+3UQ6lwMm0O1A97eYZHt0VS Bypg== MIME-Version: 1.0 Received: by 10.220.148.134 with SMTP id p6mr5105536vcv.3.1351969059846; Sat, 03 Nov 2012 11:57:39 -0700 (PDT) Received: by 10.58.207.114 with HTTP; Sat, 3 Nov 2012 11:57:39 -0700 (PDT) In-Reply-To: References: <201211022207.qA2M7jU2012024@svn.freebsd.org> Date: Sat, 3 Nov 2012 14:57:39 -0400 Message-ID: Subject: Re: svn commit: r242497 - head/sys/dev/mfi From: Ryan Stone To: Peter Wemm Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 18:57:41 -0000 I saw the thread that lead to the PR(hence my asking the question), but it wasn't clear to me whether the submitter had tried any RAID configurations. In any case, I have access to a box in my test lab with a multi-TB RAID array on an mfi controller, and I've confirmed that the bug does not exhibit itself there. Thank goodness. That would have ruined my whole month. Thanks everybody. On Sat, Nov 3, 2012 at 2:36 PM, Peter Wemm wrote: > On Sat, Nov 3, 2012 at 11:23 AM, Ryan Stone wrote: > > Does this apply to only to JBOD, or are RAID arrays > 2TB also affected? > > The commit message didn't spell it out, but the PR is titled: > ">Synopsis: mfi corrupts JBOD disks >2TB due to LBA overflow" > > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; > KI6FJV > "All of this is for nothing if we don't go to the stars" - JMS/B5 > "If Java had true garbage collection, most programs would delete > themselves upon execution." -- Robert Sewell > From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 19:26:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9096188C; Sat, 3 Nov 2012 19:26:09 +0000 (UTC) (envelope-from maxim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 772D88FC08; Sat, 3 Nov 2012 19:26:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3JQ9WK029722; Sat, 3 Nov 2012 19:26:09 GMT (envelope-from maxim@svn.freebsd.org) Received: (from maxim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3JQ97c029720; Sat, 3 Nov 2012 19:26:09 GMT (envelope-from maxim@svn.freebsd.org) Message-Id: <201211031926.qA3JQ97c029720@svn.freebsd.org> From: Maxim Konovalov Date: Sat, 3 Nov 2012 19:26:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242521 - head/share/misc X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 19:26:09 -0000 Author: maxim Date: Sat Nov 3 19:26:08 2012 New Revision: 242521 URL: http://svn.freebsd.org/changeset/base/242521 Log: o DragonFly 2.3.1 added. Modified: head/share/misc/bsd-family-tree Modified: head/share/misc/bsd-family-tree ============================================================================== --- head/share/misc/bsd-family-tree Sat Nov 3 18:55:55 2012 (r242520) +++ head/share/misc/bsd-family-tree Sat Nov 3 19:26:08 2012 (r242521) @@ -257,7 +257,7 @@ FreeBSD 5.2 | | | Mac OS X | | | | 10.8 | | | | | NetBSD 6.0 | | - | | | OpenBSD 5.2 | + | | | OpenBSD 5.2 DragonFly 3.2.1 | | | | | FreeBSD 10 -current | NetBSD -current OpenBSD -current | | | | | | @@ -554,6 +554,7 @@ OpenBSD 5.1 2012-05-01 [OBD] Mac OS X 10.8 2012-07-25 [APL] NetBSD 6.0 2012-10-17 [NBD] OpenBSD 5.2 2012-11-01 [OBD] +DragonFly 3.2.1 2012-11-02 [DFB] Bibliography ------------------------ From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 19:50:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 091CED2A; Sat, 3 Nov 2012 19:50:34 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id D92048FC19; Sat, 3 Nov 2012 19:50:33 +0000 (UTC) Received: from Xins-MacBook-Pro.local (nat-dip5.cfw-a-gci.corp.yahoo.com [209.131.62.114]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 64CD721139; Sat, 3 Nov 2012 12:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1351972233; bh=YYz6dh/3jsAoI9H26s+cgiuX0MOPO+5vXyE1NC4Ta9c=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=xu01rb1GiF9HmEDbtsQtYAZR0eDnSC2FaiM/yK/71QjDpTBAP34KyY/twHMRvbHpb BQYE5wk5lvODbA7dM3erBpxv9Dmy/D8ZvxUKJ+re/B2zfo0rBrvQU5i7hBS1FxcJlP S5P+kV2Op3UqljFBKVQAaZSKBav3bjwyTSxOK+FA= Message-ID: <50957588.5070504@delphij.net> Date: Sat, 03 Nov 2012 12:50:32 -0700 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r242519 - head/usr.sbin/watchdogd References: <201211031838.qA3IcSUR021854@svn.freebsd.org> <1351968359.1120.106.camel@revolution.hippie.lan> In-Reply-To: <1351968359.1120.106.camel@revolution.hippie.lan> X-Enigmail-Version: 1.4.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 19:50:34 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 11/3/12 11:45 AM, Ian Lepore wrote: > On Sat, 2012-11-03 at 18:38 +0000, Xin LI wrote: >> Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: >> 242519 URL: http://svn.freebsd.org/changeset/base/242519 >> >> Log: Replace log(3) with flsll(3) for watchdogd(8) and drop libm >> dependency. >> >> MFC after: 2 weeks >> >> Modified: head/usr.sbin/watchdogd/Makefile >> head/usr.sbin/watchdogd/watchdogd.c >> >> Modified: head/usr.sbin/watchdogd/Makefile >> ============================================================================== >> >> - --- head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:21:32 2012 (r242518) >> +++ head/usr.sbin/watchdogd/Makefile Sat Nov 3 18:38:28 2012 >> (r242519) @@ -4,8 +4,8 @@ PROG= watchdogd LINKS= >> ${BINDIR}/watchdogd ${BINDIR}/watchdog MAN= watchdogd.8 >> watchdog.8 >> >> -LDADD= -lm -lutil -DPADD= ${LIBM} ${LIBUTIL} +LDADD= -lutil >> +DPADD= ${LIBUTIL} >> >> .include >> >> >> Modified: head/usr.sbin/watchdogd/watchdogd.c >> ============================================================================== >> >> - --- head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:21:32 2012 (r242518) >> +++ head/usr.sbin/watchdogd/watchdogd.c Sat Nov 3 18:38:28 2012 >> (r242519) @@ -48,6 +48,7 @@ __FBSDID("$FreeBSD$"); #include >> #include #include +#include >> #include #include >> >> @@ -280,7 +281,7 @@ parseargs(int argc, char *argv[]) if (a == >> 0) timeout = WD_TO_NEVER; else - timeout = 1.0 + log(a * 1e9) >> / log(2.0); + timeout = flsll(a * 1e9); if (debugging) >> printf("Timeout is 2^%d nanoseconds\n", timeout); > > Shouldn't we also change the type of the variable 'a' from double > to int64 (and the strtod() and the 1e9 constant), thus removing all > dregs of floating point where it isn't really needed? (Sorry, but > 20 years of working on wimpy embedded systems without FP hardware > just make me blurt out these things automatically). While it do make sense in practical (in my opinion), I think that would lose functionality because the watchdog can be programmed in a manner that timeout is set to smaller than 1 second (not for the demonized case). Maybe we can make it an build option? Index: Makefile =================================================================== - --- Makefile (revision 242519) +++ Makefile (working copy) @@ -7,7 +7,15 @@ MAN= watchdogd.8 watchdog.8 LDADD= -lutil DPADD= ${LIBUTIL} +.if defined(SMALL) +CFLAGS+= -DSMALL +.endif + .include test: ${PROG} +.if defined(SMALL) + ./${PROG} -t 1 +.else ./${PROG} -t 1.0 +.endif Index: watchdogd.c =================================================================== - --- watchdogd.c (revision 242519) +++ watchdogd.c (working copy) @@ -241,7 +241,11 @@ parseargs(int argc, char *argv[]) { int c; char *p; +#if defined(SMALL) + long a; +#else double a; +#endif c = strlen(argv[0]); if (argv[0][c - 1] == 'd') @@ -273,7 +277,11 @@ parseargs(int argc, char *argv[]) case 't': p = NULL; errno = 0; +#if defined(SMALL) + a = strtol(optarg, &p, 0); +#else a = strtod(optarg, &p); +#endif if ((p != NULL && *p != '\0') || errno != 0) errx(EX_USAGE, "-t argument is not a number"); if (a < 0) Cheers, -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQlXWIAAoJEG80Jeu8UPuzKiwIAMGknRDKiXIWLBL86ABfOZVU EkuT7u4S90hAlAyWdropISadgReRF3yenYPGM9oCHtoLLS5Ma2iLd8tMFqv76uxo 0nyqY7HpKRBcYfurYcVTcckrphQdD4DbviRPgBPsZ6/ClHN8Bkjc2Am6zSbzwM5C XZTNicX5/M4IqArYg5L8j3Z4WLo3HIG/oo1OMU+hP+vJT9vBIWK8ap9n3ajNz15p OjKNZXs88X0OaeqhO0Ayn2lGIxkDQ6OszYHi6UUQ7p1m3Op4ewx/SlrgEhDpzBY2 l643UHj/6IUfLUvahp1m82FEKelFYleoZ02scpgu951+che3+t03z9NFUFjl/OA= =UN3H -----END PGP SIGNATURE----- From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 20:16:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8931A2FE; Sat, 3 Nov 2012 20:16:58 +0000 (UTC) (envelope-from freebsd@damnhippie.dyndns.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id 4DB348FC0C; Sat, 3 Nov 2012 20:16:52 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.5/8.14.5) with ESMTP id qA3KGpi9040214; Sat, 3 Nov 2012 14:16:51 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id qA3KGTWF010204; Sat, 3 Nov 2012 14:16:29 -0600 (MDT) (envelope-from freebsd@damnhippie.dyndns.org) Subject: Re: svn commit: r242519 - head/usr.sbin/watchdogd From: Ian Lepore To: d@delphij.net In-Reply-To: <50957588.5070504@delphij.net> References: <201211031838.qA3IcSUR021854@svn.freebsd.org> <1351968359.1120.106.camel@revolution.hippie.lan> <50957588.5070504@delphij.net> Content-Type: text/plain; charset="us-ascii" Date: Sat, 03 Nov 2012 14:16:29 -0600 Message-ID: <1351973789.1120.122.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 20:16:58 -0000 On Sat, 2012-11-03 at 12:50 -0700, Xin Li wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA256 > > On 11/3/12 11:45 AM, Ian Lepore wrote: > > On Sat, 2012-11-03 at 18:38 +0000, Xin LI wrote: > >> Author: delphij Date: Sat Nov 3 18:38:28 2012 New Revision: > >> 242519 URL: http://svn.freebsd.org/changeset/base/242519 > > [...] > > Shouldn't we also change the type of the variable 'a' from double > > to int64 (and the strtod() and the 1e9 constant), thus removing all > > dregs of floating point where it isn't really needed? (Sorry, but > > 20 years of working on wimpy embedded systems without FP hardware > > just make me blurt out these things automatically). > > While it do make sense in practical (in my opinion), I think that > would lose functionality because the watchdog can be programmed in a > manner that timeout is set to smaller than 1 second (not for the > demonized case). Maybe we can make it an build option? > > Index: Makefile > =================================================================== > - --- Makefile (revision 242519) > +++ Makefile (working copy) > @@ -7,7 +7,15 @@ MAN= watchdogd.8 watchdog.8 > LDADD= -lutil > DPADD= ${LIBUTIL} > > +.if defined(SMALL) > +CFLAGS+= -DSMALL > +.endif > + > .include > > test: ${PROG} > +.if defined(SMALL) > + ./${PROG} -t 1 > +.else > ./${PROG} -t 1.0 > +.endif > Index: watchdogd.c > =================================================================== > - --- watchdogd.c (revision 242519) > +++ watchdogd.c (working copy) > @@ -241,7 +241,11 @@ parseargs(int argc, char *argv[]) > { > int c; > char *p; > +#if defined(SMALL) > + long a; > +#else > double a; > +#endif > > c = strlen(argv[0]); > if (argv[0][c - 1] == 'd') > @@ -273,7 +277,11 @@ parseargs(int argc, char *argv[]) > case 't': > p = NULL; > errno = 0; > +#if defined(SMALL) > + a = strtol(optarg, &p, 0); > +#else > a = strtod(optarg, &p); > +#endif > if ((p != NULL && *p != '\0') || errno != 0) > errx(EX_USAGE, "-t argument is not a > number"); > if (a < 0) > Oh. I remembered that < WD_TO_1SEC check and somehow completely forgot the is_daemon part and its implication; I just thought timeouts of less than 1 second weren't allowed. It's hard for me to imagine someone setting the timeout to less than 1 second, but if that's been a supported feature all along then we should probably just leave things as-is. Getting libm out of the picture was the big win, the remaining FP code is a pretty small thing. -- Ian From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 20:35:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E03388E; Sat, 3 Nov 2012 20:35:21 +0000 (UTC) (envelope-from bright@elvis.mu.org) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.freebsd.org (Postfix) with ESMTP id 681A18FC08; Sat, 3 Nov 2012 20:35:21 +0000 (UTC) Received: by elvis.mu.org (Postfix, from userid 1192) id 0CCA91A3C86; Sat, 3 Nov 2012 13:35:20 -0700 (PDT) Date: Sat, 3 Nov 2012 13:35:20 -0700 From: Alfred Perlstein To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242520 - head/sys/kern Message-ID: <201210250146.q9P1kLi8043704@svn.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i User-Agent: Mutt/1.4.2.3i X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 20:35:21 -0000 Author: alfred Date: Sat Nov 3 18:21:40 2012 New Revision: 242520 URL: http://svn.freebsd.org/changeset/base/242520 Log: Retire MAXUSERS. Approved by: peter, meetBSD Modified: head/sys/sparc64/sparc64/vm_machdep.c head/sys/netinet/ip_input.c head/sys/boot/forth/loader.conf head/sys/boot/common/loader.8 head/sys/sys/systm.h head/sys/powerpc/booke/vm_machdep.c head/sys/powerpc/aim/vm_machdep.c head/sys/arm/arm/vm_machdep.c head/sys/i386/i386/vm_machdep.c head/sys/netinet6/ip6_input.c head/sys/conf/makeLINT.sed head/sys/conf/options head/sys/conf/NOTES head/sys/net/flowtable.c head/sys/kern/kern_mib.c head/sys/kern/subr_param.c head/sys/kern/kern_mbuf.c head/sys/mips/conf/RT305X head/sys/mips/mips/vm_machdep.c Index: head/sys/sparc64/sparc64/vm_machdep.c =================================================================== --- head/sys/sparc64/sparc64/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/sparc64/sparc64/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -85,7 +85,7 @@ #include #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif static void sf_buf_init(void *arg); Index: head/sys/netinet/ip_input.c =================================================================== --- head/sys/netinet/ip_input.c (Sat Nov 3 18:21:32 2012) +++ head/sys/netinet/ip_input.c (Sat Nov 3 18:21:40 2012) @@ -315,7 +315,7 @@ /* * round up to the next power of 2 */ - V_ip_output_flowtable_size = 1 << fls((1024 + maxusers * 64)-1); + V_ip_output_flowtable_size = 1 << fls((1024 + maxbikesheds * 64)-1); } V_ip_ft = flowtable_alloc("ipv4", V_ip_output_flowtable_size, FL_PCPU); #endif Index: head/sys/boot/forth/loader.conf =================================================================== --- head/sys/boot/forth/loader.conf (Sat Nov 3 18:21:32 2012) +++ head/sys/boot/forth/loader.conf (Sat Nov 3 18:21:40 2012) @@ -104,7 +104,7 @@ #kern.maxssiz="" # Set the max stack size #kern.maxswzone="" # Set the max swmeta KVA storage #kern.maxtsiz="" # Set the max text size -#kern.maxusers="32" # Set size of various static tables +#kern.maxbikesheds="32" # Set size of various static tables #kern.msgbufsize="65536" # Set size of kernel message buffer #kern.nbuf="" # Set the number of buffer headers #kern.ncallout="" # Set the maximum # of timer events Index: head/sys/boot/common/loader.8 =================================================================== --- head/sys/boot/common/loader.8 (Sat Nov 3 18:21:32 2012) +++ head/sys/boot/common/loader.8 (Sat Nov 3 18:21:40 2012) @@ -591,7 +591,7 @@ enabled correctly by the device driver. Tunable value set to ON (1) by default, but this may cause problems with some peripherals. -.It Va kern.maxusers +.It Va kern.maxbikesheds Set the size of a number of statically allocated system tables; see .Xr tuning 7 for a description of how to select an appropriate value for this Index: head/sys/sys/systm.h =================================================================== --- head/sys/sys/systm.h (Sat Nov 3 18:21:32 2012) +++ head/sys/sys/systm.h (Sat Nov 3 18:21:40 2012) @@ -61,7 +61,7 @@ extern int boothowto; /* reboot flags, from console subsystem */ extern int bootverbose; /* nonzero to print verbose messages */ -extern int maxusers; /* system tune hint */ +extern int maxbikesheds; /* system tune hint */ extern int ngroups_max; /* max # of supplemental groups */ extern int vm_guest; /* Running as virtual machine guest? */ Index: head/sys/powerpc/booke/vm_machdep.c =================================================================== --- head/sys/powerpc/booke/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/powerpc/booke/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -134,7 +134,7 @@ #include #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif static void sf_buf_init(void *arg); Index: head/sys/powerpc/aim/vm_machdep.c =================================================================== --- head/sys/powerpc/aim/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/powerpc/aim/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -108,7 +108,7 @@ */ #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif static void sf_buf_init(void *arg); Index: head/sys/arm/arm/vm_machdep.c =================================================================== --- head/sys/arm/arm/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/arm/arm/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -74,7 +74,7 @@ #include #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif #ifndef ARM_USE_SMALL_ALLOC Index: head/sys/i386/i386/vm_machdep.c =================================================================== --- head/sys/i386/i386/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/i386/i386/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -103,7 +103,7 @@ #endif #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif CTASSERT((struct thread **)OFFSETOF_CURTHREAD == Index: head/sys/netinet6/ip6_input.c =================================================================== --- head/sys/netinet6/ip6_input.c (Sat Nov 3 18:21:32 2012) +++ head/sys/netinet6/ip6_input.c (Sat Nov 3 18:21:40 2012) @@ -196,7 +196,7 @@ /* * round up to the next power of 2 */ - V_ip6_output_flowtable_size = 1 << fls((1024 + maxusers * 64)-1); + V_ip6_output_flowtable_size = 1 << fls((1024 + maxbikesheds * 64)-1); } V_ip6_ft = flowtable_alloc("ipv6", V_ip6_output_flowtable_size, FL_IPV6|FL_PCPU); #endif Index: head/sys/conf/makeLINT.sed =================================================================== --- head/sys/conf/makeLINT.sed (Sat Nov 3 18:21:32 2012) +++ head/sys/conf/makeLINT.sed (Sat Nov 3 18:21:40 2012) @@ -1,7 +1,7 @@ #!/usr/bin/sed -E -n -f # $FreeBSD$ -/^(machine|files|ident|(no)?device|(no)?makeoption(s)?|(no)?option(s)?|profile|cpu|maxusers)[[:space:]]/ { +/^(machine|files|ident|(no)?device|(no)?makeoption(s)?|(no)?option(s)?|profile|cpu|maxbikesheds)[[:space:]]/ { s/[[:space:]]*#.*$// p } Index: head/sys/conf/options =================================================================== --- head/sys/conf/options (Sat Nov 3 18:21:32 2012) +++ head/sys/conf/options (Sat Nov 3 18:21:40 2012) @@ -289,7 +289,7 @@ NSFBUFS opt_param.h VM_BCACHE_SIZE_MAX opt_param.h VM_SWZONE_SIZE_MAX opt_param.h -MAXUSERS +MAXBIKESHEDS DFLDSIZ opt_param.h MAXDSIZ opt_param.h MAXSSIZ opt_param.h Index: head/sys/conf/NOTES =================================================================== --- head/sys/conf/NOTES (Sat Nov 3 18:21:32 2012) +++ head/sys/conf/NOTES (Sat Nov 3 18:21:40 2012) @@ -2,7 +2,7 @@ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # -# Lines that begin with 'device', 'options', 'machine', 'ident', 'maxusers', +# Lines that begin with 'device', 'options', 'machine', 'ident', 'maxbikesheds', # 'makeoptions', 'hints', etc. go into the kernel configuration that you # run config(8) with. # @@ -43,12 +43,12 @@ ident LINT # -# The `maxusers' parameter controls the static sizing of a number of +# The `maxbikesheds' parameter controls the static sizing of a number of # internal system tables by a formula defined in subr_param.c. # Omitting this parameter or setting it to 0 will cause the system to # auto-size based on physical memory. # -maxusers 10 +maxbikesheds 10 # To statically compile in device wiring instead of /boot/device.hints #hints "LINT.hints" # Default places to look for devices. @@ -2615,7 +2615,7 @@ # Set the number of sf_bufs to allocate. sf_bufs are virtual buffers # for sendfile(2) that are used to map file VM pages, and normally -# default to a quantity that is roughly 16*MAXUSERS+512. You would +# default to a quantity that is roughly 16*MAXBIKESHEDS+512. You would # typically want about 4 of these for each simultaneous file send. # options NSFBUFS=1024 Index: head/sys/net/flowtable.c =================================================================== --- head/sys/net/flowtable.c (Sat Nov 3 18:21:32 2012) +++ head/sys/net/flowtable.c (Sat Nov 3 18:21:40 2012) @@ -1607,7 +1607,7 @@ flowtable_init_vnet(const void *unused __unused) { - V_flowtable_nmbflows = 1024 + maxusers * 64 * mp_ncpus; + V_flowtable_nmbflows = 1024 + maxbikesheds * 64 * mp_ncpus; V_flow_ipv4_zone = uma_zcreate("ip4flow", sizeof(struct flentry_v4), NULL, NULL, NULL, NULL, 64, UMA_ZONE_MAXBUCKET); V_flow_ipv6_zone = uma_zcreate("ip6flow", sizeof(struct flentry_v6), Index: head/sys/kern/kern_mib.c =================================================================== --- head/sys/kern/kern_mib.c (Sat Nov 3 18:21:32 2012) +++ head/sys/kern/kern_mib.c (Sat Nov 3 18:21:40 2012) @@ -115,8 +115,8 @@ SYSCTL_INT(_kern, KERN_MAXPROCPERUID, maxprocperuid, CTLFLAG_RW, &maxprocperuid, 0, "Maximum processes allowed per userid"); -SYSCTL_INT(_kern, OID_AUTO, maxusers, CTLFLAG_RDTUN, - &maxusers, 0, "Hint for kernel tuning"); +SYSCTL_INT(_kern, OID_AUTO, maxbikesheds, CTLFLAG_RDTUN, + &maxbikesheds, 0, "Hint for kernel tuning"); SYSCTL_INT(_kern, KERN_ARGMAX, argmax, CTLFLAG_RD|CTLFLAG_CAPRD, 0, ARG_MAX, "Maximum bytes of argument to execve(2)"); Index: head/sys/kern/subr_param.c =================================================================== --- head/sys/kern/subr_param.c (Sat Nov 3 18:21:32 2012) +++ head/sys/kern/subr_param.c (Sat Nov 3 18:21:40 2012) @@ -39,7 +39,7 @@ #include "opt_param.h" #include "opt_msgbuf.h" -#include "opt_maxusers.h" +#include "opt_maxbikesheds.h" #include #include @@ -71,7 +71,7 @@ # define HZ_VM HZ # endif #endif -#define NPROC (20 + 16 * maxusers) +#define NPROC (20 + 16 * maxbikesheds) #ifndef NBUF #define NBUF 0 #endif @@ -83,7 +83,7 @@ int hz; int tick; -int maxusers; /* base tunable */ +int maxbikesheds; /* base tunable */ int maxproc; /* maximum # of processes */ int maxprocperuid; /* max # of procs per user */ int maxfiles; /* sys. wide open files limit */ @@ -272,27 +272,27 @@ { /* Base parameters */ - maxusers = MAXUSERS; - TUNABLE_INT_FETCH("kern.maxusers", &maxusers); - if (maxusers == 0) { - maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); - if (maxusers < 32) - maxusers = 32; + maxbikesheds = MAXBIKESHEDS; + TUNABLE_INT_FETCH("kern.maxbikesheds", &maxbikesheds); + if (maxbikesheds == 0) { + maxbikesheds = physpages / (2 * 1024 * 1024 / PAGE_SIZE); + if (maxbikesheds < 32) + maxbikesheds = 32; /* - * Clips maxusers to 384 on machines with <= 4GB RAM or 32bit. + * Clips maxbikesheds to 384 on machines with <= 4GB RAM or 32bit. * Scales it down 6x for large memory machines. */ - if (maxusers > 384) { + if (maxbikesheds > 384) { if (sizeof(void *) <= 4) - maxusers = 384; + maxbikesheds = 384; else - maxusers = 384 + ((maxusers - 384) / 6); + maxbikesheds = 384 + ((maxbikesheds - 384) / 6); } } /* * The following can be overridden after boot via sysctl. Note: - * unless overriden, these macros are ultimately based on maxusers. + * unless overriden, these macros are ultimately based on maxbikesheds. */ maxproc = NPROC; TUNABLE_INT_FETCH("kern.maxproc", &maxproc); Index: head/sys/kern/kern_mbuf.c =================================================================== --- head/sys/kern/kern_mbuf.c (Sat Nov 3 18:21:32 2012) +++ head/sys/kern/kern_mbuf.c (Sat Nov 3 18:21:40 2012) @@ -114,7 +114,7 @@ /* This has to be done before VM init. */ TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); if (nmbclusters == 0) - nmbclusters = 1024 + maxusers * 64; + nmbclusters = 1024 + maxbikesheds * 64; TUNABLE_INT_FETCH("kern.ipc.nmbjumbop", &nmbjumbop); if (nmbjumbop == 0) Index: head/sys/mips/conf/RT305X =================================================================== --- head/sys/mips/conf/RT305X (Sat Nov 3 18:21:32 2012) +++ head/sys/mips/conf/RT305X (Sat Nov 3 18:21:40 2012) @@ -72,7 +72,7 @@ # Options for making kernel less hangry makeoptions INLINE_LIMIT=1024 -options MAXUSERS=3 +options MAXBIKESHEDS=3 options MAXFILES=512 options NSFBUFS=256 options SHMALL=128 Index: head/sys/mips/mips/vm_machdep.c =================================================================== --- head/sys/mips/mips/vm_machdep.c (Sat Nov 3 18:21:32 2012) +++ head/sys/mips/mips/vm_machdep.c (Sat Nov 3 18:21:40 2012) @@ -80,7 +80,7 @@ #include #ifndef NSFBUFS -#define NSFBUFS (512 + maxusers * 16) +#define NSFBUFS (512 + maxbikesheds * 16) #endif #ifndef __mips_n64 From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 20:43:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D7D7D95; Sat, 3 Nov 2012 20:43: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 74D128FC12; Sat, 3 Nov 2012 20:43:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3KhDS6040972; Sat, 3 Nov 2012 20:43:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3KhDUj040970; Sat, 3 Nov 2012 20:43:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211032043.qA3KhDUj040970@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Nov 2012 20:43:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242522 - head X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 20:43:13 -0000 Author: marcel Date: Sat Nov 3 20:43:12 2012 New Revision: 242522 URL: http://svn.freebsd.org/changeset/base/242522 Log: Add the buildLINT convenience target, handy for build automation. The automation can set TARGET_ARCH and TARGET and then make various top-level targets, including buildLINT and buildkernel (with KERNCONF=LINT). Previously there was no way to generate the LINT kernel configuration without having to do something exceptionally painful. Modified: head/Makefile Modified: head/Makefile ============================================================================== --- head/Makefile Sat Nov 3 19:26:08 2012 (r242521) +++ head/Makefile Sat Nov 3 20:43:12 2012 (r242522) @@ -443,3 +443,6 @@ universe_epilogue: fi .endif .endif + +buildLINT: + ${MAKE} -C ${.CURDIR}/sys/${_TARGET}/conf LINT From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 20:54:01 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5EBCE1BD; Sat, 3 Nov 2012 20:54:01 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-oa0-f54.google.com (mail-oa0-f54.google.com [209.85.219.54]) by mx1.freebsd.org (Postfix) with ESMTP id AA12B8FC08; Sat, 3 Nov 2012 20:54:00 +0000 (UTC) Received: by mail-oa0-f54.google.com with SMTP id n9so5861488oag.13 for ; Sat, 03 Nov 2012 13:54:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=RLprYoML/x7wAYeKEwGMZhzul5LMLCzONw3ZvhPd+/s=; b=s9YfDOulOWpWiFkt/HDr5onYsNDzbmkGjOzpLm+QbpU6btxIrE2KPfImv1EsphNegv QVlGEWcb/oOHCE4yD21d0f1Sm2havd6mlbzT05KUs07gT+TeHBv3DHRlG1n3Pa6NzRD8 EIFFZj33C1isp8N5ug1iTjvTdyxNlLI14KJtQszbkSSe0zqtBOyXpkBKBW80uIYbSz9o 2G7h4phYBEbbmJuTI913t9Ur6P1dKAcjWG/R52Mi5wltGmWyi9RVHSjJMQAulI8DcAdy oaCp9gFGZ5h3LXZi2ckfUXec2Ft6U+IzjGlFBIFUEgZIL4csiFOhp3A1AMSk88pxBlVX N9lg== MIME-Version: 1.0 Received: by 10.182.42.6 with SMTP id j6mr4409871obl.93.1351976040029; Sat, 03 Nov 2012 13:54:00 -0700 (PDT) Received: by 10.76.143.33 with HTTP; Sat, 3 Nov 2012 13:53:59 -0700 (PDT) In-Reply-To: <201210250146.q9P1kLi8043704@svn.freebsd.org> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> Date: Sat, 3 Nov 2012 13:53:59 -0700 Message-ID: Subject: Re: svn commit: r242520 - head/sys/kern From: Garrett Cooper To: Alfred Perlstein Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 20:54:01 -0000 On Sat, Nov 3, 2012 at 1:35 PM, Alfred Perlstein wrote: > Author: alfred > Date: Sat Nov 3 18:21:40 2012 > New Revision: 242520 > URL: http://svn.freebsd.org/changeset/base/242520 > > Log: > Retire MAXUSERS. > > Approved by: peter, meetBSD > s/maxusers/maxbikesheds/g 0-o..? From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:05:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5AD4E62A; Sat, 3 Nov 2012 21:05:33 +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 287538FC14; Sat, 3 Nov 2012 21:05:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3L5XlI044395; Sat, 3 Nov 2012 21:05:33 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3L5WAm044392; Sat, 3 Nov 2012 21:05:32 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211032105.qA3L5WAm044392@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Nov 2012 21:05:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242523 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:05:33 -0000 Author: marcel Date: Sat Nov 3 21:05:32 2012 New Revision: 242523 URL: http://svn.freebsd.org/changeset/base/242523 Log: Allow using the embedded EHCI host controller in Freescale SoCs by adding the missing bits. See ehci_fsl.c for their use. Modified: head/sys/dev/usb/controller/ehci.c head/sys/dev/usb/controller/ehci.h Modified: head/sys/dev/usb/controller/ehci.c ============================================================================== --- head/sys/dev/usb/controller/ehci.c Sat Nov 3 20:43:12 2012 (r242522) +++ head/sys/dev/usb/controller/ehci.c Sat Nov 3 21:05:32 2012 (r242523) @@ -332,14 +332,18 @@ ehci_init(ehci_softc_t *sc) sc->sc_noport = EHCI_HCS_N_PORTS(sparams); sc->sc_bus.usbrev = USB_REV_2_0; - /* Reset the controller */ - DPRINTF("%s: resetting\n", device_get_nameunit(sc->sc_bus.bdev)); - - err = ehci_hcreset(sc); - if (err) { - device_printf(sc->sc_bus.bdev, "reset timeout\n"); - return (err); + if (!(sc->sc_flags & EHCI_SCFLG_DONTRESET)) { + /* Reset the controller */ + DPRINTF("%s: resetting\n", + device_get_nameunit(sc->sc_bus.bdev)); + + err = ehci_hcreset(sc); + if (err) { + device_printf(sc->sc_bus.bdev, "reset timeout\n"); + return (err); + } } + /* * use current frame-list-size selection 0: 1024*4 bytes 1: 512*4 * bytes 2: 256*4 bytes 3: unknown Modified: head/sys/dev/usb/controller/ehci.h ============================================================================== --- head/sys/dev/usb/controller/ehci.h Sat Nov 3 20:43:12 2012 (r242522) +++ head/sys/dev/usb/controller/ehci.h Sat Nov 3 21:05:32 2012 (r242523) @@ -345,6 +345,8 @@ typedef struct ehci_softc { #define EHCI_SCFLG_TT 0x0020 /* transaction translator present */ #define EHCI_SCFLG_LOSTINTRBUG 0x0040 /* workaround for VIA / ATI chipsets */ #define EHCI_SCFLG_IAADBUG 0x0080 /* workaround for nVidia chipsets */ +#define EHCI_SCFLG_DONTRESET 0x0100 /* don't reset ctrl. in ehci_init() */ +#define EHCI_SCFLG_DONEINIT 0x1000 /* ehci_init() has been called. */ uint8_t sc_offs; /* offset to operational registers */ uint8_t sc_doorbell_disable; /* set on doorbell failure */ From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:08:20 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1CFF87C5; Sat, 3 Nov 2012 21:08:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6658FC12; Sat, 3 Nov 2012 21:08:19 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id qA3L8IS7067078; Sun, 4 Nov 2012 01:08:18 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id qA3L8IVH067077; Sun, 4 Nov 2012 01:08:18 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Sun, 4 Nov 2012 01:08:18 +0400 From: Gleb Smirnoff To: Alfred Perlstein Subject: Re: svn commit: r242520 - head/sys/kern Message-ID: <20121103210818.GY70741@FreeBSD.org> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201210250146.q9P1kLi8043704@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:08:20 -0000 On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: A> Author: alfred A> Date: Sat Nov 3 18:21:40 2012 A> New Revision: 242520 A> URL: http://svn.freebsd.org/changeset/base/242520 A> A> Log: A> Retire MAXUSERS. A> A> Approved by: peter, meetBSD This mechanical rename to meaningless (from viewpoint of average operating system user) name is not a retirement. It is just a stupid rename. FreeBSD source tree isn't a place for stupid jokes. Please back this out. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:08:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C9229910; Sat, 3 Nov 2012 21:08:27 +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 B19058FC08; Sat, 3 Nov 2012 21:08:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3L8RUV044849; Sat, 3 Nov 2012 21:08:27 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3L8RNo044847; Sat, 3 Nov 2012 21:08:27 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211032108.qA3L8RNo044847@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Nov 2012 21:08:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242524 - head/sys/conf X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:08:27 -0000 Author: marcel Date: Sat Nov 3 21:08:27 2012 New Revision: 242524 URL: http://svn.freebsd.org/changeset/base/242524 Log: Add the bus attachment for the embedded EHCI HC. Modified: head/sys/conf/files.powerpc Modified: head/sys/conf/files.powerpc ============================================================================== --- head/sys/conf/files.powerpc Sat Nov 3 21:05:32 2012 (r242523) +++ head/sys/conf/files.powerpc Sat Nov 3 21:08:27 2012 (r242524) @@ -63,6 +63,7 @@ dev/syscons/scvtb.c optional sc dev/tsec/if_tsec.c optional tsec dev/tsec/if_tsec_fdt.c optional tsec fdt dev/uart/uart_cpu_powerpc.c optional uart aim +dev/usb/controller/ehci_fsl.c optional ehci mpc85xx kern/kern_clocksource.c standard kern/subr_dummy_vdso_tc.c standard kern/syscalls.c optional ktr From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:15:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0268BCF7; Sat, 3 Nov 2012 21:15:23 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kostikbel-1-pt.tunnel.tserv11.ams1.ipv6.he.net [IPv6:2001:470:1f14:13d6::2]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE698FC16; Sat, 3 Nov 2012 21:15:22 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qA3LFIgc035646; Sat, 3 Nov 2012 23:15:18 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qA3LFIBf035645; Sat, 3 Nov 2012 23:15:18 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 3 Nov 2012 23:15:18 +0200 From: Konstantin Belousov To: Gleb Smirnoff Subject: Re: svn commit: r242520 - head/sys/kern Message-ID: <20121103211518.GH73505@kib.kiev.ua> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121103210818.GY70741@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="BDlG3CzP/kphk9YG" Content-Disposition: inline In-Reply-To: <20121103210818.GY70741@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Alfred Perlstein , src-committers@freebsd.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:15:23 -0000 --BDlG3CzP/kphk9YG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 04, 2012 at 01:08:18AM +0400, Gleb Smirnoff wrote: > On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: > A> Author: alfred > A> Date: Sat Nov 3 18:21:40 2012 > A> New Revision: 242520 > A> URL: http://svn.freebsd.org/changeset/base/242520 > A>=20 > A> Log: > A> Retire MAXUSERS. > A>=20 > A> Approved by: peter, meetBSD >=20 > This mechanical rename to meaningless (from viewpoint of average > operating system user) name is not a retirement. It is just a stupid > rename. >=20 > FreeBSD source tree isn't a place for stupid jokes. Please back this > out. Seconded. Unfortunately, this cannot be reverted. At least r242520 shall stay as is in repo. --BDlG3CzP/kphk9YG Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCViWYACgkQC3+MBN1Mb4irlQCg4sTTCNTWJyJHyyvgBkvoDdOK qlgAoO2a+8L1RcfcxxKCC2qddYjgLtRM =qyyv -----END PGP SIGNATURE----- --BDlG3CzP/kphk9YG-- From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:20:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28FD91000; Sat, 3 Nov 2012 21:20:56 +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 10A998FC08; Sat, 3 Nov 2012 21:20:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3LKtqu046825; Sat, 3 Nov 2012 21:20:55 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3LKthY046822; Sat, 3 Nov 2012 21:20:55 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211032120.qA3LKthY046822@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Nov 2012 21:20:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242525 - in head/sys: conf dev/md X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:20:56 -0000 Author: marcel Date: Sat Nov 3 21:20:55 2012 New Revision: 242525 URL: http://svn.freebsd.org/changeset/base/242525 Log: Add a MD_ROOT_FSTYPE kernel option. The option specifies the file system part for the MD_ROOT mount string. Hardcoding the the file system type as "ufs" is too restrictive. Modified: head/sys/conf/options head/sys/dev/md/md.c Modified: head/sys/conf/options ============================================================================== --- head/sys/conf/options Sat Nov 3 21:08:27 2012 (r242524) +++ head/sys/conf/options Sat Nov 3 21:20:55 2012 (r242525) @@ -139,6 +139,7 @@ MAC_STATIC opt_mac.h MAC_STUB opt_dontuse.h MAC_TEST opt_dontuse.h MD_ROOT opt_md.h +MD_ROOT_FSTYPE opt_md.h MD_ROOT_SIZE opt_md.h MFI_DEBUG opt_mfi.h MFI_DECODE_LOG opt_mfi.h Modified: head/sys/dev/md/md.c ============================================================================== --- head/sys/dev/md/md.c Sat Nov 3 21:08:27 2012 (r242524) +++ head/sys/dev/md/md.c Sat Nov 3 21:20:55 2012 (r242525) @@ -110,6 +110,10 @@ static int md_malloc_wait; SYSCTL_INT(_vm, OID_AUTO, md_malloc_wait, CTLFLAG_RW, &md_malloc_wait, 0, "Allow malloc to wait for memory allocations"); +#if defined(MD_ROOT) && !defined(MD_ROOT_FSTYPE) +#define MD_ROOT_FSTYPE "ufs" +#endif + #if defined(MD_ROOT) && defined(MD_ROOT_SIZE) /* * Preloaded image gets put here. @@ -1328,7 +1332,7 @@ md_preloaded(u_char *image, size_t lengt sc->start = mdstart_preload; #ifdef MD_ROOT if (sc->unit == 0) - rootdevnames[0] = "ufs:/dev/md0"; + rootdevnames[0] = MD_ROOT_FSTYPE ":/dev/md0"; #endif mdinit(sc); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 21:29:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D5E1B242; Sat, 3 Nov 2012 21:29:15 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from mail.allbsd.org (gatekeeper.allbsd.org [IPv6:2001:2f0:104:e001::32]) by mx1.freebsd.org (Postfix) with ESMTP id 30B998FC08; Sat, 3 Nov 2012 21:29:15 +0000 (UTC) Received: from alph.allbsd.org (p1137-ipbf1505funabasi.chiba.ocn.ne.jp [118.7.212.137]) (authenticated bits=128) by mail.allbsd.org (8.14.5/8.14.5) with ESMTP id qA3LSwfS031912 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 4 Nov 2012 06:29:08 +0900 (JST) (envelope-from hrs@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) (authenticated bits=0) by alph.allbsd.org (8.14.5/8.14.5) with ESMTP id qA3LSu90005693; Sun, 4 Nov 2012 06:28:58 +0900 (JST) (envelope-from hrs@FreeBSD.org) Date: Sun, 04 Nov 2012 06:27:09 +0900 (JST) Message-Id: <20121104.062709.36965712608921677.hrs@allbsd.org> To: kostikbel@gmail.com Subject: Re: svn commit: r242520 - head/sys/kern From: Hiroki Sato In-Reply-To: <20121103211518.GH73505@kib.kiev.ua> References: <201210250146.q9P1kLi8043704@svn.freebsd.org> <20121103210818.GY70741@FreeBSD.org> <20121103211518.GH73505@kib.kiev.ua> X-PGPkey-fingerprint: BDB3 443F A5DD B3D0 A530 FFD7 4F2C D3D8 2793 CF2D X-Mailer: Mew version 6.5 on Emacs 23.4 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Multipart/Signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="--Security_Multipart(Sun_Nov__4_06_27_09_2012_949)--" Content-Transfer-Encoding: 7bit X-Virus-Scanned: clamav-milter 0.97.4 at gatekeeper.allbsd.org X-Virus-Status: Clean X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (mail.allbsd.org [133.31.130.32]); Sun, 04 Nov 2012 06:29:08 +0900 (JST) X-Spam-Status: No, score=-98.1 required=13.0 tests=CONTENT_TYPE_PRESENT, ONLY1HOPDIRECT,SAMEHELOBY2HOP,USER_IN_WHITELIST autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on gatekeeper.allbsd.org Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, glebius@FreeBSD.org, src-committers@FreeBSD.org, alfred@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 21:29:16 -0000 ----Security_Multipart(Sun_Nov__4_06_27_09_2012_949)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Konstantin Belousov wrote in <20121103211518.GH73505@kib.kiev.ua>: ko> On Sun, Nov 04, 2012 at 01:08:18AM +0400, Gleb Smirnoff wrote: ko> > On Sat, Nov 03, 2012 at 01:35:20PM -0700, Alfred Perlstein wrote: ko> > A> Author: alfred ko> > A> Date: Sat Nov 3 18:21:40 2012 ko> > A> New Revision: 242520 ko> > A> URL: http://svn.freebsd.org/changeset/base/242520 ko> > A> ko> > A> Log: ko> > A> Retire MAXUSERS. ko> > A> ko> > A> Approved by: peter, meetBSD ko> > ko> > This mechanical rename to meaningless (from viewpoint of average ko> > operating system user) name is not a retirement. It is just a stupid ko> > rename. ko> > ko> > FreeBSD source tree isn't a place for stupid jokes. Please back this ko> > out. ko> ko> Seconded. Unfortunately, this cannot be reverted. At least r242520 shall ko> stay as is in repo. I guess he was just joking outside of the source tree. -- Hiroki ----Security_Multipart(Sun_Nov__4_06_27_09_2012_949)-- Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iEYEABECAAYFAlCVjC0ACgkQTyzT2CeTzy3/iQCgijZNQm6UXc59p1Um+z/T76tT t6UAoKHjz0glup17lr2PvXqu74o4IAbt =zK8p -----END PGP SIGNATURE----- ----Security_Multipart(Sun_Nov__4_06_27_09_2012_949)---- From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:02:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5D2C8B8E; Sat, 3 Nov 2012 22:02: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 43F658FC08; Sat, 3 Nov 2012 22:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3M2DpE053174; Sat, 3 Nov 2012 22:02:13 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3M2Duo053169; Sat, 3 Nov 2012 22:02:13 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201211032202.qA3M2Duo053169@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 3 Nov 2012 22:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242526 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:02:13 -0000 Author: marcel Date: Sat Nov 3 22:02:12 2012 New Revision: 242526 URL: http://svn.freebsd.org/changeset/base/242526 Log: 1. Have the APs initialize the TLB1 entries from what has been programmed on the BSP during (early) boot. This makes sure that the APs get configured the same as the BSP, irrspective of how FreeBSD was loaded. 2. Make sure to flush the dcache after writing the TLB1 entries to the boot page. The APs aren't part of the coherency domain just yet. 3. Set pmap_bootstrapped after calling pmap_bootstrap(). The FDT code now maps the devices (like OF), and this resulted in a panic. 4. Since we pre-wire the CCSR, make sure not to map chunks of it in pmap_mapdev(). Modified: head/sys/powerpc/booke/locore.S head/sys/powerpc/booke/machdep.c head/sys/powerpc/booke/platform_bare.c head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/locore.S ============================================================================== --- head/sys/powerpc/booke/locore.S Sat Nov 3 21:20:55 2012 (r242525) +++ head/sys/powerpc/booke/locore.S Sat Nov 3 22:02:12 2012 (r242526) @@ -126,9 +126,11 @@ __start: bl tlb1_find_current /* the entry found is returned in r29 */ bl tlb1_inval_all_but_current + /* * Create temporary mapping in AS=1 and switch to it */ + addi %r3, %r29, 1 bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -242,19 +244,21 @@ done_mapping: __boot_page: bl 1f - .globl bp_trace -bp_trace: + .globl bp_ntlb1s +bp_ntlb1s: .long 0 - .globl bp_kernload -bp_kernload: - .long 0 + .globl bp_tlb1 +bp_tlb1: + .space 4 * 3 * 16 + + .globl bp_tlb1_end +bp_tlb1_end: /* * Initial configuration */ -1: - mflr %r31 /* r31 hold the address of bp_trace */ +1: mflr %r31 /* r31 hold the address of bp_ntlb1s */ /* Set HIDs */ lis %r3, HID0_E500_DEFAULT_SET@h @@ -283,9 +287,11 @@ bp_kernload: bl tlb1_find_current /* the entry number found is in r29 */ bl tlb1_inval_all_but_current + /* * Create temporary translation in AS=1 and switch to it */ + lwz %r3, 0(%r31) bl tlb1_temp_mapping_as1 mfmsr %r3 @@ -306,44 +312,34 @@ bp_kernload: /* * Setup final mapping in TLB1[1] and switch to it */ - /* Final kernel mapping, map in 16 MB of RAM */ - lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - li %r4, 0 /* Entry 0 */ - rlwimi %r3, %r4, 16, 4, 15 + lwz %r6, 0(%r31) + addi %r5, %r31, 4 + li %r4, 0 + +4: lis %r3, MAS0_TLBSEL1@h + rlwimi %r3, %r4, 16, 12, 15 mtspr SPR_MAS0, %r3 isync - - li %r3, (TLB_SIZE_16M << MAS1_TSIZE_SHIFT)@l - oris %r3, %r3, (MAS1_VALID | MAS1_IPROT)@h - mtspr SPR_MAS1, %r3 /* note TS was not filled, so it's TS=0 */ + lwz %r3, 0(%r5) + mtspr SPR_MAS1, %r3 isync - - lis %r3, KERNBASE@h - ori %r3, %r3, KERNBASE@l /* EPN = KERNBASE */ - ori %r3, %r3, MAS2_M@l /* WIMGE = 0b00100 */ + lwz %r3, 4(%r5) mtspr SPR_MAS2, %r3 isync - - /* Retrieve kernel load [physical] address from bp_kernload */ - bl 4f -4: mflr %r3 - rlwinm %r3, %r3, 0, 0, 19 - lis %r4, bp_kernload@h - ori %r4, %r4, bp_kernload@l - lis %r5, __boot_page@h - ori %r5, %r5, __boot_page@l - sub %r4, %r4, %r5 /* offset of bp_kernload within __boot_page */ - lwzx %r3, %r4, %r3 - - /* Set RPN and protection */ - ori %r3, %r3, (MAS3_SX | MAS3_SW | MAS3_SR)@l + lwz %r3, 8(%r5) mtspr SPR_MAS3, %r3 isync tlbwe isync msync + addi %r5, %r5, 12 + addi %r4, %r4, 1 + cmpw %r4, %r6 + blt 4b /* Switch to the final mapping */ + lis %r5, __boot_page@ha + ori %r5, %r5, __boot_page@l bl 5f 5: mflr %r3 rlwinm %r3, %r3, 0, 0xfff /* Offset from boot page start */ @@ -460,11 +456,14 @@ tlb1_inval_entry: blr /* - * r29 current entry number - * r28 returned temp entry - * r3-r5 scratched + * r3 entry of temp translation + * r29 entry of current translation + * r28 returns temp entry passed in r3 + * r4-r5 scratched */ tlb1_temp_mapping_as1: + mr %r28, %r3 + /* Read our current translation */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ rlwimi %r3, %r29, 16, 12, 15 /* Select our current entry */ @@ -472,14 +471,8 @@ tlb1_temp_mapping_as1: isync tlbre - /* - * Prepare and write temp entry - * - * FIXME this is not robust against overflow i.e. when the current - * entry is the last in TLB1 - */ + /* Prepare and write temp entry */ lis %r3, MAS0_TLBSEL1@h /* Select TLB1 */ - addi %r28, %r29, 1 /* Use next entry. */ rlwimi %r3, %r28, 16, 12, 15 /* Select temp entry */ mtspr SPR_MAS0, %r3 isync Modified: head/sys/powerpc/booke/machdep.c ============================================================================== --- head/sys/powerpc/booke/machdep.c Sat Nov 3 21:20:55 2012 (r242525) +++ head/sys/powerpc/booke/machdep.c Sat Nov 3 22:02:12 2012 (r242526) @@ -413,6 +413,7 @@ booke_init(uint32_t arg1, uint32_t arg2) /* Initialise virtual memory. */ pmap_mmu_install(MMU_TYPE_BOOKE, 0); pmap_bootstrap((uintptr_t)kernel_text, end); + pmap_bootstrapped = 1; debugf("MSR = 0x%08x\n", mfmsr()); #if defined(BOOKE_E500) //tlb1_print_entries(); Modified: head/sys/powerpc/booke/platform_bare.c ============================================================================== --- head/sys/powerpc/booke/platform_bare.c Sat Nov 3 21:20:55 2012 (r242525) +++ head/sys/powerpc/booke/platform_bare.c Sat Nov 3 22:02:12 2012 (r242526) @@ -55,9 +55,11 @@ __FBSDID("$FreeBSD$"); #ifdef SMP extern void *ap_pcpu; +extern vm_paddr_t kernload; /* Kernel physical load address */ extern uint8_t __boot_page[]; /* Boot page body */ -extern uint32_t bp_kernload; /* Kernel physical load address */ -extern uint32_t bp_trace; /* AP boot trace field */ +extern uint32_t bp_ntlb1s; +extern uint32_t bp_tlb1[]; +extern uint32_t bp_tlb1_end[]; #endif extern uint32_t *bootinfo; @@ -248,8 +250,9 @@ static int bare_smp_start_cpu(platform_t plat, struct pcpu *pc) { #ifdef SMP + uint32_t *tlb1; uint32_t bptr, eebpcr; - int timeout; + int i, timeout; eebpcr = ccsr_read4(OCP85XX_EEBPCR); if ((eebpcr & (1 << (pc->pc_cpuid + 24))) != 0) { @@ -259,18 +262,37 @@ bare_smp_start_cpu(platform_t plat, stru } ap_pcpu = pc; - __asm __volatile("msync; isync"); + + i = 0; + tlb1 = bp_tlb1; + while (i < bp_ntlb1s && tlb1 < bp_tlb1_end) { + mtspr(SPR_MAS0, MAS0_TLBSEL(1) | MAS0_ESEL(i)); + __asm __volatile("isync; tlbre"); + tlb1[0] = mfspr(SPR_MAS1); + tlb1[1] = mfspr(SPR_MAS2); + tlb1[2] = mfspr(SPR_MAS3); + i++; + tlb1 += 3; + } + if (i < bp_ntlb1s) + bp_ntlb1s = i; /* * Set BPTR to the physical address of the boot page */ - bptr = ((uint32_t)__boot_page - KERNBASE) + bp_kernload; - ccsr_write4(OCP85XX_BPTR, (bptr >> 12) | 0x80000000); + bptr = ((uint32_t)__boot_page - KERNBASE) + kernload; + KASSERT((bptr & 0xfff) == 0, + ("%s: boot page is not aligned (%#x)", __func__, bptr)); + bptr = (bptr >> 12) | 0x80000000u; + ccsr_write4(OCP85XX_BPTR, bptr); + __asm __volatile("isync; msync"); + + /* Flush caches to have our changes hit DRAM. */ + cpu_flush_dcache(__boot_page, 4096); /* * Release AP from hold-off state */ - bp_trace = 0; eebpcr |= (1 << (pc->pc_cpuid + 24)); ccsr_write4(OCP85XX_EEBPCR, eebpcr); __asm __volatile("isync; msync"); @@ -285,10 +307,10 @@ bare_smp_start_cpu(platform_t plat, stru * usable otherwise. */ ccsr_write4(OCP85XX_BPTR, 0); + __asm __volatile("isync; msync"); if (!pc->pc_awake) - printf("SMP: CPU %d didn't wake up (trace code %#x).\n", - pc->pc_awake, bp_trace); + printf("SMP: CPU %d didn't wake up.\n", pc->pc_cpuid); return ((pc->pc_awake) ? 0 : EBUSY); #else /* No SMP support */ Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Nov 3 21:20:55 2012 (r242525) +++ head/sys/powerpc/booke/pmap.c Sat Nov 3 22:02:12 2012 (r242526) @@ -111,9 +111,10 @@ extern unsigned char _end[]; extern uint32_t *bootinfo; #ifdef SMP -extern uint32_t bp_kernload; +extern uint32_t bp_ntlb1s; #endif +vm_paddr_t ccsrbar_pa; vm_paddr_t kernload; vm_offset_t kernstart; vm_size_t kernsize; @@ -962,10 +963,6 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset debugf("mmu_booke_bootstrap: entered\n"); -#ifdef SMP - bp_kernload = kernload; -#endif - /* Initialize invalidation mutex */ mtx_init(&tlbivax_mutex, "tlbivax", NULL, MTX_SPIN); @@ -1279,7 +1276,7 @@ pmap_bootstrap_ap(volatile uint32_t *trc * have the snapshot of its contents in the s/w tlb1[] table, so use * these values directly to (re)program AP's TLB1 hardware. */ - for (i = 0; i < tlb1_idx; i ++) { + for (i = bp_ntlb1s; i < tlb1_idx; i++) { /* Skip invalid entries */ if (!(tlb1[i].mas1 & MAS1_VALID)) continue; @@ -2601,6 +2598,18 @@ mmu_booke_mapdev(mmu_t mmu, vm_paddr_t p uintptr_t va; vm_size_t sz; + /* + * CCSR is premapped. Note that (pa + size - 1) is there to make sure + * we don't wrap around. Devices on the local bus typically extend all + * the way up to and including 0xffffffff. In that case (pa + size) + * would be 0. This creates a false positive (i.e. we think it's + * within the CCSR) and not create a mapping. + */ + if (pa >= ccsrbar_pa && (pa + size - 1) < (ccsrbar_pa + CCSRBAR_SIZE)) { + va = CCSRBAR_VA + (pa - ccsrbar_pa); + return ((void *)va); + } + va = (pa >= 0x80000000) ? pa : (0xe2000000 + pa); res = (void *)va; @@ -3011,6 +3020,8 @@ tlb1_init(vm_offset_t ccsrbar) uint32_t tsz; u_int i; + ccsrbar_pa = ccsrbar; + if (bootinfo != NULL && bootinfo[0] != 1) { tlb1_idx = *((uint16_t *)(bootinfo + 8)); } else @@ -3042,6 +3053,10 @@ tlb1_init(vm_offset_t ccsrbar) /* Map in CCSRBAR. */ tlb1_set_entry(CCSRBAR_VA, ccsrbar, CCSRBAR_SIZE, _TLB_ENTRY_IO); +#ifdef SMP + bp_ntlb1s = tlb1_idx; +#endif + /* Purge the remaining entries */ for (i = tlb1_idx; i < TLB1_ENTRIES; i++) tlb1_write_entry(i); From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:12:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6D5CE2A6; Sat, 3 Nov 2012 22:12: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 3C9C98FC19; Sat, 3 Nov 2012 22:12:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3MCaTI054710; Sat, 3 Nov 2012 22:12:36 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3MCadK054707; Sat, 3 Nov 2012 22:12:36 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211032212.qA3MCadK054707@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 22:12:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242527 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:12:36 -0000 Author: adrian Date: Sat Nov 3 22:12:35 2012 New Revision: 242527 URL: http://svn.freebsd.org/changeset/base/242527 Log: Add a new HAL call to extract out the HAL enterprise bits from the AR9300 HAL. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Sat Nov 3 22:02:12 2012 (r242526) +++ head/sys/dev/ath/if_ath.c Sat Nov 3 22:12:35 2012 (r242527) @@ -701,6 +701,13 @@ ath_attach(u_int16_t devid, struct ath_s */ sc->sc_mrrprot = 0; /* XXX should be a capability */ + /* + * Query the enterprise mode information the HAL. + */ + if (ath_hal_getcapability(ah, HAL_CAP_ENTERPRISE_MODE, 0, + &sc->sc_ent_cfg) == HAL_OK) + sc->sc_use_ent = 1; + #ifdef ATH_ENABLE_11N /* * Query HT capabilities Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Sat Nov 3 22:02:12 2012 (r242526) +++ head/sys/dev/ath/if_athvar.h Sat Nov 3 22:12:35 2012 (r242527) @@ -538,7 +538,11 @@ struct ath_softc { struct ath_ratectrl *sc_rc; /* tx rate control support */ struct ath_tx99 *sc_tx99; /* tx99 adjunct state */ void (*sc_setdefantenna)(struct ath_softc *, u_int); - unsigned int sc_invalid : 1,/* disable hardware accesses */ + + /* + * First set of flags. + */ + uint32_t sc_invalid : 1,/* disable hardware accesses */ sc_mrretry : 1,/* multi-rate retry support */ sc_mrrprot : 1,/* MRR + protection support */ sc_softled : 1,/* enable LED gpio status */ @@ -570,6 +574,17 @@ struct ath_softc { sc_rxslink : 1,/* do self-linked final descriptor */ sc_rxtsf32 : 1,/* RX dec TSF is 32 bits */ sc_isedma : 1;/* supports EDMA */ + + /* + * Second set of flags. + */ + u_int32_t sc_use_ent : 1; + + /* + * Enterprise mode configuration for AR9380 and later chipsets. + */ + uint32_t sc_ent_cfg; + uint32_t sc_eerd; /* regdomain from EEPROM */ uint32_t sc_eecc; /* country code from EEPROM */ /* rate tables */ From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:13:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C772421; Sat, 3 Nov 2012 22:13: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 23CBF8FC08; Sat, 3 Nov 2012 22:13:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3MDgYg054897; Sat, 3 Nov 2012 22:13:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3MDgEr054895; Sat, 3 Nov 2012 22:13:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211032213.qA3MDgEr054895@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 22:13:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242528 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:13:43 -0000 Author: adrian Date: Sat Nov 3 22:13:42 2012 New Revision: 242528 URL: http://svn.freebsd.org/changeset/base/242528 Log: For AR9380 NICs - the non-enterprise versions don't support RTS protection of small (< 256 byte) aggregate frames. This needs to be done or 11n aggregation TX just simply doesn't work on these NICs. Whilst here, extend some debug printing; I was using this whilst debugging the TX power setup in the TX descriptor(s) on the AR9380. Modified: head/sys/dev/ath/if_ath_tx_ht.c Modified: head/sys/dev/ath/if_ath_tx_ht.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_ht.c Sat Nov 3 22:12:35 2012 (r242527) +++ head/sys/dev/ath/if_ath_tx_ht.c Sat Nov 3 22:13:42 2012 (r242528) @@ -349,6 +349,14 @@ ath_compute_num_delims(struct ath_softc */ ndelim += ATH_AGGR_ENCRYPTDELIM; + /* + * For AR9380, there's a minimum number of delimeters + * required when doing RTS. + */ + if (sc->sc_use_ent && (sc->sc_ent_cfg & AH_ENT_RTSCTS_DELIM_WAR) + && ndelim < AH_FIRST_DESC_NDELIMS) + ndelim = AH_FIRST_DESC_NDELIMS; + DPRINTF(sc, ATH_DEBUG_SW_TX_AGGR, "%s: pktlen=%d, ndelim=%d, mpdudensity=%d\n", __func__, pktlen, ndelim, mpdudensity); @@ -542,12 +550,13 @@ ath_rateseries_print(struct ath_softc *s int i; for (i = 0; i < ATH_RC_NUM; i++) { device_printf(sc->sc_dev ,"series %d: rate %x; tries %d; " - "pktDuration %d; chSel %d; rateFlags %x\n", + "pktDuration %d; chSel %d; txpowcap %d, rateFlags %x\n", i, series[i].Rate, series[i].Tries, series[i].PktDuration, series[i].ChSel, + series[i].tx_power_cap, series[i].RateFlags); } } @@ -577,7 +586,6 @@ ath_buf_set_rate(struct ath_softc *sc, s ath_rateseries_setup(sc, ni, bf, series); #if 0 - printf("pktlen: %d; flags 0x%x\n", pktlen, flags); ath_rateseries_print(sc, series); #endif From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:21:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7C85199F; Sat, 3 Nov 2012 22:21:38 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 639418FC0C; Sat, 3 Nov 2012 22:21:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3MLcRB056261; Sat, 3 Nov 2012 22:21:38 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3MLcVX056256; Sat, 3 Nov 2012 22:21:38 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201211032221.qA3MLcVX056256@svn.freebsd.org> From: Ed Schouten Date: Sat, 3 Nov 2012 22:21:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242529 - in head/sys: dev/syscons kern sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:21:38 -0000 Author: ed Date: Sat Nov 3 22:21:37 2012 New Revision: 242529 URL: http://svn.freebsd.org/changeset/base/242529 Log: Add tty_set_winsize(). This removes some of the signalling magic from the Syscons driver and puts it in the TTY layer, where it belongs. Modified: head/sys/dev/syscons/scvidctl.c head/sys/kern/tty.c head/sys/sys/tty.h Modified: head/sys/dev/syscons/scvidctl.c ============================================================================== --- head/sys/dev/syscons/scvidctl.c Sat Nov 3 22:13:42 2012 (r242528) +++ head/sys/dev/syscons/scvidctl.c Sat Nov 3 22:21:37 2012 (r242529) @@ -137,6 +137,7 @@ sc_set_text_mode(scr_stat *scp, struct t int fontsize, int fontwidth) { video_info_t info; + struct winsize wsz; u_char *font; int prev_ysize; int error; @@ -234,16 +235,9 @@ sc_set_text_mode(scr_stat *scp, struct t if (tp == NULL) return 0; - DPRINTF(5, ("ws_*size (%d,%d), size (%d,%d)\n", - tp->t_winsize.ws_col, tp->t_winsize.ws_row, scp->xsize, scp->ysize)); - if (tp->t_winsize.ws_col != scp->xsize - || tp->t_winsize.ws_row != scp->ysize) { - tp->t_winsize.ws_col = scp->xsize; - tp->t_winsize.ws_row = scp->ysize; - - tty_signal_pgrp(tp, SIGWINCH); - } - + wsz.ws_col = scp->xsize; + wsz.ws_row = scp->ysize; + tty_set_winsize(tp, &wsz); return 0; } @@ -254,6 +248,7 @@ sc_set_graphics_mode(scr_stat *scp, stru return ENODEV; #else video_info_t info; + struct winsize wsz; int error; int s; @@ -300,14 +295,9 @@ sc_set_graphics_mode(scr_stat *scp, stru if (tp == NULL) return 0; - if (tp->t_winsize.ws_xpixel != scp->xpixel - || tp->t_winsize.ws_ypixel != scp->ypixel) { - tp->t_winsize.ws_xpixel = scp->xpixel; - tp->t_winsize.ws_ypixel = scp->ypixel; - - tty_signal_pgrp(tp, SIGWINCH); - } - + wsz.ws_col = scp->xsize; + wsz.ws_row = scp->ysize; + tty_set_winsize(tp, &wsz); return 0; #endif /* SC_NO_MODE_CHANGE */ } @@ -320,7 +310,7 @@ sc_set_pixel_mode(scr_stat *scp, struct return ENODEV; #else video_info_t info; - ksiginfo_t ksi; + struct winsize wsz; u_char *font; int prev_ysize; int error; @@ -425,20 +415,9 @@ sc_set_pixel_mode(scr_stat *scp, struct if (tp == NULL) return 0; - if (tp->t_winsize.ws_col != scp->xsize - || tp->t_winsize.ws_row != scp->ysize) { - tp->t_winsize.ws_col = scp->xsize; - tp->t_winsize.ws_row = scp->ysize; - if (tp->t_pgrp != NULL) { - ksiginfo_init(&ksi); - ksi.ksi_signo = SIGWINCH; - ksi.ksi_code = SI_KERNEL; - PGRP_LOCK(tp->t_pgrp); - pgsignal(tp->t_pgrp, SIGWINCH, 1, &ksi); - PGRP_UNLOCK(tp->t_pgrp); - } - } - + wsz.ws_col = scp->xsize; + wsz.ws_row = scp->ysize; + tty_set_winsize(tp, &wsz); return 0; #endif /* SC_PIXEL_MODE */ } Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Sat Nov 3 22:13:42 2012 (r242528) +++ head/sys/kern/tty.c Sat Nov 3 22:21:37 2012 (r242529) @@ -1381,6 +1381,16 @@ tty_flush(struct tty *tp, int flags) } } +void +tty_set_winsize(struct tty *tp, const struct winsize *wsz) +{ + + if (memcmp(&tp->t_winsize, wsz, sizeof(*wsz)) == 0) + return; + tp->t_winsize = *wsz; + tty_signal_pgrp(tp, SIGWINCH); +} + static int tty_generic_ioctl(struct tty *tp, u_long cmd, void *data, int fflag, struct thread *td) @@ -1689,10 +1699,7 @@ tty_generic_ioctl(struct tty *tp, u_long return (0); case TIOCSWINSZ: /* Set window size. */ - if (bcmp(&tp->t_winsize, data, sizeof(struct winsize)) == 0) - return (0); - tp->t_winsize = *(struct winsize*)data; - tty_signal_pgrp(tp, SIGWINCH); + tty_set_winsize(tp, data); return (0); case TIOCEXCL: tp->t_flags |= TF_EXCLUDE; Modified: head/sys/sys/tty.h ============================================================================== --- head/sys/sys/tty.h Sat Nov 3 22:13:42 2012 (r242528) +++ head/sys/sys/tty.h Sat Nov 3 22:21:37 2012 (r242529) @@ -192,6 +192,7 @@ int tty_ioctl(struct tty *tp, u_long cmd struct thread *td); int tty_ioctl_compat(struct tty *tp, u_long cmd, caddr_t data, int fflag, struct thread *td); +void tty_set_winsize(struct tty *tp, const struct winsize *wsz); void tty_init_console(struct tty *tp, speed_t speed); void tty_flush(struct tty *tp, int flags); void tty_hiwat_in_block(struct tty *tp); From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:23:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 8D38BB1B; Sat, 3 Nov 2012 22:23:09 +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 739968FC14; Sat, 3 Nov 2012 22:23:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3MN9pv056536; Sat, 3 Nov 2012 22:23:09 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3MN9wh056534; Sat, 3 Nov 2012 22:23:09 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201211032223.qA3MN9wh056534@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 3 Nov 2012 22:23:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242530 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:23:09 -0000 Author: jilles Date: Sat Nov 3 22:23:08 2012 New Revision: 242530 URL: http://svn.freebsd.org/changeset/base/242530 Log: sh: Use C99 flexible array instead of accessing array beyond bounds. Although sufficient memory is available for a longer string in cmdname, this is undefined behaviour anyway. Side effect: for alignment reasons, an additional byte of memory is allocated per hashed command. Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sat Nov 3 22:21:37 2012 (r242529) +++ head/bin/sh/exec.c Sat Nov 3 22:23:08 2012 (r242530) @@ -78,7 +78,6 @@ __FBSDID("$FreeBSD$"); #define CMDTABLESIZE 31 /* should be prime */ -#define ARB 1 /* actual size determined at run time */ @@ -88,7 +87,7 @@ struct tblentry { int special; /* flag for special builtin commands */ short cmdtype; /* index identifying command */ char rehash; /* if set, cd done since entry created */ - char cmdname[ARB]; /* name of command */ + char cmdname[]; /* name of command */ }; @@ -563,7 +562,7 @@ cmdlookup(const char *name, int add) } if (add && cmdp == NULL) { INTOFF; - cmdp = *pp = ckmalloc(sizeof (struct tblentry) - ARB + cmdp = *pp = ckmalloc(sizeof (struct tblentry) + strlen(name) + 1); cmdp->next = NULL; cmdp->cmdtype = CMDUNKNOWN; From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:39:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3A81A585; Sat, 3 Nov 2012 22:39:08 +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 205D78FC0A; Sat, 3 Nov 2012 22:39:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3Md8Rv059023; Sat, 3 Nov 2012 22:39:08 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3Md7UN059019; Sat, 3 Nov 2012 22:39:07 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201211032239.qA3Md7UN059019@svn.freebsd.org> From: Andrew Turner Date: Sat, 3 Nov 2012 22:39:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242531 - in head/sys/arm: arm broadcom/bcm2835 include lpc mv tegra ti X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:39:08 -0000 Author: andrew Date: Sat Nov 3 22:39:07 2012 New Revision: 242531 URL: http://svn.freebsd.org/changeset/base/242531 Log: Merge the FDT versions of initarm. The copies of initarm used on platforms with FDT support were almost identical. The differences were pulled out into separate functions that were called by initarm. This change merges the, now identical, copies of initarm and a few of it's support functions. This is a step towards a common kernel on ARMv6. Modified: head/sys/arm/arm/machdep.c head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c head/sys/arm/include/machdep.h head/sys/arm/lpc/lpc_machdep.c head/sys/arm/mv/mv_machdep.c head/sys/arm/tegra/tegra2_machdep.c head/sys/arm/ti/ti_machdep.c Modified: head/sys/arm/arm/machdep.c ============================================================================== --- head/sys/arm/arm/machdep.c Sat Nov 3 22:23:08 2012 (r242530) +++ head/sys/arm/arm/machdep.c Sat Nov 3 22:39:07 2012 (r242531) @@ -44,6 +44,7 @@ #include "opt_compat.h" #include "opt_ddb.h" +#include "opt_platform.h" #include "opt_timer.h" #include @@ -59,11 +60,13 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include #include #include +#include #include #include #include @@ -94,6 +97,17 @@ __FBSDID("$FreeBSD$"); #include #include +#ifdef FDT +#include +#include +#endif + +#ifdef DEBUG +#define debugf(fmt, args...) printf(fmt, ##args) +#else +#define debugf(fmt, args...) +#endif + struct pcpu __pcpu[MAXCPU]; struct pcpu *pcpup = &__pcpu[0]; @@ -114,6 +128,35 @@ extern int *end; extern vm_offset_t ksym_start, ksym_end; #endif +#ifdef FDT +/* + * This is the number of L2 page tables required for covering max + * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, + * stacks etc.), uprounded to be divisible by 4. + */ +#define KERNEL_PT_MAX 78 + +static struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; + +vm_paddr_t phys_avail[10]; +vm_paddr_t dump_avail[4]; + +extern u_int data_abort_handler_address; +extern u_int prefetch_abort_handler_address; +extern u_int undefined_handler_address; + +vm_paddr_t pmap_pa; + +struct pv_addr systempage; +static struct pv_addr msgbufpv; +struct pv_addr irqstack; +struct pv_addr undstack; +struct pv_addr abtstack; +static struct pv_addr kernelstack; + +const struct pmap_devmap *pmap_devmap_bootstrap_table; +#endif + #if defined(LINUX_BOOT_ABI) #define LBABI_MAX_BANKS 10 @@ -961,3 +1004,411 @@ set_stackptrs(int cpu) undstack.pv_va + ((UND_STACK_SIZE * PAGE_SIZE) * (cpu + 1))); } +#ifdef FDT +static char * +kenv_next(char *cp) +{ + + if (cp != NULL) { + while (*cp != 0) + cp++; + cp++; + if (*cp == 0) + cp = NULL; + } + return (cp); +} + +static void +print_kenv(void) +{ + int len; + char *cp; + + debugf("loader passed (static) kenv:\n"); + if (kern_envp == NULL) { + debugf(" no env, null ptr\n"); + return; + } + debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); + + len = 0; + for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) + debugf(" %x %s\n", (uint32_t)cp, cp); +} + +static void +print_kernel_section_addr(void) +{ + + debugf("kernel image addresses:\n"); + debugf(" kernbase = 0x%08x\n", (uint32_t)kernbase); + debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); + debugf(" _edata = 0x%08x\n", (uint32_t)_edata); + debugf(" __bss_start = 0x%08x\n", (uint32_t)__bss_start); + debugf(" _end = 0x%08x\n", (uint32_t)_end); +} + +static void +physmap_init(struct mem_region *availmem_regions, int availmem_regions_sz) +{ + int i, j, cnt; + vm_offset_t phys_kernelend, kernload; + uint32_t s, e, sz; + struct mem_region *mp, *mp1; + + phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); + kernload = KERNPHYSADDR; + + /* + * Remove kernel physical address range from avail + * regions list. Page align all regions. + * Non-page aligned memory isn't very interesting to us. + * Also, sort the entries for ascending addresses. + */ + sz = 0; + cnt = availmem_regions_sz; + debugf("processing avail regions:\n"); + for (mp = availmem_regions; mp->mr_size; mp++) { + s = mp->mr_start; + e = mp->mr_start + mp->mr_size; + debugf(" %08x-%08x -> ", s, e); + /* Check whether this region holds all of the kernel. */ + if (s < kernload && e > phys_kernelend) { + availmem_regions[cnt].mr_start = phys_kernelend; + availmem_regions[cnt++].mr_size = e - phys_kernelend; + e = kernload; + } + /* Look whether this regions starts within the kernel. */ + if (s >= kernload && s < phys_kernelend) { + if (e <= phys_kernelend) + goto empty; + s = phys_kernelend; + } + /* Now look whether this region ends within the kernel. */ + if (e > kernload && e <= phys_kernelend) { + if (s >= kernload) { + goto empty; + } + e = kernload; + } + /* Now page align the start and size of the region. */ + s = round_page(s); + e = trunc_page(e); + if (e < s) + e = s; + sz = e - s; + debugf("%08x-%08x = %x\n", s, e, sz); + + /* Check whether some memory is left here. */ + if (sz == 0) { + empty: + printf("skipping\n"); + bcopy(mp + 1, mp, + (cnt - (mp - availmem_regions)) * sizeof(*mp)); + cnt--; + mp--; + continue; + } + + /* Do an insertion sort. */ + for (mp1 = availmem_regions; mp1 < mp; mp1++) + if (s < mp1->mr_start) + break; + if (mp1 < mp) { + bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); + mp1->mr_start = s; + mp1->mr_size = sz; + } else { + mp->mr_start = s; + mp->mr_size = sz; + } + } + availmem_regions_sz = cnt; + + /* Fill in phys_avail table, based on availmem_regions */ + debugf("fill in phys_avail:\n"); + for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { + + debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", + availmem_regions[i].mr_start, + availmem_regions[i].mr_start + availmem_regions[i].mr_size, + availmem_regions[i].mr_size); + + /* + * We should not map the page at PA 0x0000000, the VM can't + * handle it, as pmap_extract() == 0 means failure. + */ + if (availmem_regions[i].mr_start > 0 || + availmem_regions[i].mr_size > PAGE_SIZE) { + phys_avail[j] = availmem_regions[i].mr_start; + if (phys_avail[j] == 0) + phys_avail[j] += PAGE_SIZE; + phys_avail[j + 1] = availmem_regions[i].mr_start + + availmem_regions[i].mr_size; + } else + j -= 2; + } + phys_avail[j] = 0; + phys_avail[j + 1] = 0; +} + +void * +initarm(struct arm_boot_params *abp) +{ + struct mem_region availmem_regions[FDT_MEM_REGIONS]; + struct pv_addr kernel_l1pt; + struct pv_addr dpcpu; + vm_offset_t dtbp, freemempos, l2_start, lastaddr; + vm_offset_t pmap_bootstrap_lastaddr; + uint32_t memsize, l2size; + char *env; + void *kmdp; + u_int l1pagetable; + int i = 0, j = 0, err_devmap = 0; + int availmem_regions_sz; + + lastaddr = parse_boot_param(abp); + memsize = 0; + set_cpufuncs(); + + /* + * Find the dtb passed in by the boot loader. + */ + kmdp = preload_search_by_type("elf kernel"); + if (kmdp != NULL) + dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); + else + dtbp = (vm_offset_t)NULL; + +#if defined(FDT_DTB_STATIC) + /* + * In case the device tree blob was not retrieved (from metadata) try + * to use the statically embedded one. + */ + if (dtbp == (vm_offset_t)NULL) + dtbp = (vm_offset_t)&fdt_static_dtb; +#endif + + if (OF_install(OFW_FDT, 0) == FALSE) + while (1); + + if (OF_init((void *)dtbp) != 0) + while (1); + + /* Grab physical memory regions information from device tree. */ + if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz, + &memsize) != 0) + while(1); + + /* Platform-specific initialisation */ + pmap_bootstrap_lastaddr = initarm_lastaddr(); + + pcpu0_init(); + + /* Calculate number of L2 tables needed for mapping vm_page_array */ + l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); + l2size = (l2size >> L1_S_SHIFT) + 1; + + /* + * Add one table for end of kernel map, one for stacks, msgbuf and + * L1 and L2 tables map and one for vectors map. + */ + l2size += 3; + + /* Make it divisible by 4 */ + l2size = (l2size + 3) & ~3; + +#define KERNEL_TEXT_BASE (KERNBASE) + freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; + + /* Define a macro to simplify memory allocation */ +#define valloc_pages(var, np) \ + alloc_pages((var).pv_va, (np)); \ + (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); + +#define alloc_pages(var, np) \ + (var) = freemempos; \ + freemempos += (np * PAGE_SIZE); \ + memset((char *)(var), 0, ((np) * PAGE_SIZE)); + + while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) + freemempos += PAGE_SIZE; + valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); + + for (i = 0; i < l2size; ++i) { + if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { + valloc_pages(kernel_pt_table[i], + L2_TABLE_SIZE / PAGE_SIZE); + j = i; + } else { + kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va + + L2_TABLE_SIZE_REAL * (i - j); + kernel_pt_table[i].pv_pa = + kernel_pt_table[i].pv_va - KERNVIRTADDR + + KERNPHYSADDR; + + } + } + /* + * Allocate a page for the system page mapped to 0x00000000 + * or 0xffff0000. This page will just contain the system vectors + * and can be shared by all processes. + */ + valloc_pages(systempage, 1); + + /* Allocate dynamic per-cpu area. */ + valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); + dpcpu_init((void *)dpcpu.pv_va, 0); + + /* Allocate stacks for all modes */ + valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); + valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); + valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); + valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); + + init_param1(); + + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); + + /* + * Now we start construction of the L1 page table + * We start by mapping the L2 page tables into the L1. + * This means that we can replace L1 mappings later on if necessary + */ + l1pagetable = kernel_l1pt.pv_va; + + /* + * Try to map as much as possible of kernel text and data using + * 1MB section mapping and for the rest of initial kernel address + * space use L2 coarse tables. + * + * Link L2 tables for mapping remainder of kernel (modulo 1MB) + * and kernel structures + */ + l2_start = lastaddr & ~(L1_S_OFFSET); + for (i = 0 ; i < l2size - 1; i++) + pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE, + &kernel_pt_table[i]); + + pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; + + /* Map kernel code and data */ + pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, + (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + + + /* Map L1 directory and allocated L2 page tables */ + pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, + L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); + + pmap_map_chunk(l1pagetable, kernel_pt_table[0].pv_va, + kernel_pt_table[0].pv_pa, + L2_TABLE_SIZE_REAL * l2size, + VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); + + /* Map allocated DPCPU, stacks and msgbuf */ + pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, + freemempos - dpcpu.pv_va, + VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); + + /* Link and map the vector page */ + pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, + &kernel_pt_table[l2size - 1]); + pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, + VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); + + /* Map pmap_devmap[] entries */ + err_devmap = platform_devmap_init(); + pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); + + cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | + DOMAIN_CLIENT); + pmap_pa = kernel_l1pt.pv_pa; + setttb(kernel_l1pt.pv_pa); + cpu_tlb_flushID(); + cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); + + /* + * Only after the SOC registers block is mapped we can perform device + * tree fixups, as they may attempt to read parameters from hardware. + */ + OF_interpret("perform-fixup", 0); + + initarm_gpio_init(); + + cninit(); + + physmem = memsize / PAGE_SIZE; + + debugf("initarm: console initialized\n"); + debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); + debugf(" boothowto = 0x%08x\n", boothowto); + debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); + print_kernel_section_addr(); + print_kenv(); + + env = getenv("kernelname"); + if (env != NULL) + strlcpy(kernelname, env, sizeof(kernelname)); + + if (err_devmap != 0) + printf("WARNING: could not fully configure devmap, error=%d\n", + err_devmap); + + initarm_late_init(); + + /* + * Pages were allocated during the secondary bootstrap for the + * stacks for different CPU modes. + * We must now set the r13 registers in the different CPU modes to + * point to these stacks. + * Since the ARM stacks use STMFD etc. we must set r13 to the top end + * of the stack memory. + */ + cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); + + set_stackptrs(0); + + /* + * We must now clean the cache again.... + * Cleaning may be done by reading new data to displace any + * dirty data in the cache. This will have happened in setttb() + * but since we are boot strapping the addresses used for the read + * may have just been remapped and thus the cache could be out + * of sync. A re-clean after the switch will cure this. + * After booting there are no gross relocations of the kernel thus + * this problem will not occur after initarm(). + */ + cpu_idcache_wbinv_all(); + + /* Set stack for exception handlers */ + data_abort_handler_address = (u_int)data_abort_handler; + prefetch_abort_handler_address = (u_int)prefetch_abort_handler; + undefined_handler_address = (u_int)undefinedinstruction_bounce; + undefined_init(); + + init_proc0(kernelstack.pv_va); + + arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); + arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); + pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); + msgbufp = (void *)msgbufpv.pv_va; + msgbufinit(msgbufp, msgbufsize); + mutex_init(); + + /* + * Prepare map of physical memory regions available to vm subsystem. + */ + physmap_init(availmem_regions, availmem_regions_sz); + + /* Do basic tuning, hz etc */ + init_param2(physmem); + kdb_init(); + + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - + sizeof(struct pcb))); +} +#endif + Modified: head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c ============================================================================== --- head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Nov 3 22:23:08 2012 (r242530) +++ head/sys/arm/broadcom/bcm2835/bcm2835_machdep.c Sat Nov 3 22:39:07 2012 (r242531) @@ -46,514 +46,23 @@ __FBSDID("$FreeBSD$"); #define _ARM32_BUS_DMA_PRIVATE #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include - -#include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include + #include -#include +#include /* For trapframe_t, used in */ +#include +#include -#include +#include -#define DEBUG -#ifdef DEBUG -#define debugf(fmt, args...) printf(fmt, ##args) -#else -#define debugf(fmt, args...) -#endif +#include /* Start of address space used for bootstrap map */ #define DEVMAP_BOOTSTRAP_MAP_START 0xE0000000 -/* - * This is the number of L2 page tables required for covering max - * (hypothetical) memsize of 4GB and all kernel mappings (vectors, msgbuf, - * stacks etc.), uprounded to be divisible by 4. - */ -#define KERNEL_PT_MAX 78 - -extern unsigned char kernbase[]; -extern unsigned char _etext[]; -extern unsigned char _edata[]; -extern unsigned char __bss_start[]; -extern unsigned char _end[]; - -#ifdef DDB -extern vm_offset_t ksym_start, ksym_end; -#endif - -extern u_int data_abort_handler_address; -extern u_int prefetch_abort_handler_address; -extern u_int undefined_handler_address; - -extern vm_offset_t pmap_bootstrap_lastaddr; -extern int *end; - -struct pv_addr kernel_pt_table[KERNEL_PT_MAX]; - -/* Physical and virtual addresses for some global pages */ -vm_paddr_t phys_avail[10]; -vm_paddr_t dump_avail[4]; -vm_offset_t physical_pages; -vm_offset_t pmap_bootstrap_lastaddr; -vm_paddr_t pmap_pa; - -const struct pmap_devmap *pmap_devmap_bootstrap_table; -struct pv_addr systempage; -struct pv_addr msgbufpv; -struct pv_addr irqstack; -struct pv_addr undstack; -struct pv_addr abtstack; -struct pv_addr kernelstack; - -static struct mem_region availmem_regions[FDT_MEM_REGIONS]; -static int availmem_regions_sz; - -static void print_kenv(void); -static void print_kernel_section_addr(void); - -static void physmap_init(void); -static int platform_devmap_init(void); - -static char * -kenv_next(char *cp) -{ - - if (cp != NULL) { - while (*cp != 0) - cp++; - cp++; - if (*cp == 0) - cp = NULL; - } - return (cp); -} - -static void -print_kenv(void) -{ - int len; - char *cp; - - debugf("loader passed (static) kenv:\n"); - if (kern_envp == NULL) { - debugf(" no env, null ptr\n"); - return; - } - debugf(" kern_envp = 0x%08x\n", (uint32_t)kern_envp); - - len = 0; - for (cp = kern_envp; cp != NULL; cp = kenv_next(cp)) - debugf(" %x %s\n", (uint32_t)cp, cp); -} - -static void -print_kernel_section_addr(void) -{ - - debugf("kernel image addresses:\n"); - debugf(" kernbase = 0x%08x\n", (uint32_t)kernbase); - debugf(" _etext (sdata) = 0x%08x\n", (uint32_t)_etext); - debugf(" _edata = 0x%08x\n", (uint32_t)_edata); - debugf(" __bss_start = 0x%08x\n", (uint32_t)__bss_start); - debugf(" _end = 0x%08x\n", (uint32_t)_end); -} - -static void -physmap_init(void) -{ - int i, j, cnt; - vm_offset_t phys_kernelend, kernload; - uint32_t s, e, sz; - struct mem_region *mp, *mp1; - - phys_kernelend = KERNPHYSADDR + (virtual_avail - KERNVIRTADDR); - kernload = KERNPHYSADDR; - - /* - * Remove kernel physical address range from avail - * regions list. Page align all regions. - * Non-page aligned memory isn't very interesting to us. - * Also, sort the entries for ascending addresses. - */ - sz = 0; - cnt = availmem_regions_sz; - debugf("processing avail regions:\n"); - for (mp = availmem_regions; mp->mr_size; mp++) { - s = mp->mr_start; - e = mp->mr_start + mp->mr_size; - debugf(" %08x-%08x -> ", s, e); - /* Check whether this region holds all of the kernel. */ - if (s < kernload && e > phys_kernelend) { - availmem_regions[cnt].mr_start = phys_kernelend; - availmem_regions[cnt++].mr_size = e - phys_kernelend; - e = kernload; - } - /* Look whether this regions starts within the kernel. */ - if (s >= kernload && s < phys_kernelend) { - if (e <= phys_kernelend) - goto empty; - s = phys_kernelend; - } - /* Now look whether this region ends within the kernel. */ - if (e > kernload && e <= phys_kernelend) { - if (s >= kernload) { - goto empty; - } - e = kernload; - } - /* Now page align the start and size of the region. */ - s = round_page(s); - e = trunc_page(e); - if (e < s) - e = s; - sz = e - s; - debugf("%08x-%08x = %x\n", s, e, sz); - - /* Check whether some memory is left here. */ - if (sz == 0) { - empty: - printf("skipping\n"); - bcopy(mp + 1, mp, - (cnt - (mp - availmem_regions)) * sizeof(*mp)); - cnt--; - mp--; - continue; - } - - /* Do an insertion sort. */ - for (mp1 = availmem_regions; mp1 < mp; mp1++) - if (s < mp1->mr_start) - break; - if (mp1 < mp) { - bcopy(mp1, mp1 + 1, (char *)mp - (char *)mp1); - mp1->mr_start = s; - mp1->mr_size = sz; - } else { - mp->mr_start = s; - mp->mr_size = sz; - } - } - availmem_regions_sz = cnt; - - /* Fill in phys_avail table, based on availmem_regions */ - debugf("fill in phys_avail:\n"); - for (i = 0, j = 0; i < availmem_regions_sz; i++, j += 2) { - - debugf(" region: 0x%08x - 0x%08x (0x%08x)\n", - availmem_regions[i].mr_start, - availmem_regions[i].mr_start + availmem_regions[i].mr_size, - availmem_regions[i].mr_size); - - /* - * We should not map the page at PA 0x0000000, the VM can't - * handle it, as pmap_extract() == 0 means failure. - */ - if (availmem_regions[i].mr_start > 0 || - availmem_regions[i].mr_size > PAGE_SIZE) { - phys_avail[j] = availmem_regions[i].mr_start; - if (phys_avail[j] == 0) - phys_avail[j] += PAGE_SIZE; - phys_avail[j + 1] = availmem_regions[i].mr_start + - availmem_regions[i].mr_size; - } else - j -= 2; - } - phys_avail[j] = 0; - phys_avail[j + 1] = 0; -} - -void * -initarm(struct arm_boot_params *abp) -{ - struct pv_addr kernel_l1pt; - struct pv_addr dpcpu; - vm_offset_t dtbp, freemempos, l2_start, lastaddr; - uint32_t memsize, l2size; - char *env; - void *kmdp; - u_int l1pagetable; - int i = 0, j = 0, err_devmap = 0; - - lastaddr = parse_boot_param(abp); - memsize = 0; - set_cpufuncs(); - - /* - * Find the dtb passed in by the boot loader. - */ - kmdp = preload_search_by_type("elf kernel"); - if (kmdp != NULL) - dtbp = MD_FETCH(kmdp, MODINFOMD_DTBP, vm_offset_t); - else - dtbp = (vm_offset_t)NULL; - -#if defined(FDT_DTB_STATIC) - /* - * In case the device tree blob was not retrieved (from metadata) try - * to use the statically embedded one. - */ - if (dtbp == (vm_offset_t)NULL) - dtbp = (vm_offset_t)&fdt_static_dtb; -#endif - - if (OF_install(OFW_FDT, 0) == FALSE) - while (1); - - if (OF_init((void *)dtbp) != 0) - while (1); - - /* Grab physical memory regions information from device tree. */ - if (fdt_get_mem_regions(availmem_regions, &availmem_regions_sz, - &memsize) != 0) - while(1); - - /* Platform-specific initialisation */ - pmap_bootstrap_lastaddr = initarm_lastaddr(); - - pcpu0_init(); - - /* Calculate number of L2 tables needed for mapping vm_page_array */ - l2size = (memsize / PAGE_SIZE) * sizeof(struct vm_page); - l2size = (l2size >> L1_S_SHIFT) + 1; - - /* - * Add one table for end of kernel map, one for stacks, msgbuf and - * L1 and L2 tables map and one for vectors map. - */ - l2size += 3; - - /* Make it divisible by 4 */ - l2size = (l2size + 3) & ~3; - -#define KERNEL_TEXT_BASE (KERNBASE) - freemempos = (lastaddr + PAGE_MASK) & ~PAGE_MASK; - - /* Define a macro to simplify memory allocation */ -#define valloc_pages(var, np) \ - alloc_pages((var).pv_va, (np)); \ - (var).pv_pa = (var).pv_va + (KERNPHYSADDR - KERNVIRTADDR); - -#define alloc_pages(var, np) \ - (var) = freemempos; \ - freemempos += (np * PAGE_SIZE); \ - memset((char *)(var), 0, ((np) * PAGE_SIZE)); - - while (((freemempos - L1_TABLE_SIZE) & (L1_TABLE_SIZE - 1)) != 0) - freemempos += PAGE_SIZE; - valloc_pages(kernel_l1pt, L1_TABLE_SIZE / PAGE_SIZE); - - for (i = 0; i < l2size; ++i) { - if (!(i % (PAGE_SIZE / L2_TABLE_SIZE_REAL))) { - valloc_pages(kernel_pt_table[i], - L2_TABLE_SIZE / PAGE_SIZE); - j = i; - } else { - kernel_pt_table[i].pv_va = kernel_pt_table[j].pv_va + - L2_TABLE_SIZE_REAL * (i - j); - kernel_pt_table[i].pv_pa = - kernel_pt_table[i].pv_va - KERNVIRTADDR + - KERNPHYSADDR; - - } - } - /* - * Allocate a page for the system page mapped to 0x00000000 - * or 0xffff0000. This page will just contain the system vectors - * and can be shared by all processes. - */ - valloc_pages(systempage, 1); - - /* Allocate dynamic per-cpu area. */ - valloc_pages(dpcpu, DPCPU_SIZE / PAGE_SIZE); - dpcpu_init((void *)dpcpu.pv_va, 0); - - /* Allocate stacks for all modes */ - valloc_pages(irqstack, (IRQ_STACK_SIZE * MAXCPU)); - valloc_pages(abtstack, (ABT_STACK_SIZE * MAXCPU)); - valloc_pages(undstack, (UND_STACK_SIZE * MAXCPU)); - valloc_pages(kernelstack, (KSTACK_PAGES * MAXCPU)); - - init_param1(); - - valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); - - /* - * Now we start construction of the L1 page table - * We start by mapping the L2 page tables into the L1. - * This means that we can replace L1 mappings later on if necessary - */ - l1pagetable = kernel_l1pt.pv_va; - - /* - * Try to map as much as possible of kernel text and data using - * 1MB section mapping and for the rest of initial kernel address - * space use L2 coarse tables. - * - * Link L2 tables for mapping remainder of kernel (modulo 1MB) - * and kernel structures - */ - l2_start = lastaddr & ~(L1_S_OFFSET); - for (i = 0 ; i < l2size - 1; i++) - pmap_link_l2pt(l1pagetable, l2_start + i * L1_S_SIZE, - &kernel_pt_table[i]); - - pmap_curmaxkvaddr = l2_start + (l2size - 1) * L1_S_SIZE; - - /* Map kernel code and data */ - pmap_map_chunk(l1pagetable, KERNVIRTADDR, KERNPHYSADDR, - (((uint32_t)(lastaddr) - KERNVIRTADDR) + PAGE_MASK) & ~PAGE_MASK, - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - - - /* Map L1 directory and allocated L2 page tables */ - pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, - L1_TABLE_SIZE, VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); - - pmap_map_chunk(l1pagetable, kernel_pt_table[0].pv_va, - kernel_pt_table[0].pv_pa, - L2_TABLE_SIZE_REAL * l2size, - VM_PROT_READ|VM_PROT_WRITE, PTE_PAGETABLE); - - /* Map allocated DPCPU, stacks and msgbuf */ - pmap_map_chunk(l1pagetable, dpcpu.pv_va, dpcpu.pv_pa, - freemempos - dpcpu.pv_va, - VM_PROT_READ|VM_PROT_WRITE, PTE_CACHE); - - /* Link and map the vector page */ - pmap_link_l2pt(l1pagetable, ARM_VECTORS_HIGH, - &kernel_pt_table[l2size - 1]); - pmap_map_entry(l1pagetable, ARM_VECTORS_HIGH, systempage.pv_pa, - VM_PROT_READ|VM_PROT_WRITE|VM_PROT_EXECUTE, PTE_CACHE); - - /* Map pmap_devmap[] entries */ - err_devmap = platform_devmap_init(); - pmap_devmap_bootstrap(l1pagetable, pmap_devmap_bootstrap_table); - - cpu_domains((DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)) | - DOMAIN_CLIENT); - pmap_pa = kernel_l1pt.pv_pa; - setttb(kernel_l1pt.pv_pa); - cpu_tlb_flushID(); - cpu_domains(DOMAIN_CLIENT << (PMAP_DOMAIN_KERNEL * 2)); - - /* - * Only after the SOC registers block is mapped we can perform device - * tree fixups, as they may attempt to read parameters from hardware. - */ - OF_interpret("perform-fixup", 0); - - initarm_gpio_init(); - - cninit(); - - physmem = memsize / PAGE_SIZE; - - debugf("initarm: console initialized\n"); - debugf(" arg1 kmdp = 0x%08x\n", (uint32_t)kmdp); - debugf(" boothowto = 0x%08x\n", boothowto); - debugf(" dtbp = 0x%08x\n", (uint32_t)dtbp); - print_kernel_section_addr(); - print_kenv(); - - env = getenv("kernelname"); - if (env != NULL) - strlcpy(kernelname, env, sizeof(kernelname)); - - if (err_devmap != 0) - printf("WARNING: could not fully configure devmap, error=%d\n", - err_devmap); - - initarm_late_init(); - - /* - * Pages were allocated during the secondary bootstrap for the - * stacks for different CPU modes. - * We must now set the r13 registers in the different CPU modes to - * point to these stacks. - * Since the ARM stacks use STMFD etc. we must set r13 to the top end - * of the stack memory. - */ - cpu_control(CPU_CONTROL_MMU_ENABLE, CPU_CONTROL_MMU_ENABLE); - - set_stackptrs(0); - - /* - * We must now clean the cache again.... - * Cleaning may be done by reading new data to displace any - * dirty data in the cache. This will have happened in setttb() - * but since we are boot strapping the addresses used for the read - * may have just been remapped and thus the cache could be out - * of sync. A re-clean after the switch will cure this. - * After booting there are no gross relocations of the kernel thus - * this problem will not occur after initarm(). - */ - cpu_idcache_wbinv_all(); - - /* Set stack for exception handlers */ - data_abort_handler_address = (u_int)data_abort_handler; - prefetch_abort_handler_address = (u_int)prefetch_abort_handler; - undefined_handler_address = (u_int)undefinedinstruction_bounce; - undefined_init(); - - init_proc0(kernelstack.pv_va); - - arm_vector_init(ARM_VECTORS_HIGH, ARM_VEC_ALL); - arm_dump_avail_init(memsize, sizeof(dump_avail) / sizeof(dump_avail[0])); - pmap_bootstrap(freemempos, pmap_bootstrap_lastaddr, &kernel_l1pt); - msgbufp = (void *)msgbufpv.pv_va; - msgbufinit(msgbufp, msgbufsize); - mutex_init(); - - /* - * Prepare map of physical memory regions available to vm subsystem. - */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 22:54:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42A60B77; Sat, 3 Nov 2012 22:54: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 119FF8FC12; Sat, 3 Nov 2012 22:54:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3MsgU5061299; Sat, 3 Nov 2012 22:54:42 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3Msg4v061297; Sat, 3 Nov 2012 22:54:42 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201211032254.qA3Msg4v061297@svn.freebsd.org> From: Adrian Chadd Date: Sat, 3 Nov 2012 22:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242532 - head/sys/dev/ath X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 22:54:43 -0000 Author: adrian Date: Sat Nov 3 22:54:42 2012 New Revision: 242532 URL: http://svn.freebsd.org/changeset/base/242532 Log: EDMA TX tweaks: * don't poke ath_hal_txstart() if nothing was pushed into the FIFO during the refill process; * shuffle around the TX debugging output a little so it's logged at TX hardware enqueue; * Add logging of the TX status processing. Modified: head/sys/dev/ath/if_ath_tx_edma.c Modified: head/sys/dev/ath/if_ath_tx_edma.c ============================================================================== --- head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:39:07 2012 (r242531) +++ head/sys/dev/ath/if_ath_tx_edma.c Sat Nov 3 22:54:42 2012 (r242532) @@ -134,6 +134,7 @@ static void ath_edma_tx_fifo_fill(struct ath_softc *sc, struct ath_txq *txq) { struct ath_buf *bf; + int i = 0; ATH_TXQ_LOCK_ASSERT(txq); @@ -143,9 +144,15 @@ ath_edma_tx_fifo_fill(struct ath_softc * if (txq->axq_fifo_depth >= HAL_TXFIFO_DEPTH) break; ath_hal_puttxbuf(sc->sc_ah, txq->axq_qnum, bf->bf_daddr); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, i, 0); +#endif txq->axq_fifo_depth++; + i++; } - ath_hal_txstart(sc->sc_ah, txq->axq_qnum); + if (i > 0) + ath_hal_txstart(sc->sc_ah, txq->axq_qnum); } /* @@ -208,13 +215,12 @@ ath_edma_xmit_handoff_hw(struct ath_soft /* Push and update frame stats */ ATH_TXQ_INSERT_TAIL(txq, bf, bf_list); -#ifdef ATH_DEBUG - if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) - ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); -#endif /* ATH_DEBUG */ - /* Only schedule to the FIFO if there's space */ if (txq->axq_fifo_depth < HAL_TXFIFO_DEPTH) { +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_XMIT_DESC) + ath_printtxbuf(sc, bf, txq->axq_qnum, 0, 0); +#endif /* ATH_DEBUG */ ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr); txq->axq_fifo_depth++; ath_hal_txstart(ah, txq->axq_qnum); @@ -428,17 +434,30 @@ ath_edma_tx_proc(void *arg, int npending struct ath_buf *bf; struct ieee80211_node *ni; int nacked = 0; + int idx; + +#ifdef ATH_DEBUG + /* XXX */ + uint32_t txstatus[32]; +#endif DPRINTF(sc, ATH_DEBUG_TX_PROC, "%s: called, npending=%d\n", __func__, npending); - for (;;) { + for (idx = 0; ; idx++) { bzero(&ts, sizeof(ts)); ATH_TXSTATUS_LOCK(sc); status = ath_hal_txprocdesc(ah, NULL, (void *) &ts); + ath_hal_gettxrawtxdesc(ah, txstatus); ATH_TXSTATUS_UNLOCK(sc); +#ifdef ATH_DEBUG + if (sc->sc_debug & ATH_DEBUG_TX_PROC) + ath_printtxstatbuf(sc, NULL, txstatus, ts.ts_queue_id, + idx, (status == HAL_OK)); +#endif + if (status == HAL_EINPROGRESS) break; @@ -482,6 +501,8 @@ ath_edma_tx_proc(void *arg, int npending __func__, ts.ts_queue_id, bf); + /* XXX TODO: actually output debugging info about this */ + #if 0 /* XXX assert the buffer/descriptor matches the status descid */ if (ts.ts_desc_id != bf->bf_descid) { From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 23:03:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5703F38F; Sat, 3 Nov 2012 23:03:15 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3CF268FC14; Sat, 3 Nov 2012 23:03:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3N3FxW062699; Sat, 3 Nov 2012 23:03:15 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3N3EJV062691; Sat, 3 Nov 2012 23:03:14 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211032303.qA3N3EJV062691@svn.freebsd.org> From: Attilio Rao Date: Sat, 3 Nov 2012 23:03:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242534 - in head/sys: amd64/amd64 i386/i386 ia64/ia64 mips/mips powerpc/aim sparc64/include sparc64/sparc64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 23:03:15 -0000 Author: attilio Date: Sat Nov 3 23:03:14 2012 New Revision: 242534 URL: http://svn.freebsd.org/changeset/base/242534 Log: Rework the known rwlock to benefit about staying on their own cache line in order to avoid manual frobbing but using struct rwlock_padalign. Reviewed by: alc, jimharris Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/pmap.c head/sys/ia64/ia64/pmap.c head/sys/mips/mips/pmap.c head/sys/powerpc/aim/mmu_oea.c head/sys/sparc64/include/pmap.h head/sys/sparc64/sparc64/pmap.c Modified: head/sys/amd64/amd64/pmap.c ============================================================================== --- head/sys/amd64/amd64/pmap.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/amd64/amd64/pmap.c Sat Nov 3 23:03:14 2012 (r242534) @@ -225,16 +225,7 @@ u_int64_t KPML4phys; /* phys addr of ke static u_int64_t DMPDphys; /* phys addr of direct mapped level 2 */ static u_int64_t DMPDPphys; /* phys addr of direct mapped level 3 */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#define pvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/i386/i386/pmap.c ============================================================================== --- head/sys/i386/i386/pmap.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/i386/i386/pmap.c Sat Nov 3 23:03:14 2012 (r242534) @@ -224,16 +224,7 @@ SYSCTL_INT(_vm_pmap, OID_AUTO, pg_ps_ena #define PAT_INDEX_SIZE 8 static int pat_index[PAT_INDEX_SIZE]; /* cache mode to PAT index conversion */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#define pvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/ia64/ia64/pmap.c ============================================================================== --- head/sys/ia64/ia64/pmap.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/ia64/ia64/pmap.c Sat Nov 3 23:03:14 2012 (r242534) @@ -214,16 +214,7 @@ static int pmap_ridmax; static uint64_t *pmap_ridmap; struct mtx pmap_ridmutex; -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#define pvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/mips/mips/pmap.c ============================================================================== --- head/sys/mips/mips/pmap.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/mips/mips/pmap.c Sat Nov 3 23:03:14 2012 (r242534) @@ -148,16 +148,7 @@ vm_offset_t kernel_vm_end = VM_MIN_KERNE static void pmap_asid_alloc(pmap_t pmap); -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#define pvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; /* * Data for the pv entry allocation mechanism Modified: head/sys/powerpc/aim/mmu_oea.c ============================================================================== --- head/sys/powerpc/aim/mmu_oea.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/powerpc/aim/mmu_oea.c Sat Nov 3 23:03:14 2012 (r242534) @@ -200,16 +200,7 @@ struct pvo_head *moea_pvo_table; /* pvo struct pvo_head moea_pvo_kunmanaged = LIST_HEAD_INITIALIZER(moea_pvo_kunmanaged); /* list of unmanaged pages */ -/* - * Isolate the global pv list lock from data and other locks to prevent false - * sharing within the cache. - */ -static struct { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -} pvh_global __aligned(CACHE_LINE_SIZE); - -#define pvh_global_lock pvh_global.lock +static struct rwlock_padalign pvh_global_lock; uma_zone_t moea_upvo_zone; /* zone for pvo entries for unmanaged pages */ uma_zone_t moea_mpvo_zone; /* zone for pvo entries for managed pages */ Modified: head/sys/sparc64/include/pmap.h ============================================================================== --- head/sys/sparc64/include/pmap.h Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/sparc64/include/pmap.h Sat Nov 3 23:03:14 2012 (r242534) @@ -68,11 +68,6 @@ struct pmap { struct pmap_statistics pm_stats; }; -struct tte_list_lock { - struct rwlock lock; - char padding[CACHE_LINE_SIZE - sizeof(struct rwlock)]; -}; - #define PMAP_LOCK(pmap) mtx_lock(&(pmap)->pm_mtx) #define PMAP_LOCK_ASSERT(pmap, type) \ mtx_assert(&(pmap)->pm_mtx, (type)) @@ -108,8 +103,7 @@ void pmap_set_kctx(void); extern struct pmap kernel_pmap_store; #define kernel_pmap (&kernel_pmap_store) -extern struct tte_list_lock tte_list_global; -#define tte_list_global_lock tte_list_global.lock +extern struct rwlock_padalign tte_list_global_lock; extern vm_paddr_t phys_avail[]; extern vm_offset_t virtual_avail; extern vm_offset_t virtual_end; Modified: head/sys/sparc64/sparc64/pmap.c ============================================================================== --- head/sys/sparc64/sparc64/pmap.c Sat Nov 3 23:00:05 2012 (r242533) +++ head/sys/sparc64/sparc64/pmap.c Sat Nov 3 23:03:14 2012 (r242534) @@ -129,12 +129,7 @@ vm_offset_t vm_max_kernel_address; */ struct pmap kernel_pmap_store; -/* - * Isolate the global TTE list lock from data and other locks to prevent - * false sharing within the cache (see also the declaration of struct - * tte_list_lock). - */ -struct tte_list_lock tte_list_global __aligned(CACHE_LINE_SIZE); +struct rwlock_padalign tte_list_global_lock; /* * Allocate physical memory for use in pmap_bootstrap. From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 23:22:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 52F039BC; Sat, 3 Nov 2012 23:22:50 +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 3854F8FC0C; Sat, 3 Nov 2012 23:22:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3NMo8p065890; Sat, 3 Nov 2012 23:22:50 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3NMoYa065888; Sat, 3 Nov 2012 23:22:50 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201211032322.qA3NMoYa065888@svn.freebsd.org> From: Alan Cox Date: Sat, 3 Nov 2012 23:22:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242535 - head/sys/powerpc/booke X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 23:22:50 -0000 Author: alc Date: Sat Nov 3 23:22:49 2012 New Revision: 242535 URL: http://svn.freebsd.org/changeset/base/242535 Log: Replace all uses of the page queues lock by a R/W lock that is private to this pmap. Eliminate two redundant #include's. Tested by: marcel Modified: head/sys/powerpc/booke/pmap.c Modified: head/sys/powerpc/booke/pmap.c ============================================================================== --- head/sys/powerpc/booke/pmap.c Sat Nov 3 23:03:14 2012 (r242534) +++ head/sys/powerpc/booke/pmap.c Sat Nov 3 23:22:49 2012 (r242535) @@ -51,7 +51,6 @@ #include __FBSDID("$FreeBSD$"); -#include #include #include #include @@ -64,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -85,7 +85,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include #include @@ -214,6 +213,8 @@ static inline unsigned int tlb0_tableidx /* Page table management */ /**************************************************************************/ +static struct rwlock_padalign pvh_global_lock; + /* Data for the pv entry allocation mechanism */ static uma_zone_t pvzone; static struct vm_object pvzone_obj; @@ -551,9 +552,9 @@ ptbl_alloc(mmu_t mmu, pmap_t pmap, unsig VM_ALLOC_NOOBJ | VM_ALLOC_WIRED)) == NULL) { PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); VM_WAIT; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); } mtbl[i] = m; @@ -743,7 +744,7 @@ pv_insert(pmap_t pmap, vm_offset_t va, v /* add to pv_list */ PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); TAILQ_INSERT_TAIL(&m->md.pv_list, pve, pv_link); @@ -760,7 +761,7 @@ pv_remove(pmap_t pmap, vm_offset_t va, v //debugf("pv_remove: s (su = %d pmap = 0x%08x va = 0x%08x)\n", su, (u_int32_t)pmap, va); PMAP_LOCK_ASSERT(pmap, MA_OWNED); - mtx_assert(&vm_page_queue_mtx, MA_OWNED); + rw_assert(&pvh_global_lock, RA_WLOCKED); /* find pv entry */ TAILQ_FOREACH(pve, &m->md.pv_list, pv_link) { @@ -1239,6 +1240,11 @@ mmu_booke_bootstrap(mmu_t mmu, vm_offset /* Mark kernel_pmap active on all CPUs */ CPU_FILL(&kernel_pmap->pm_active); + /* + * Initialize the global pv list lock. + */ + rw_init(&pvh_global_lock, "pmap pv global"); + /*******************************************************/ /* Final setup */ /*******************************************************/ @@ -1522,10 +1528,10 @@ mmu_booke_enter(mmu_t mmu, pmap_t pmap, vm_prot_t prot, boolean_t wired) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot, wired); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1711,14 +1717,14 @@ mmu_booke_enter_object(mmu_t mmu, pmap_t psize = atop(end - start); m = m_start; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); while (m != NULL && (diff = m->pindex - m_start->pindex) < psize) { mmu_booke_enter_locked(mmu, pmap, start + ptoa(diff), m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); m = TAILQ_NEXT(m, listq); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1727,11 +1733,11 @@ mmu_booke_enter_quick(mmu_t mmu, pmap_t vm_prot_t prot) { - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); mmu_booke_enter_locked(mmu, pmap, va, m, prot & (VM_PROT_READ | VM_PROT_EXECUTE), FALSE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); PMAP_UNLOCK(pmap); } @@ -1768,7 +1774,7 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, hold_flag = PTBL_HOLD_FLAG(pmap); //debugf("mmu_booke_remove: hold_flag = %d\n", hold_flag); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); PMAP_LOCK(pmap); for (; va < endva; va += PAGE_SIZE) { pte = pte_find(mmu, pmap, va); @@ -1776,7 +1782,7 @@ mmu_booke_remove(mmu_t mmu, pmap_t pmap, pte_remove(mmu, pmap, va, hold_flag); } PMAP_UNLOCK(pmap); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); //debugf("mmu_booke_remove: e\n"); } @@ -1790,7 +1796,7 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ pv_entry_t pv, pvn; uint8_t hold_flag; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); for (pv = TAILQ_FIRST(&m->md.pv_list); pv != NULL; pv = pvn) { pvn = TAILQ_NEXT(pv, pv_link); @@ -1800,7 +1806,7 @@ mmu_booke_remove_all(mmu_t mmu, vm_page_ PMAP_UNLOCK(pv->pv_pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -1958,7 +1964,7 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL) { @@ -1982,7 +1988,7 @@ mmu_booke_remove_write(mmu_t mmu, vm_pag PMAP_UNLOCK(pv->pv_pmap); } vm_page_aflag_clear(m, PGA_WRITEABLE); - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } static void @@ -1998,7 +2004,7 @@ mmu_booke_sync_icache(mmu_t mmu, pmap_t va = trunc_page(va); sz = round_page(sz); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); pmap = PCPU_GET(curpmap); active = (pm == kernel_pmap || pm == pmap) ? 1 : 0; while (sz > 0) { @@ -2025,7 +2031,7 @@ mmu_booke_sync_icache(mmu_t mmu, pmap_t va += PAGE_SIZE; sz -= PAGE_SIZE; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -2173,7 +2179,7 @@ mmu_booke_is_modified(mmu_t mmu, vm_page if ((m->oflags & VPO_BUSY) == 0 && (m->aflags & PGA_WRITEABLE) == 0) return (rv); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && @@ -2185,7 +2191,7 @@ mmu_booke_is_modified(mmu_t mmu, vm_page if (rv) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -2214,7 +2220,7 @@ mmu_booke_is_referenced(mmu_t mmu, vm_pa KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("mmu_booke_is_referenced: page %p is not managed", m)); rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && @@ -2226,7 +2232,7 @@ mmu_booke_is_referenced(mmu_t mmu, vm_pa if (rv) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -2252,7 +2258,7 @@ mmu_booke_clear_modify(mmu_t mmu, vm_pag */ if ((m->aflags & PGA_WRITEABLE) == 0) return; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && @@ -2271,7 +2277,7 @@ mmu_booke_clear_modify(mmu_t mmu, vm_pag } PMAP_UNLOCK(pv->pv_pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -2294,7 +2300,7 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("mmu_booke_ts_referenced: page %p is not managed", m)); count = 0; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && @@ -2317,7 +2323,7 @@ mmu_booke_ts_referenced(mmu_t mmu, vm_pa } PMAP_UNLOCK(pv->pv_pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } @@ -2332,7 +2338,7 @@ mmu_booke_clear_reference(mmu_t mmu, vm_ KASSERT((m->oflags & VPO_UNMANAGED) == 0, ("mmu_booke_clear_reference: page %p is not managed", m)); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL && @@ -2350,7 +2356,7 @@ mmu_booke_clear_reference(mmu_t mmu, vm_ } PMAP_UNLOCK(pv->pv_pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); } /* @@ -2395,7 +2401,7 @@ mmu_booke_page_exists_quick(mmu_t mmu, p ("mmu_booke_page_exists_quick: page %p is not managed", m)); loops = 0; rv = FALSE; - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { if (pv->pv_pmap == pmap) { rv = TRUE; @@ -2404,7 +2410,7 @@ mmu_booke_page_exists_quick(mmu_t mmu, p if (++loops >= 16) break; } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (rv); } @@ -2421,7 +2427,7 @@ mmu_booke_page_wired_mappings(mmu_t mmu, if ((m->oflags & VPO_UNMANAGED) != 0) return (count); - vm_page_lock_queues(); + rw_wlock(&pvh_global_lock); TAILQ_FOREACH(pv, &m->md.pv_list, pv_link) { PMAP_LOCK(pv->pv_pmap); if ((pte = pte_find(mmu, pv->pv_pmap, pv->pv_va)) != NULL) @@ -2429,7 +2435,7 @@ mmu_booke_page_wired_mappings(mmu_t mmu, count++; PMAP_UNLOCK(pv->pv_pmap); } - vm_page_unlock_queues(); + rw_wunlock(&pvh_global_lock); return (count); } From owner-svn-src-head@FreeBSD.ORG Sat Nov 3 23:32:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1F6EBBE7; Sat, 3 Nov 2012 23:32:33 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07E9F8FC0A; Sat, 3 Nov 2012 23:32:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id qA3NWW1K067318; Sat, 3 Nov 2012 23:32:32 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id qA3NWWLN067315; Sat, 3 Nov 2012 23:32:32 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201211032332.qA3NWWLN067315@svn.freebsd.org> From: Attilio Rao Date: Sat, 3 Nov 2012 23:32:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r242536 - head/sys/fs/fuse X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Nov 2012 23:32:33 -0000 Author: attilio Date: Sat Nov 3 23:32:32 2012 New Revision: 242536 URL: http://svn.freebsd.org/changeset/base/242536 Log: Fix a bug where operations was carried on even if not implemented, leading to handling of an invalid fdip object. Reported and tested by: flo MFC after: 2 months X-MFC: 241519 Modified: head/sys/fs/fuse/fuse_vnops.c Modified: head/sys/fs/fuse/fuse_vnops.c ============================================================================== --- head/sys/fs/fuse/fuse_vnops.c Sat Nov 3 23:22:49 2012 (r242535) +++ head/sys/fs/fuse/fuse_vnops.c Sat Nov 3 23:32:32 2012 (r242536) @@ -358,12 +358,10 @@ fuse_vnop_create(struct vop_create_args err = fdisp_wait_answ(fdip); - if (err == ENOSYS) { - debug_printf("create: got ENOSYS from daemon\n"); - fsess_set_notimpl(mp, FUSE_CREATE); - fdisp_destroy(fdip); - } else if (err) { - debug_printf("create: darn, got err=%d from daemon\n", err); + if (err) { + if (err == ENOSYS) + fsess_set_notimpl(mp, FUSE_CREATE); + debug_printf("create: got err=%d from daemon\n", err); goto out; } bringup: